| 380 | } |
| 381 | |
| 382 | void Bloom::Execute(const RenderAttributes& RenderAttribs) |
| 383 | { |
| 384 | DEV_CHECK_ERR(RenderAttribs.pDevice != nullptr, "RenderAttribs.pDevice must not be null"); |
| 385 | DEV_CHECK_ERR(RenderAttribs.pDeviceContext != nullptr, "RenderAttribs.pDeviceContext must not be null"); |
| 386 | DEV_CHECK_ERR(RenderAttribs.pPostFXContext != nullptr, "RenderAttribs.pPostFXContext must not be null"); |
| 387 | |
| 388 | DEV_CHECK_ERR(RenderAttribs.pColorBufferSRV != nullptr, "RenderAttribs.pColorBufferSRV must not be null"); |
| 389 | DEV_CHECK_ERR(RenderAttribs.pBloomAttribs != nullptr, "RenderAttribs.pBloomAttribs must not be null"); |
| 390 | |
| 391 | m_Resources.Insert(RESOURCE_IDENTIFIER_INPUT_COLOR, RenderAttribs.pColorBufferSRV->GetTexture()); |
| 392 | |
| 393 | ScopedDebugGroup DebugGroupGlobal{RenderAttribs.pDeviceContext, "Bloom"}; |
| 394 | |
| 395 | bool AllPSOsReady = PrepareShadersAndPSO(RenderAttribs, m_FeatureFlags) && RenderAttribs.pPostFXContext->IsPSOsReady(); |
| 396 | UpdateConstantBuffer(RenderAttribs, !AllPSOsReady); |
| 397 | if (AllPSOsReady) |
| 398 | { |
| 399 | ComputePrefilteredTexture(RenderAttribs); |
| 400 | ComputeDownsampledTextures(RenderAttribs); |
| 401 | ComputeUpsampledTextures(RenderAttribs); |
| 402 | } |
| 403 | else |
| 404 | { |
| 405 | ComputePlaceholderTexture(RenderAttribs); |
| 406 | } |
| 407 | |
| 408 | // Release references to input resources |
| 409 | for (Uint32 ResourceIdx = 0; ResourceIdx <= RESOURCE_IDENTIFIER_INPUT_LAST; ++ResourceIdx) |
| 410 | m_Resources[ResourceIdx].Release(); |
| 411 | } |
| 412 | |
| 413 | Bloom::RenderTechnique& Bloom::GetRenderTechnique(RENDER_TECH RenderTech, FEATURE_FLAGS FeatureFlags) |
| 414 | { |
nothing calls this directly
no test coverage detected