From d0a467230751db396779e10b59fd37de74443d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sun, 10 Jul 2022 23:26:39 -0700 Subject: [PATCH] Cleanup. --- src/renderer_gl.cpp | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 907989bef..d3df29e96 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -4019,12 +4019,14 @@ namespace bgfx { namespace gl GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_backBufferFbo) ); GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_msaaBackBufferFbo) ); GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0) ); - uint32_t width = m_resolution.width; - uint32_t height = m_resolution.height; - GLenum filter = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || !m_gles3 - ? GL_NEAREST - : GL_LINEAR - ; + + const uint32_t width = m_resolution.width; + const uint32_t height = m_resolution.height; + const GLenum filter = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || !m_gles3 + ? GL_NEAREST + : GL_LINEAR + ; + if (m_gles3) { GL_CHECK(glUseProgram(m_msaaBlitProgram) ); @@ -4034,17 +4036,18 @@ namespace bgfx { namespace gl } else { - GL_CHECK(glBlitFramebuffer(0 - , 0 - , width - , height - , 0 - , 0 - , width - , height - , GL_COLOR_BUFFER_BIT - , filter - ) ); + GL_CHECK(glBlitFramebuffer( + 0 + , 0 + , width + , height + , 0 + , 0 + , width + , height + , GL_COLOR_BUFFER_BIT + , filter + ) ); } GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_backBufferFbo) ); @@ -4368,6 +4371,7 @@ namespace bgfx { namespace gl setUniform1i(loc, *(int32_t*)data); } break; + case UniformType::Vec4: if (num > 1) { @@ -4387,7 +4391,8 @@ namespace bgfx { namespace gl case UniformType::Vec4: setUniform4fv(loc, num, (float*)data); break; -#endif +#endif // BX_PLATFORM_EMSCRIPTEN + case UniformType::Mat3: setUniformMatrix3fv(loc, num, GL_FALSE, (float*)data); break; @@ -4517,14 +4522,18 @@ namespace bgfx { namespace gl { const UniformRegInfo* infoClearColor = m_uniformReg.find("bgfx_clear_color"); if (NULL != infoClearColor) + { m_clearQuadColor = infoClearColor->m_handle; + } } if (m_clearQuadDepth.idx == kInvalidHandle) { const UniformRegInfo* infoClearDepth = m_uniformReg.find("bgfx_clear_depth"); if (NULL != infoClearDepth) + { m_clearQuadDepth = infoClearDepth->m_handle; + } } float mrtClearDepth[4] = { g_caps.homogeneousDepth ? (_clear.m_depth * 2.0f - 1.0f) : _clear.m_depth };