summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-07-23 14:31:42 -0700
committerEric Anholt <[email protected]>2012-08-07 13:54:50 -0700
commit86e0045578cd8d8be7736a8f56e2b51d61bda32a (patch)
tree500b17b41cd09afb4a88d40a5ea6bd27b83ac865 /src/glsl/ast_to_hir.cpp
parentffb2d430596258aaeaf3b7ae7f295036ea4094d5 (diff)
glsl: Only flag RowMajor on matrix-type variables.
We were only propagating it to the API when the variable was a matrix type, but we were still tripping over it in lower_ubo_reference when it was set on a vector. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 1c54991cf74..02fe66b6012 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/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:
*