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

Method Execute

PostProcess/SuperResolution/src/SuperResolution.cpp:104–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void SuperResolution::Execute(const RenderAttributes& RenderAttribs)
105{
106 DEV_CHECK_ERR(RenderAttribs.pDevice != nullptr, "RenderAttribs.pDevice must not be null");
107 DEV_CHECK_ERR(RenderAttribs.pDeviceContext != nullptr, "RenderAttribs.pDeviceContext must not be null");
108 DEV_CHECK_ERR(RenderAttribs.pPostFXContext != nullptr, "RenderAttribs.pPostFXContext must not be null");
109
110 DEV_CHECK_ERR(RenderAttribs.pColorBufferSRV != nullptr, "RenderAttribs.pColorBufferSRV must not be null");
111 DEV_CHECK_ERR(RenderAttribs.pFSRAttribs != nullptr, "RenderAttribs.pFSRAttribs must not be null");
112
113 m_Resources.Insert(RESOURCE_IDENTIFIER_INPUT_COLOR, RenderAttribs.pColorBufferSRV->GetTexture());
114
115 ScopedDebugGroup DebugGroupGlobal{RenderAttribs.pDeviceContext, "SuperResolution"};
116
117 bool AllPSOsReady = PrepareShadersAndPSO(RenderAttribs, m_FeatureFlags);
118 UpdateConstantBuffer(RenderAttribs);
119 if (AllPSOsReady)
120 {
121 ComputeEdgeAdaptiveUpsampling(RenderAttribs);
122 ComputeContrastAdaptiveSharpening(RenderAttribs);
123 }
124 else
125 {
126 ComputePlaceholderTexture(RenderAttribs);
127 }
128
129 // Release references to input resources
130 for (Uint32 ResourceIdx = 0; ResourceIdx <= RESOURCE_IDENTIFIER_INPUT_LAST; ++ResourceIdx)
131 m_Resources[ResourceIdx].Release();
132}
133
134bool SuperResolution::UpdateUI(HLSL::SuperResolutionAttribs& Attribs, FEATURE_FLAGS& FeatureFlags)
135{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected