mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 16:50:44 +00:00
Handle unsized depth/stencil formats correctly
This commit is contained in:
@@ -1820,13 +1820,16 @@ ResourceFormat MakeResourceFormat(const GLHookSet &gl, GLenum target, GLenum fmt
|
||||
ret.compByteWidth = 3;
|
||||
ret.compCount = 1;
|
||||
break;
|
||||
case eGL_DEPTH_COMPONENT:
|
||||
case eGL_DEPTH_COMPONENT32:
|
||||
case eGL_DEPTH_COMPONENT32F:
|
||||
ret.compByteWidth = 4;
|
||||
ret.compCount = 1;
|
||||
break;
|
||||
case eGL_DEPTH24_STENCIL8: ret.type = ResourceFormatType::D24S8; break;
|
||||
case eGL_DEPTH_STENCIL:
|
||||
case eGL_DEPTH32F_STENCIL8: ret.type = ResourceFormatType::D32S8; break;
|
||||
case eGL_STENCIL_INDEX:
|
||||
case eGL_STENCIL_INDEX8: ret.type = ResourceFormatType::S8; break;
|
||||
default: RDCERR("Unexpected depth or stencil format '%s'", ToStr(fmt).c_str());
|
||||
}
|
||||
|
||||
@@ -493,6 +493,7 @@ GLenum GetDataType(GLenum internalFormat)
|
||||
case eGL_RG32UI:
|
||||
case eGL_R32UI:
|
||||
case eGL_RGB32UI:
|
||||
case eGL_DEPTH_COMPONENT:
|
||||
case eGL_DEPTH_COMPONENT24:
|
||||
case eGL_DEPTH_COMPONENT32: return eGL_UNSIGNED_INT;
|
||||
case eGL_RGBA32I:
|
||||
@@ -520,7 +521,9 @@ GLenum GetDataType(GLenum internalFormat)
|
||||
case eGL_RGB10: return eGL_UNSIGNED_INT_10_10_10_2;
|
||||
case eGL_RGB9_E5: return eGL_UNSIGNED_INT_5_9_9_9_REV;
|
||||
case eGL_DEPTH24_STENCIL8: return eGL_UNSIGNED_INT_24_8;
|
||||
case eGL_DEPTH_STENCIL:
|
||||
case eGL_DEPTH32F_STENCIL8: return eGL_FLOAT_32_UNSIGNED_INT_24_8_REV;
|
||||
case eGL_STENCIL_INDEX:
|
||||
case eGL_STENCIL_INDEX8: return eGL_UNSIGNED_BYTE;
|
||||
case eGL_ALPHA:
|
||||
case eGL_ALPHA8_EXT:
|
||||
|
||||
Reference in New Issue
Block a user