summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2015-10-17 20:22:14 +1100
committerTimothy Arceri <[email protected]>2015-10-20 11:58:28 +1100
commit2832ca95ecce064c7d841a3a374c2179f56161be (patch)
treef467520c99cc83259c82f7f9bb1ab8d7972c9699 /src/glsl/ast_to_hir.cpp
parentaa9f06b3ea99b318469c3d140651f4b4986896a6 (diff)
glsl: fix stream qualifier for blocks with an instance name
This also removes the validation from the parser as it is not required and once arb_enhanced_layouts comes along we wont be able to do validation on the stream qualifier in the parser anyway as it adds constant expression support to the stream qualifier. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Cc: 11.0 <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index ede02d94cb2..db9229f6ae3 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -6293,6 +6293,18 @@ ast_interface_block::hir(exec_list *instructions,
state->struct_specifier_depth--;
+ for (unsigned i = 0; i < num_variables; i++) {
+ if (fields[i].stream != -1 &&
+ (unsigned) fields[i].stream != this->layout.stream) {
+ _mesa_glsl_error(&loc, state,
+ "stream layout qualifier on "
+ "interface block member `%s' does not match "
+ "the interface block (%d vs %d)",
+ fields[i].name, fields[i].stream,
+ this->layout.stream);
+ }
+ }
+
if (!redeclaring_per_vertex) {
validate_identifier(this->block_name, loc, state);
@@ -6633,6 +6645,8 @@ ast_interface_block::hir(exec_list *instructions,
var->data.explicit_binding = this->layout.flags.q.explicit_binding;
var->data.binding = this->layout.binding;
+ var->data.stream = this->layout.stream;
+
state->symbols->add_variable(var);
instructions->push_tail(var);
}
@@ -6651,6 +6665,7 @@ ast_interface_block::hir(exec_list *instructions,
var->data.centroid = fields[i].centroid;
var->data.sample = fields[i].sample;
var->data.patch = fields[i].patch;
+ var->data.stream = this->layout.stream;
var->init_interface_type(block_type);
if (var_mode == ir_var_shader_in || var_mode == ir_var_uniform)
@@ -6663,17 +6678,6 @@ ast_interface_block::hir(exec_list *instructions,
var->data.matrix_layout = fields[i].matrix_layout;
}
- if (fields[i].stream != -1 &&
- ((unsigned)fields[i].stream) != this->layout.stream) {
- _mesa_glsl_error(&loc, state,
- "stream layout qualifier on "
- "interface block member `%s' does not match "
- "the interface block (%d vs %d)",
- var->name, fields[i].stream, this->layout.stream);
- }
-
- var->data.stream = this->layout.stream;
-
if (var->data.mode == ir_var_shader_storage) {
var->data.image_read_only = fields[i].image_read_only;
var->data.image_write_only = fields[i].image_write_only;