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

Method UpdateConstantBuffer

PostProcess/Bloom/src/Bloom.cpp:247–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void Bloom::UpdateConstantBuffer(const RenderAttributes& RenderAttribs, bool ResetTimer)
248{
249 if (ResetTimer)
250 m_FrameTimer.Restart();
251
252 float Alpha = std::min(std::max(m_FrameTimer.GetElapsedTimef(), 0.0f), 1.0f);
253
254 bool UpdateRequired = m_BloomAttribs->AlphaInterpolation != Alpha || memcmp(RenderAttribs.pBloomAttribs, m_BloomAttribs.get(), sizeof(HLSL::BloomAttribs)) != 0;
255 if (UpdateRequired)
256 {
257 memcpy(m_BloomAttribs.get(), RenderAttribs.pBloomAttribs, sizeof(HLSL::BloomAttribs));
258 m_BloomAttribs->AlphaInterpolation = Alpha;
259 RenderAttribs.pDeviceContext->UpdateBuffer(m_Resources[RESOURCE_IDENTIFIER_CONSTANT_BUFFER].AsBuffer(), 0, sizeof(HLSL::BloomAttribs), m_BloomAttribs.get(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
260 }
261}
262
263void Bloom::ComputePrefilteredTexture(const RenderAttributes& RenderAttribs)
264{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected