From cfdb38c5908ebff0c56ece186aa687ba61b27a17 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Fri, 14 Feb 2014 20:43:00 -0800 Subject: [PATCH] Fixed EXT_bgra handling. --- src/renderer_gl.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 01359b733..2762373ab 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -1439,7 +1439,7 @@ namespace bgfx #if BGFX_CONFIG_RENDERER_OPENGL if (GL_RGBA == m_fmt - && s_renderCtx->m_textureSwizzleSupport) + && s_renderCtx->m_textureSwizzleSupport) { GLint swizzleMask[] = { GL_BLUE, GL_GREEN, GL_RED, GL_ALPHA }; GL_CHECK(glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask) ); @@ -1529,11 +1529,19 @@ namespace bgfx const GLenum internalFmt = s_textureFormat[m_textureFormat].m_internalFmt; - const bool swizzle = GL_RGBA == internalFmt && !s_renderCtx->m_textureSwizzleSupport; + const bool swizzle = GL_RGBA == m_fmt && !s_renderCtx->m_textureSwizzleSupport; const bool convert = m_textureFormat != m_requestedFormat; const bool compressed = TextureFormat::Unknown > m_textureFormat; const uint32_t min = convert && compressed ? 4 : 1; + BX_WARN(!swizzle && !convert, "Texture %s%s%s from %s to %s." + , swizzle ? "swizzle" : "" + , swizzle&&convert ? " and " : "" + , convert ? "convert" : "" + , getName( (TextureFormat::Enum)m_requestedFormat) + , getName( (TextureFormat::Enum)m_textureFormat) + ); + uint8_t* temp = NULL; if (convert || swizzle) {