summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-02-14 16:18:36 +1100
committerTimothy Arceri <[email protected]>2016-03-05 19:06:56 +1100
commitd244986bf20aedf5ef6a156ec97d33f485993323 (patch)
tree9843d5e9e056212481f2b1899431c4c65e6352c1 /src/compiler
parent4ba7ad6cc13b087e5e95073ab2e24de591d8b5a5 (diff)
glsl: don't apply uniform/buffer layouts to interface blocks
If the following patch we will stop setting these layouts by default on interface blocks, so we need to do this to avoid hitting the assert. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index db5ec9a4ad9..7e928c48e0e 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -6465,8 +6465,10 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
* the structure may contain a structure that contains ... a matrix
* that need the proper layout.
*/
- if (field_type->without_array()->is_matrix()
- || field_type->without_array()->is_record()) {
+ if (is_interface &&
+ (layout->flags.q.uniform || layout->flags.q.buffer) &&
+ (field_type->without_array()->is_matrix()
+ || field_type->without_array()->is_record())) {
/* If no layout is specified for the field, inherit the layout
* from the block.
*/
@@ -6477,11 +6479,10 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
else if (qual->flags.q.column_major)
fields[i].matrix_layout = GLSL_MATRIX_LAYOUT_COLUMN_MAJOR;
- /* If we're processing an interface block, the matrix layout must
- * be decided by this point.
+ /* If we're processing an uniform or buffer block, the matrix
+ * layout must be decided by this point.
*/
- assert(!is_interface
- || fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR
+ assert(fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR
|| fields[i].matrix_layout == GLSL_MATRIX_LAYOUT_COLUMN_MAJOR);
}