[Mesa-dev] [PATCH] mesa: fix name returned for XFB varyings

Tapani Pälli tapani.palli at intel.com
Mon Aug 3 01:10:36 PDT 2015


_mesa_get_program_resource_name has logic to append '[0]' in name
if variable is an array, this should be skipped for XFB varyings
that have array index already appended.

Fixes:
   ES31-CTS.program_interface_query.transform-feedback-types

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/mesa/main/shader_query.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index c1a7660..a50c348 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -726,6 +726,12 @@ _mesa_get_program_resource_name(struct gl_shader_program *shProg,
    bool add_index = !(((programInterface == GL_PROGRAM_INPUT) &&
                        res->StageReferences & (1 << MESA_SHADER_GEOMETRY)));
 
+   /* Transform feedback varyings have possible array index already appended
+    * in their names.
+    */
+   if (programInterface == GL_TRANSFORM_FEEDBACK_VARYING)
+      add_index = false;
+
    if (add_index && _mesa_program_resource_array_size(res)) {
       int i;
 
-- 
2.1.0



More information about the mesa-dev mailing list