diff options
author | Kenneth Graunke <[email protected]> | 2013-07-18 15:11:57 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-07-18 16:57:24 -0700 |
commit | d4375fc0166a2ca50c4786ea93b5a5ccdbc8eaf7 (patch) | |
tree | 50eec1df0f86fc773df64bdf0a382ef321c88fda /src/glsl | |
parent | 4da1504c0fd0cfccbff514ed03c4dc5deb24cf73 (diff) |
glsl: Propagate explicit binding information from AST to IR.
Rather than creating a new "binding" field in ir_variable, we reuse
constant_value since the linker code for handling uniform initializers
uses that.
Since UBOs and samplers can't otherwise have initializers/constant
values, there shouldn't be a conflict.
v2: Propagate the new binding variable around too.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 4a04b608bfb..761c799ed68 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2158,8 +2158,11 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, "explicit index requires explicit location\n"); } - if (qual->flags.q.explicit_binding) - validate_binding_qualifier(state, loc, var, qual); + if (qual->flags.q.explicit_binding && + validate_binding_qualifier(state, loc, var, qual)) { + var->explicit_binding = true; + var->binding = qual->binding; + } /* Does the declaration use the deprecated 'attribute' or 'varying' * keywords? |