| 288 | } |
| 289 | |
| 290 | void DepthOfField::Execute(const RenderAttributes& RenderAttribs) |
| 291 | { |
| 292 | DEV_CHECK_ERR(RenderAttribs.pDevice != nullptr, "RenderAttribs.pDevice must not be null"); |
| 293 | DEV_CHECK_ERR(RenderAttribs.pDeviceContext != nullptr, "RenderAttribs.pDeviceContext must not be null"); |
| 294 | DEV_CHECK_ERR(RenderAttribs.pPostFXContext != nullptr, "RenderAttribs.pPostFXContext must not be null"); |
| 295 | |
| 296 | DEV_CHECK_ERR(RenderAttribs.pColorBufferSRV != nullptr, "RenderAttribs.pColorBufferSRV must not be null"); |
| 297 | DEV_CHECK_ERR(RenderAttribs.pDepthBufferSRV != nullptr, "RenderAttribs.pDepthBufferSRV must not be null"); |
| 298 | DEV_CHECK_ERR(RenderAttribs.pDOFAttribs != nullptr, "RenderAttribs.pDOFAttribs must not be null"); |
| 299 | |
| 300 | m_Resources.Insert(RESOURCE_IDENTIFIER_INPUT_COLOR, RenderAttribs.pColorBufferSRV->GetTexture()); |
| 301 | m_Resources.Insert(RESOURCE_IDENTIFIER_INPUT_DEPTH, RenderAttribs.pDepthBufferSRV->GetTexture()); |
| 302 | |
| 303 | ScopedDebugGroup DebugGroupGlobal{RenderAttribs.pDeviceContext, "DepthOfField"}; |
| 304 | |
| 305 | bool AllPSOsReady = PrepareShadersAndPSO(RenderAttribs, m_FeatureFlags) && RenderAttribs.pPostFXContext->IsPSOsReady(); |
| 306 | UpdateConstantBuffers(RenderAttribs, !AllPSOsReady); |
| 307 | if (AllPSOsReady) |
| 308 | { |
| 309 | ComputeCircleOfConfusion(RenderAttribs); |
| 310 | ComputeTemporalCircleOfConfusion(RenderAttribs); |
| 311 | ComputeSeparatedCircleOfConfusion(RenderAttribs); |
| 312 | ComputeDilationCircleOfConfusion(RenderAttribs); |
| 313 | ComputeCircleOfConfusionBlurX(RenderAttribs); |
| 314 | ComputeCircleOfConfusionBlurY(RenderAttribs); |
| 315 | ComputePrefilteredTexture(RenderAttribs); |
| 316 | ComputeBokehFirstPass(RenderAttribs); |
| 317 | ComputeBokehSecondPass(RenderAttribs); |
| 318 | ComputePostFilteredTexture(RenderAttribs); |
| 319 | ComputeCombinedTexture(RenderAttribs); |
| 320 | } |
| 321 | else |
| 322 | { |
| 323 | ComputePlaceholderTexture(RenderAttribs); |
| 324 | } |
| 325 | |
| 326 | // Release references to input resources |
| 327 | for (Uint32 ResourceIdx = 0; ResourceIdx <= RESOURCE_IDENTIFIER_INPUT_LAST; ++ResourceIdx) |
| 328 | m_Resources[ResourceIdx].Release(); |
| 329 | } |
| 330 | |
| 331 | bool DepthOfField::UpdateUI(HLSL::DepthOfFieldAttribs& Attribs, FEATURE_FLAGS& FeatureFlags) |
| 332 | { |
nothing calls this directly
no test coverage detected