summaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-12-13 02:13:30 -0800
committerIan Romanick <[email protected]>2013-01-25 09:07:33 -0500
commit9a971ab695d8f3c58a5fb0f359443b6b053f0b97 (patch)
treed670b9613cc3b0089c7095e81ee4784e88387627 /src/glsl
parentecfb404e8d4fcd35524d1c4b3421e24980fe3976 (diff)
mesa: Track the packing mode of a UBO in gl_uniform_buffer
This allows the next patch to verify that two uniform blocks match without first calculating the locations of the fields. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index e76544a2c4c..b73e6205905 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4136,6 +4136,16 @@ ast_uniform_block::hir(exec_list *instructions,
"the current scope.\n", ubo->Name);
}
+ if (this->layout.flags.q.shared) {
+ ubo->_Packing = ubo_packing_shared;
+ } else if (this->layout.flags.q.packed) {
+ ubo->_Packing = ubo_packing_packed;
+ } else {
+ /* The default layout is std140.
+ */
+ ubo->_Packing = ubo_packing_std140;
+ }
+
unsigned int num_variables = 0;
foreach_list_typed(ast_declarator_list, decl_list, link, &declarations) {
foreach_list_const(node, &decl_list->declarations) {