Handle special formats like GL_LUMINANCE8_EXT separately

This commit is contained in:
baldurk
2014-11-12 00:47:38 +00:00
parent 45598feff5
commit ca03304adb
+15 -6
View File
@@ -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;
}