aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ast_to_hir.cpp')
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index 1c54991cf..02fe66b60 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -4054,11 +4054,15 @@ ast_uniform_block::hir(exec_list *instructions,
ubo_var->Type = var->type;
ubo_var->Buffer = ubo - state->uniform_blocks;
ubo_var->Offset = 0; /* Assigned at link time. */
- ubo_var->RowMajor = block_row_major;
- if (decl_list->type->qualifier.flags.q.row_major)
- ubo_var->RowMajor = true;
- else if (decl_list->type->qualifier.flags.q.column_major)
- ubo_var->RowMajor = false;
+
+ if (var->type->is_matrix() ||
+ (var->type->is_array() && var->type->fields.array->is_matrix())) {
+ ubo_var->RowMajor = block_row_major;
+ if (decl_list->type->qualifier.flags.q.row_major)
+ ubo_var->RowMajor = true;
+ else if (decl_list->type->qualifier.flags.q.column_major)
+ ubo_var->RowMajor = false;
+ }
/* From the GL_ARB_uniform_buffer_object spec:
*