From 14f13ae6564ba5eae152139a3bffe10638ad2150 Mon Sep 17 00:00:00 2001 From: SnapperTT <4939563+SnapperTT@users.noreply.github.com> Date: Tue, 21 May 2019 15:58:51 +1000 Subject: [PATCH] Fixed MRT buffers not being cleared if homogeneousDepth is disabled --- src/renderer_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 3b44f6f4e..ffb121f72 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3806,7 +3806,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) ); m_clearQuadDepth = infoClearDepth->m_handle; } - float mrtClearDepth[4] = { _clear.m_depth * 2.0f - 1.0f }; + float mrtClearDepth[4] = { g_caps.homogeneousDepth ? (_clear.m_depth * 2.0f - 1.0f) : _clear.m_depth }; updateUniform(m_clearQuadDepth.idx, mrtClearDepth, sizeof(float)*4); float mrtClearColor[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS][4];