Fix 43-denoise when FB format invalid (#2480)

This commit is contained in:
Hugo Amnov 2021-04-19 06:14:57 +02:00 committed by GitHub
parent e626440d86
commit daad11fa0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions

View File

@ -967,12 +967,16 @@ public:
m_gbufferTex[GBUFFER_RT_DEPTH] = bgfx::createTexture2D(uint16_t(m_size[0]), uint16_t(m_size[1]), false, 1, bgfx::TextureFormat::D32F , pointSampleFlags);
m_gbuffer = bgfx::createFrameBuffer(BX_COUNTOF(m_gbufferTex), m_gbufferTex, true);
m_currentColor.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, bilinearFlags);
m_previousColor.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, bilinearFlags);
m_txaaColor.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, bilinearFlags);
m_temporaryColor.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, bilinearFlags);
m_previousNormal.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, pointSampleFlags);
m_previousDenoise.init(m_size[0], m_size[1], bgfx::TextureFormat::RG11B10F, bilinearFlags);
bgfx::TextureFormat::Enum format = bgfx::TextureFormat::RG11B10F;
if (!bgfx::isTextureValid(1, false, 1, format, bilinearFlags))
format = bgfx::TextureFormat::RGBA16F;
m_currentColor.init(m_size[0], m_size[1], format, bilinearFlags);
m_previousColor.init(m_size[0], m_size[1], format, bilinearFlags);
m_txaaColor.init(m_size[0], m_size[1], format, bilinearFlags);
m_temporaryColor.init(m_size[0], m_size[1], format, bilinearFlags);
m_previousNormal.init(m_size[0], m_size[1], format, pointSampleFlags);
m_previousDenoise.init(m_size[0], m_size[1], format, bilinearFlags);
}
// all buffers set to destroy their textures