From f2fe6072617fd77f1abe213ff8fd2c233908b63d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Mon, 2 Nov 2015 13:36:19 +0200 Subject: [PATCH] glsl: set matrix_stride for non matrices with atomic counter buffers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 . For active variables not backed by a buffer object, -1 is written to , regardless of the variable type." Signed-off-by: Tapani Pälli Reviewed-by: Marta Lofstedt --- src/glsl/link_atomics.cpp | 2 ++ 1 file changed, 2 insertions(+) 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. */ -- 2.30.2