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

Method ComputePrefilteredTexture

PostProcess/Bloom/src/Bloom.cpp:263–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void Bloom::ComputePrefilteredTexture(const RenderAttributes& RenderAttribs)
264{
265 auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE, m_FeatureFlags);
266
267 if (!RenderTech.IsInitializedSRB())
268 {
269 ShaderResourceVariableX{RenderTech.PSO, SHADER_TYPE_PIXEL, "cbBloomAttribs"}.Set(m_Resources[RESOURCE_IDENTIFIER_CONSTANT_BUFFER]);
270 RenderTech.InitializeSRB(true);
271 }
272
273 ScopedDebugGroup DebugGroup{RenderAttribs.pDeviceContext, "ComputePrefilteredTexture"};
274
275 ITextureView* pRTVs[] = {
276 m_DownsampledTextures[0]->GetDefaultView(TEXTURE_VIEW_RENDER_TARGET),
277 };
278
279 ShaderResourceVariableX{RenderTech.SRB, SHADER_TYPE_PIXEL, "g_TextureInput"}.Set(m_Resources[RESOURCE_IDENTIFIER_INPUT_COLOR].GetTextureSRV());
280
281 RenderAttribs.pDeviceContext->SetRenderTargets(1, pRTVs, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
282 RenderAttribs.pDeviceContext->SetPipelineState(RenderTech.PSO);
283 RenderAttribs.pDeviceContext->CommitShaderResources(RenderTech.SRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
284 RenderAttribs.pDeviceContext->Draw({3, DRAW_FLAG_VERIFY_ALL, 1});
285 RenderAttribs.pDeviceContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_NONE);
286}
287
288void Bloom::ComputeDownsampledTextures(const RenderAttributes& RenderAttribs)
289{

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