MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / preparePostFX

Method preparePostFX

Source/RenderPasses/SimplePostFX/SimplePostFX.cpp:291–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void SimplePostFX::preparePostFX(RenderContext* pRenderContext, uint32_t width, uint32_t height)
292{
293 for (int res = 0; res < kNumLevels + 1; ++res)
294 {
295 ref<Texture>& pBuf = mpPyramid[res];
296 if (getBloomAmount() <= 0.f)
297 {
298 pBuf = nullptr;
299 }
300 else
301 {
302 uint32_t w = std::max(1u, width >> res);
303 uint32_t h = std::max(1u, height >> res);
304 if (!pBuf || pBuf->getWidth() != w || pBuf->getHeight() != h)
305 {
306 pBuf = mpDevice->createTexture2D(
307 w, h, ResourceFormat::RGBA16Float, 1, 1, nullptr, ResourceBindFlags::ShaderResource | ResourceBindFlags::UnorderedAccess
308 );
309 FALCOR_ASSERT(pBuf);
310 }
311 }
312 }
313}
314
315void SimplePostFX::renderUI(Gui::Widgets& widget)
316{

Callers

nothing calls this directly

Calls 5

getBloomAmountFunction · 0.85
getWidthMethod · 0.80
getHeightMethod · 0.80
createTexture2DMethod · 0.80
maxFunction · 0.50

Tested by

no test coverage detected