summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-17 18:06:57 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-18 16:57:24 -0700
commitf25d94084ce3225e803c07672c359a4e553b0e08 (patch)
treedd369e50d0f19758fc3248b3606cfad77dd5308f /src
parent34e2ccc9f099affa78298203db015b9a17ab6de3 (diff)
glsl: Propagate UBO binding qualifier into UBO member variables.
Without an instance name, there is no ir_variable representing the actual uniform block declaration. When the linker goes to set uniform initializers, it only sees the members as ir_variables; never the block. So, unfortunately, the members need to know about the binding. There has to be a better way to do this. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_to_hir.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 761c799ed68..bfd5fda8f77 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4387,6 +4387,13 @@ ast_interface_block::hir(exec_list *instructions,
var_mode);
var->interface_type = block_type;
+ /* Propagate the "binding" keyword into this UBO's fields;
+ * the UBO declaration itself doesn't get an ir_variable unless it
+ * has an instance name. This is ugly.
+ */
+ var->explicit_binding = this->layout.flags.q.explicit_binding;
+ var->binding = this->layout.binding;
+
state->symbols->add_variable(var);
instructions->push_tail(var);
}