summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2015-11-02 13:36:19 +0200
committerTapani Pälli <[email protected]>2015-11-12 14:15:29 +0200
commitf2fe6072617fd77f1abe213ff8fd2c233908b63d (patch)
treedb83cb994aed33e6cf2aedb0632804f5391b9bf1 /src/glsl
parent7e6dac11866d264c21a108b9623114943d6e88ec (diff)
glsl: set matrix_stride for non matrices with atomic counter buffers
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 <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/link_atomics.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/link_atomics.cpp b/src/glsl/link_atomics.cpp
index cdcc06d53e2..3aa52dbd18a 100644
--- a/src/glsl/link_atomics.cpp
+++ b/src/glsl/link_atomics.cpp
@@ -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. */