From d93ad942f278d0fbde1dca0a21db40df8c80d110 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 1 Aug 2018 16:06:06 +0100 Subject: [PATCH] Fix component type/count values for depth/stencil GL types --- renderdoc/driver/gl/gl_common.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/renderdoc/driver/gl/gl_common.cpp b/renderdoc/driver/gl/gl_common.cpp index d02301c8d..5e047bd03 100644 --- a/renderdoc/driver/gl/gl_common.cpp +++ b/renderdoc/driver/gl/gl_common.cpp @@ -1967,11 +1967,23 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt) ret.compByteWidth = 4; ret.compCount = 1; break; - case eGL_DEPTH24_STENCIL8: ret.type = ResourceFormatType::D24S8; break; + case eGL_DEPTH24_STENCIL8: + ret.compByteWidth = 0; + ret.compCount = 2; + ret.type = ResourceFormatType::D24S8; + break; case eGL_DEPTH_STENCIL: - case eGL_DEPTH32F_STENCIL8: ret.type = ResourceFormatType::D32S8; break; + case eGL_DEPTH32F_STENCIL8: + ret.compByteWidth = 0; + ret.compCount = 2; + ret.type = ResourceFormatType::D32S8; + break; case eGL_STENCIL_INDEX: - case eGL_STENCIL_INDEX8: ret.type = ResourceFormatType::S8; break; + case eGL_STENCIL_INDEX8: + ret.compByteWidth = 1; + ret.compCount = 1; + ret.type = ResourceFormatType::S8; + break; default: RDCERR("Unexpected depth or stencil format '%s'", ToStr(fmt).c_str()); } }