MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / Execute

Method Execute

PostProcess/DepthOfField/src/DepthOfField.cpp:290–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290void 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
331bool DepthOfField::UpdateUI(HLSL::DepthOfFieldAttribs& Attribs, FEATURE_FLAGS& FeatureFlags)
332{

Callers

nothing calls this directly

Calls 1

IsPSOsReadyMethod · 0.80

Tested by

no test coverage detected