This can happens if we are running an SPIR-V shader (ARB_gl_spirv). --- src/mesa/main/shader_query.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index 11ecd71c575..b775b4231c2 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -1013,11 +1013,16 @@ get_buffer_property(struct gl_shader_program *shProg, *val = 0; for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; - struct gl_program_resource *uni = - _mesa_program_resource_find_name(shProg, GL_UNIFORM, iname, - NULL); - if (!uni) - continue; + /* IndexName can be NULL if we are using a SPIR-V shader + * (ARB_gl_spirv). + */ + if (iname != NULL) { + struct gl_program_resource *uni = + _mesa_program_resource_find_name(shProg, GL_UNIFORM, iname, + NULL); + if (!uni) + continue; + } (*val)++; } return 1; @@ -1049,11 +1054,16 @@ get_buffer_property(struct gl_shader_program *shProg, *val = 0; for (unsigned i = 0; i < RESOURCE_UBO(res)->NumUniforms; i++) { const char *iname = RESOURCE_UBO(res)->Uniforms[i].IndexName; - struct gl_program_resource *uni = - _mesa_program_resource_find_name(shProg, GL_BUFFER_VARIABLE, - iname, NULL); - if (!uni) - continue; + /* IndexName can be NULL if we are using a SPIR-V shader + * (ARB_gl_spirv). + */ + if (iname != NULL) { + struct gl_program_resource *uni = + _mesa_program_resource_find_name(shProg, GL_BUFFER_VARIABLE, + iname, NULL); + if (!uni) + continue; + } (*val)++; } return 1; -- 2.14.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev