diff options
author | Fabian Bieler <[email protected]> | 2014-03-20 22:37:37 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-07-23 00:59:27 +0200 |
commit | c53aa26379ccee9d53fe1d1ea9bfa26d4d469618 (patch) | |
tree | e9609b0c59ea1acf80c14f61c83e8841435e47ad | |
parent | 73a9a1539a85ae8fe22e11b4064105d588597736 (diff) |
glsl: add "in" or "out" prefix to name when flattening interface blocks
This is to prevent a name conflict in tessellation shaders built-in interface
blocks.
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/glsl/lower_named_interface_blocks.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/glsl/lower_named_interface_blocks.cpp b/src/glsl/lower_named_interface_blocks.cpp index 22c852dcd2a..01bbdd0587e 100644 --- a/src/glsl/lower_named_interface_blocks.cpp +++ b/src/glsl/lower_named_interface_blocks.cpp @@ -126,7 +126,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions) for (unsigned i = 0; i < iface_t->length; i++) { const char * field_name = iface_t->fields.structure[i].name; char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s.%s", + ralloc_asprintf(mem_ctx, "%s %s.%s.%s", + var->data.mode == ir_var_shader_in ? "in" : "out", iface_t->name, var->name, field_name); ir_variable *found_var = @@ -219,7 +220,9 @@ flatten_named_interface_blocks_declarations::handle_rvalue(ir_rvalue **rvalue) if (var->get_interface_type() != NULL) { char *iface_field_name = - ralloc_asprintf(mem_ctx, "%s.%s.%s", var->get_interface_type()->name, + ralloc_asprintf(mem_ctx, "%s %s.%s.%s", + var->data.mode == ir_var_shader_in ? "in" : "out", + var->get_interface_type()->name, var->name, ir->field); /* Find the variable in the set of flattened interface blocks */ ir_variable *found_var = |