From ca03304adb3b489b1565db5bf188b92413c46484 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 12 Nov 2014 00:47:38 +0000 Subject: [PATCH] Handle special formats like GL_LUMINANCE8_EXT separately --- renderdoc/driver/gl/gl_common.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index 5705c3e16..e15a0dd42 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -148,13 +148,24 @@ ResourceFormat MakeResourceFormat(WrappedOpenGL &gl, GLenum target, GLenum fmt) { ResourceFormat ret; - ret.compByteWidth = 1; - ret.compCount = 4; - ret.compType = eCompType_Float; - ret.rawType = (uint32_t)fmt; ret.special = false; ret.specialFormat = eSpecial_Unknown; + ret.strname = widen(ToStr::Get(fmt)).substr(3); // 3 == strlen("GL_") + + // special handling for formats that don't query neatly + if(fmt == eGL_LUMINANCE8_EXT) + { + ret.compByteWidth = 1; + ret.compCount = 1; + ret.compType = eCompType_UNorm; + ret.srgbCorrected = false; + return ret; + } + + ret.compByteWidth = 1; + ret.compCount = 4; + ret.compType = eCompType_Float; GLint data[8]; GLenum *edata = (GLenum *)data; @@ -275,8 +286,6 @@ ResourceFormat MakeResourceFormat(WrappedOpenGL &gl, GLenum target, GLenum fmt) RDCERR("Unexpected texture type, not colour or depth"); } - ret.strname = widen(ToStr::Get(fmt)).substr(3); // 3 == strlen("GL_") - return ret; }