Skip to content

Commit 67f56bf

Browse files
committed
When creating SPIR-V bindpoint mapping ensure we cover all attrib binds
1 parent 4f3ea6d commit 67f56bf

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

renderdoc/driver/gl/gl_shader_refl.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,6 +2667,19 @@ void EvaluateSPIRVBindpointMapping(GLuint curProg, int shadIdx, const ShaderRefl
26672667
if(mapping.inputAttributes[i] < 0)
26682668
mapping.inputAttributes[i] = -1;
26692669

2670+
// ensure the mapping contains a value for all valid vertex attribs, even if it doesn't use them.
2671+
GLint numVAttribBindings = 16;
2672+
GL.glGetIntegerv(eGL_MAX_VERTEX_ATTRIBS, &numVAttribBindings);
2673+
2674+
// if more vertex attribs exist, resize and set them all to -1
2675+
if(numVAttribBindings > mapping.inputAttributes.count())
2676+
{
2677+
size_t prevSize = mapping.inputAttributes.size();
2678+
mapping.inputAttributes.resize(numVAttribBindings);
2679+
for(size_t i = prevSize; i < mapping.inputAttributes.size(); i++)
2680+
mapping.inputAttributes[i] = -1;
2681+
}
2682+
26702683
#if ENABLED(RDOC_DEVEL)
26712684
for(size_t i = 1; i < ARRAY_COUNT(dummyReadback); i++)
26722685
if(dummyReadback[i] != 0x6c7b8a9d)

0 commit comments

Comments
 (0)