summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadym Shovkoplias <[email protected]>2018-10-24 13:28:23 +0300
committerTimothy Arceri <[email protected]>2018-10-30 10:19:17 +1100
commit7d66eddbbdec98df21dc9d8286f8e047d575b52d (patch)
tree16e525ddb3b15732f41db1977a02b883edb73caf
parent8676af12c8e8e223f186059705f189ae7d3cae60 (diff)
glsl/linker: Fix out variables linking during single stage
Since out variables are copied from shader objects instruction streams to linked shader instruction steam it should be cloned at first to keep source instruction steam unaltered. Fixes: 966a797e433 ("glsl/linker: Link all out vars from a shader objects on a single stage") Signed-off-by: Vadym Shovkoplias <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105731
-rw-r--r--src/compiler/glsl/linker.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 7db34ebf95b..8b1b03322a0 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -2269,10 +2269,11 @@ link_output_variables(struct gl_linked_shader *linked_shader,
if (ir->ir_type != ir_type_variable)
continue;
- ir_variable *const var = (ir_variable *) ir;
+ ir_variable *var = (ir_variable *) ir;
if (var->data.mode == ir_var_shader_out &&
!symbols->get_variable(var->name)) {
+ var = var->clone(linked_shader, NULL);
symbols->add_variable(var);
linked_shader->ir->push_head(var);
}