| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
- // All rights reserved.
- // Code licensed under the BSD License.
- // http://www.anki3d.org/LICENSE
- #pragma once
- #include <AnKi/Renderer/RendererObject.h>
- namespace anki {
- /// @addtogroup renderer
- /// @{
- /// Downsample the IS and blur it at the same time.
- class DownscaleBlur : public RendererObject
- {
- public:
- DownscaleBlur(Renderer* r)
- : RendererObject(r)
- {
- }
- ~DownscaleBlur();
- ANKI_USE_RESULT Error init(const ConfigSet& cfg);
- /// Import render targets
- void importRenderTargets(RenderingContext& ctx);
- /// Populate the rendergraph.
- void populateRenderGraph(RenderingContext& ctx);
- U32 getPassWidth(U32 pass) const
- {
- return m_rtTex->getWidth() >> min(pass, m_passCount - 1);
- }
- U32 getPassHeight(U32 pass) const
- {
- return m_rtTex->getHeight() >> min(pass, m_passCount - 1);
- }
- U32 getMipmapCount() const
- {
- return m_passCount;
- }
- RenderTargetHandle getRt() const
- {
- return m_runCtx.m_rt;
- }
- private:
- static const Bool m_useCompute = true;
- Array<U32, 2> m_workgroupSize = {0, 0};
- U32 m_passCount = 0; ///< It's also the mip count of the m_rtTex.
- TexturePtr m_rtTex;
- DynamicArray<FramebufferDescription> m_fbDescrs;
- ShaderProgramResourcePtr m_prog;
- ShaderProgramPtr m_grProg;
- class
- {
- public:
- RenderTargetHandle m_rt;
- } m_runCtx;
- ANKI_USE_RESULT Error initInternal(const ConfigSet& cfg);
- ANKI_USE_RESULT Error initSubpass(U idx, const UVec2& inputTexSize);
- void run(U32 passIdx, RenderPassWorkContext& rgraphCtx);
- };
- /// @}
- } // end namespace anki
|