glsl: set matrix_stride for non matrices with atomic counter buffers
authorTapani Pälli <tapani.palli@intel.com>
Mon, 2 Nov 2015 11:36:19 +0000 (13:36 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 12 Nov 2015 12:15:29 +0000 (14:15 +0200)
Patch sets matrix_stride as 0 for non matrix uniforms that are in a
atomic counter buffer. Matrix stride calculation for actual matrix
uniforms is done during link_assign_uniform_locations.

From ARB_program_interface_query specification:

GL_MATRIX_STRIDE:

   "For active variables not declared as a matrix or array of matrices,
   zero is written to <params>.  For active variables not backed by a
   buffer object, -1 is written to <params>, regardless of the variable
   type."

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
src/glsl/link_atomics.cpp

index cdcc06d53e232461b7af9722f540b85d131bcbf7..3aa52dbd18a903bde9dfaf6dd07e1c57b584e6e4 100644 (file)
@@ -240,6 +240,8 @@ link_assign_atomic_counter_resources(struct gl_context *ctx,
          storage->offset = var->data.atomic.offset;
          storage->array_stride = (var->type->is_array() ?
                                   var->type->without_array()->atomic_size() : 0);
+         if (!var->type->is_matrix())
+            storage->matrix_stride = 0;
       }
 
       /* Assign stage-specific fields. */