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

Method ComputePreviousDepth

PostProcess/Common/src/PostFXContext.cpp:634–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634void PostFXContext::ComputePreviousDepth(const RenderAttributes& RenderAttribs)
635{
636 auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREVIOUS_DEPTH, m_FeatureFlags, TEX_FORMAT_UNKNOWN);
637 if (!RenderTech.IsInitializedSRB())
638 RenderTech.InitializeSRB(false);
639
640 ScopedDebugGroup DebugGroup{RenderAttribs.pDeviceContext, "ComputePreviousDepth"};
641
642 ShaderResourceVariableX{RenderTech.SRB, SHADER_TYPE_PIXEL, "g_Texture"}.Set(m_Resources[RESOURCE_IDENTIFIER_INPUT_PREV_DEPTH].GetTextureSRV());
643
644 ITextureView* pRTVs[] = {
645 m_Resources[RESOURCE_IDENTIFIER_PREVIOUS_DEPTH].GetTextureRTV(),
646 };
647
648 RenderAttribs.pDeviceContext->SetRenderTargets(_countof(pRTVs), pRTVs, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
649 RenderAttribs.pDeviceContext->SetPipelineState(RenderTech.PSO);
650 RenderAttribs.pDeviceContext->CommitShaderResources(RenderTech.SRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
651 RenderAttribs.pDeviceContext->Draw({3, DRAW_FLAG_VERIFY_ALL, 1});
652 RenderAttribs.pDeviceContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_NONE);
653}
654
655PostFXContext::RenderTechnique& PostFXContext::GetRenderTechnique(RENDER_TECH RenderTech, FEATURE_FLAGS FeatureFlags, TEXTURE_FORMAT TextureFormat)
656{

Callers

nothing calls this directly

Calls 4

IsInitializedSRBMethod · 0.80
InitializeSRBMethod · 0.80
SetPipelineStateMethod · 0.80
CommitShaderResourcesMethod · 0.80

Tested by

no test coverage detected