diff options
author | marha <marha@users.sourceforge.net> | 2015-03-05 23:40:39 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-03-05 23:42:09 +0100 |
commit | c646056120fe14e4c4ccf81bac5d78d61225a8e8 (patch) | |
tree | ba0af42750f0ab6dc4724342a7063835636222b5 /mesalib/src/glsl/lower_discard_flow.cpp | |
parent | 87e58a93f7248171e736656080069cb65ff56aae (diff) | |
parent | 8574eba804031f6b19713f0b02952280730bf62e (diff) | |
download | vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.gz vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.tar.bz2 vcxsrv-c646056120fe14e4c4ccf81bac5d78d61225a8e8.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/drivers/dri/swrast/swrast.c
mesalib/src/mesa/main/.gitignore
mesalib/src/mesa/main/queryobj.c
Diffstat (limited to 'mesalib/src/glsl/lower_discard_flow.cpp')
-rw-r--r-- | mesalib/src/glsl/lower_discard_flow.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesalib/src/glsl/lower_discard_flow.cpp b/mesalib/src/glsl/lower_discard_flow.cpp index 1bc56d79e..ee45bf221 100644 --- a/mesalib/src/glsl/lower_discard_flow.cpp +++ b/mesalib/src/glsl/lower_discard_flow.cpp @@ -90,7 +90,14 @@ ir_visitor_status lower_discard_flow_visitor::visit_enter(ir_discard *ir) { ir_dereference *lhs = new(mem_ctx) ir_dereference_variable(discarded); - ir_rvalue *rhs = new(mem_ctx) ir_constant(true); + ir_rvalue *rhs; + if (ir->condition) { + /* discarded <- condition, use (var_ref discarded) as the condition */ + rhs = ir->condition; + ir->condition = new(mem_ctx) ir_dereference_variable(discarded); + } else { + rhs = new(mem_ctx) ir_constant(true); + } ir_assignment *assign = new(mem_ctx) ir_assignment(lhs, rhs); ir->insert_before(assign); |