aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_types.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-13 10:09:30 +0200
committermarha <marha@users.sourceforge.net>2012-08-13 10:09:30 +0200
commit9ddf44af81782451cee798e06749ce3067a14a41 (patch)
treef84b06f6897929113f080d8e505621fa6bf73fb9 /mesalib/src/glsl/glsl_types.cpp
parentf8e35ebbe71eed74ccf68af8ccda4182f1edc7f0 (diff)
downloadvcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.tar.gz
vcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.tar.bz2
vcxsrv-9ddf44af81782451cee798e06749ce3067a14a41.zip
mesa pixman xkeyboard-config xserver git update 13 Aug 2012
Diffstat (limited to 'mesalib/src/glsl/glsl_types.cpp')
-rw-r--r--mesalib/src/glsl/glsl_types.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp
index 3d7866058..2aa51f0b3 100644
--- a/mesalib/src/glsl/glsl_types.cpp
+++ b/mesalib/src/glsl/glsl_types.cpp
@@ -694,14 +694,19 @@ glsl_type::std140_base_alignment(bool row_major) const
* row vectors with <C> components each, according to rule (4).
*/
if (this->is_matrix()) {
- const struct glsl_type *vec_type;
+ const struct glsl_type *vec_type, *array_type;
+ int c = this->matrix_columns;
+ int r = this->vector_elements;
+
if (row_major) {
- vec_type = get_instance(GLSL_TYPE_FLOAT, this->vector_elements, 1);
+ vec_type = get_instance(GLSL_TYPE_FLOAT, c, 1);
+ array_type = glsl_type::get_array_instance(vec_type, r);
} else {
- vec_type = get_instance(GLSL_TYPE_FLOAT, this->matrix_columns, 1);
+ vec_type = get_instance(GLSL_TYPE_FLOAT, r, 1);
+ array_type = glsl_type::get_array_instance(vec_type, c);
}
- return vec_type->std140_base_alignment(false);
+ return array_type->std140_base_alignment(false);
}
/* (9) If the member is a structure, the base alignment of the