| 48 | } |
| 49 | |
| 50 | class Bloom |
| 51 | { |
| 52 | public: |
| 53 | enum FEATURE_FLAGS : Uint32 |
| 54 | { |
| 55 | FEATURE_FLAG_NONE = 0u |
| 56 | }; |
| 57 | |
| 58 | struct RenderAttributes |
| 59 | { |
| 60 | /// Render device that may be used to create new objects needed for this frame, if any. |
| 61 | IRenderDevice* pDevice = nullptr; |
| 62 | |
| 63 | /// Optional render state cache to optimize state loading. |
| 64 | IRenderStateCache* pStateCache = nullptr; |
| 65 | |
| 66 | /// Device context that will record the rendering commands. |
| 67 | IDeviceContext* pDeviceContext = nullptr; |
| 68 | |
| 69 | /// PostFX context |
| 70 | PostFXContext* pPostFXContext = nullptr; |
| 71 | |
| 72 | /// Shader resource view of the source color. |
| 73 | ITextureView* pColorBufferSRV = nullptr; |
| 74 | |
| 75 | /// Bloom settings |
| 76 | const HLSL::BloomAttribs* pBloomAttribs = nullptr; |
| 77 | }; |
| 78 | |
| 79 | struct CreateInfo |
| 80 | { |
| 81 | bool EnableAsyncCreation = false; |
| 82 | }; |
| 83 | |
| 84 | public: |
| 85 | Bloom(IRenderDevice* pDevice, const CreateInfo& CI); |
| 86 | |
| 87 | ~Bloom(); |
| 88 | |
| 89 | void PrepareResources(IRenderDevice* pDevice, IDeviceContext* pDeviceContext, PostFXContext* pPostFXContext, FEATURE_FLAGS FeatureFlags); |
| 90 | |
| 91 | void Execute(const RenderAttributes& RenderAttribs); |
| 92 | |
| 93 | static bool UpdateUI(HLSL::BloomAttribs& Attribs, FEATURE_FLAGS& FeatureFlags); |
| 94 | |
| 95 | ITextureView* GetBloomTextureSRV() const; |
| 96 | |
| 97 | private: |
| 98 | using RenderTechnique = PostFXRenderTechnique; |
| 99 | using ResourceInternal = RefCntAutoPtr<IDeviceObject>; |
| 100 | |
| 101 | enum RENDER_TECH : Uint32 |
| 102 | { |
| 103 | RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE = 0, |
| 104 | RENDER_TECH_COMPUTE_DOWNSAMPLED_TEXTURE, |
| 105 | RENDER_TECH_COMPUTE_UPSAMPLED_TEXTURE, |
| 106 | RENDER_TECH_COUNT |
| 107 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected