aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-01 08:04:11 +0200
committermarha <marha@users.sourceforge.net>2012-08-01 08:04:11 +0200
commit949282a6e80256ab56a1e95e484886873c7c0e4a (patch)
treed1102c4b3abd9dc93a2bf8808e498d10ba095390 /mesalib/src/glsl/link_uniforms.cpp
parent83da3ad0287bc51cd16ee6911fe73dc98ebe000b (diff)
parent49838240b7d4cff1ffed1bd91e495f6919061f90 (diff)
downloadvcxsrv-949282a6e80256ab56a1e95e484886873c7c0e4a.tar.gz
vcxsrv-949282a6e80256ab56a1e95e484886873c7c0e4a.tar.bz2
vcxsrv-949282a6e80256ab56a1e95e484886873c7c0e4a.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl/link_uniforms.cpp')
-rw-r--r--mesalib/src/glsl/link_uniforms.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/mesalib/src/glsl/link_uniforms.cpp b/mesalib/src/glsl/link_uniforms.cpp
index 307f5de09..7c3d74b82 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;