mesa: refactor GetUniformIndices
authorTapani Pälli <tapani.palli@intel.com>
Thu, 12 Mar 2015 12:37:20 +0000 (14:37 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 16 Apr 2015 04:55:57 +0000 (07:55 +0300)
Use _mesa_program_resource_index to get indices.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
src/mesa/main/uniforms.c

index 0c16641533cf39e4531faddfd8fea72d6b7b26fa..f4de1df4426ca4236ee58a2b73d145b225d34d2a 100644 (file)
@@ -986,9 +986,9 @@ _mesa_GetUniformIndices(GLuint program,
    }
 
    for (i = 0; i < uniformCount; i++) {
-      unsigned offset;
-      uniformIndices[i] = _mesa_get_uniform_location(shProg,
-                                                    uniformNames[i], &offset);
+      struct gl_program_resource *res =
+         _mesa_program_resource_find_name(shProg, GL_UNIFORM, uniformNames[i]);
+      uniformIndices[i] = _mesa_program_resource_index(shProg, res);
    }
 }