| 245 | } |
| 246 | |
| 247 | void 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 | |
| 263 | void Bloom::ComputePrefilteredTexture(const RenderAttributes& RenderAttribs) |
| 264 | { |
nothing calls this directly
no outgoing calls
no test coverage detected