From 49838240b7d4cff1ffed1bd91e495f6919061f90 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 1 Aug 2012 08:02:35 +0200 Subject: git mesa update 1 Aug 2012 --- mesalib/src/glsl/link_uniforms.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'mesalib/src/glsl/link_uniforms.cpp') diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp index d7ef5d4d2..1baa46c5d 100644 --- a/mesalib/src/glsl/link_uniforms.cpp +++ b/mesalib/src/glsl/link_uniforms.cpp @@ -328,10 +328,21 @@ private: this->uniforms[id].offset = this->ubo_byte_offset; this->ubo_byte_offset += type->std140_size(ubo_var->RowMajor); - this->uniforms[id].array_stride = 0; - this->uniforms[id].matrix_stride = 0; - this->uniforms[id].row_major = base_type->is_matrix() && - ubo_var->RowMajor; + if (type->is_array()) { + this->uniforms[id].array_stride = + align(type->fields.array->std140_size(ubo_var->RowMajor), 16); + } else { + this->uniforms[id].array_stride = 0; + } + + if (type->is_matrix() || + (type->is_array() && type->fields.array->is_matrix())) { + this->uniforms[id].matrix_stride = 16; + this->uniforms[id].row_major = ubo_var->RowMajor; + } else { + this->uniforms[id].matrix_stride = 0; + this->uniforms[id].row_major = false; + } } else { this->uniforms[id].block_index = -1; this->uniforms[id].offset = -1; -- cgit v1.2.3