From d12aa5196c0d0959dd0c2427cee6176744c49806 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 24 Aug 2017 21:04:46 +0100 Subject: [PATCH] Don't use uint8_t compCount to store GL enum that might be GL_BGRA --- renderdoc/driver/gl/gl_replay.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 88e4175cd..fa03f3757 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -941,7 +941,10 @@ void GLReplay::SavePipelineState() fmt.type = ResourceFormatType::Regular; fmt.compCount = 4; - gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_SIZE, (GLint *)&fmt.compCount); + GLint compCount; + gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_SIZE, (GLint *)&compCount); + + fmt.compCount = (uint8_t)compCount; bool intComponent = !normalized || integer; @@ -1001,7 +1004,7 @@ void GLReplay::SavePipelineState() break; } - if(fmt.compCount == eGL_BGRA) + if(compCount == eGL_BGRA) { fmt.compByteWidth = 1; fmt.compCount = 4;