Skip to content

Commit d12aa51

Browse files
committed
Don't use uint8_t compCount to store GL enum that might be GL_BGRA
1 parent 2a0fac1 commit d12aa51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

renderdoc/driver/gl/gl_replay.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,10 @@ void GLReplay::SavePipelineState()
941941

942942
fmt.type = ResourceFormatType::Regular;
943943
fmt.compCount = 4;
944-
gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_SIZE, (GLint *)&fmt.compCount);
944+
GLint compCount;
945+
gl.glGetVertexAttribiv(i, eGL_VERTEX_ATTRIB_ARRAY_SIZE, (GLint *)&compCount);
946+
947+
fmt.compCount = (uint8_t)compCount;
945948

946949
bool intComponent = !normalized || integer;
947950

@@ -1001,7 +1004,7 @@ void GLReplay::SavePipelineState()
10011004
break;
10021005
}
10031006

1004-
if(fmt.compCount == eGL_BGRA)
1007+
if(compCount == eGL_BGRA)
10051008
{
10061009
fmt.compByteWidth = 1;
10071010
fmt.compCount = 4;

0 commit comments

Comments
 (0)