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

Method ComputeClosestMotion

PostProcess/Common/src/PostFXContext.cpp:612–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612void PostFXContext::ComputeClosestMotion(const RenderAttributes& RenderAttribs)
613{
614 auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_CLOSEST_MOTION, m_FeatureFlags, TEX_FORMAT_UNKNOWN);
615 if (!RenderTech.IsInitializedSRB())
616 RenderTech.InitializeSRB(false);
617
618 ScopedDebugGroup DebugGroup{RenderAttribs.pDeviceContext, "ComputeClosestMotion"};
619
620 ShaderResourceVariableX{RenderTech.SRB, SHADER_TYPE_PIXEL, "g_TextureDepth"}.Set(m_Resources[RESOURCE_IDENTIFIER_INPUT_CURR_DEPTH].GetTextureSRV());
621 ShaderResourceVariableX{RenderTech.SRB, SHADER_TYPE_PIXEL, "g_TextureMotion"}.Set(m_Resources[RESOURCE_IDENTIFIER_INPUT_MOTION_VECTORS].GetTextureSRV());
622
623 ITextureView* pRTVs[] = {
624 m_Resources[RESOURCE_IDENTIFIER_CLOSEST_MOTION].GetTextureRTV(),
625 };
626
627 RenderAttribs.pDeviceContext->SetRenderTargets(_countof(pRTVs), pRTVs, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
628 RenderAttribs.pDeviceContext->SetPipelineState(RenderTech.PSO);
629 RenderAttribs.pDeviceContext->CommitShaderResources(RenderTech.SRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
630 RenderAttribs.pDeviceContext->Draw({3, DRAW_FLAG_VERIFY_ALL, 1});
631 RenderAttribs.pDeviceContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_NONE);
632}
633
634void PostFXContext::ComputePreviousDepth(const RenderAttributes& RenderAttribs)
635{

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