From 2a2ac0624dfcde169aaf5e5df80d3ed657df3dba Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 27 Jun 2018 11:52:43 +0100 Subject: [PATCH] Handle unsized depth/stencil formats correctly --- renderdoc/driver/gl/gl_common.cpp | 3 +++ renderdoc/driver/gl/gl_resources.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index a28c40650..8b06f8a77 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -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()); } diff --git a/renderdoc/driver/gl/gl_resources.cpp b/renderdoc/driver/gl/gl_resources.cpp index a186f115f..85b3cc739 100644 --- a/renderdoc/driver/gl/gl_resources.cpp +++ b/renderdoc/driver/gl/gl_resources.cpp @@ -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: