[Mesa-dev] [PATCH] mesa: support arrays of structures in GetProgramResourceIndex

Tapani Pälli tapani.palli at intel.com
Wed Jul 29 23:44:45 PDT 2015


This fixes a lot of failing tests in:
   ES31-CTS.program_interface_query.uniform-types

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/mesa/main/program_resource.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
index 641ef22..6c0a923 100644
--- a/src/mesa/main/program_resource.c
+++ b/src/mesa/main/program_resource.c
@@ -212,13 +212,16 @@ valid_program_resource_index_name(const GLchar *name)
 {
    const char *array = strstr(name, "[");
    const char *close = strrchr(name, ']');
+   const char *after = close ? close + 1 : NULL;
 
    /* Not array, no need for the check. */
    if (!array)
       return true;
 
-   /* Last array index has to be zero. */
-   if (!close || *--close != '0')
+   /* Last array index has to be zero, for the exception when
+    * dealing with arrays of structures.
+    */
+   if (!close || (*--close != '0' && *after != '.'))
       return false;
 
    return true;
-- 
2.1.0



More information about the mesa-dev mailing list