[Mesa-dev] [PATCH 2/2] mesa: fix ARRAY_SIZE query for GetProgramResourceiv
Tapani Pälli
tapani.palli at intel.com
Sun Aug 2 23:02:58 PDT 2015
Fixes rest of the failures with
ES31-CTS.program_interface_query.no-locations
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
src/mesa/main/shader_query.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index b49fd38..c68fe63 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -475,8 +475,11 @@ _mesa_program_resource_array_size(struct gl_program_resource *res)
return RESOURCE_XFB(res)->Size > 1 ?
RESOURCE_XFB(res)->Size : 0;
case GL_PROGRAM_INPUT:
+ if (is_active_attrib(RESOURCE_VAR(res)))
+ return 0;
+ /* fallthrough */
case GL_PROGRAM_OUTPUT:
- return RESOURCE_VAR(res)->data.max_array_access;
+ return RESOURCE_VAR(res)->type->length;
case GL_UNIFORM:
case GL_VERTEX_SUBROUTINE_UNIFORM:
case GL_GEOMETRY_SUBROUTINE_UNIFORM:
@@ -991,7 +994,7 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
return 1;
case GL_PROGRAM_INPUT:
case GL_PROGRAM_OUTPUT:
- *val = MAX2(RESOURCE_VAR(res)->type->length, 1);
+ *val = MAX2(_mesa_program_resource_array_size(res), 1);
return 1;
case GL_TRANSFORM_FEEDBACK_VARYING:
*val = MAX2(RESOURCE_XFB(res)->Size, 1);
--
2.1.0
More information about the mesa-dev
mailing list