summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2017-09-18 16:20:38 -0500
committerIan Romanick <[email protected]>2017-10-02 14:46:11 -0700
commit623002f0b2d3a0b65d5dc6c5de9060adf0f3658f (patch)
treed1ba5fc36fe06689fd9d7e0596150b28918a7eb3 /src/compiler/glsl/ast_to_hir.cpp
parentd5361d9f01a3e3f1480e7804252fd23a3cc1dd7f (diff)
glsl/ast: Use logical-or instead of conditional assignment to set fallthru_var
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index cbd5746648d..d7c8b47f9d4 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -6763,8 +6763,7 @@ ast_case_label::hir(exec_list *instructions,
}
body.emit(assign(fallthru_var,
- body.constant(true),
- equal(label, deref_test_var)));
+ logic_or(fallthru_var, equal(label, deref_test_var))));
} else { /* default case */
if (state->switch_state.previous_default) {
YYLTYPE loc = this->get_location();
@@ -6777,8 +6776,9 @@ ast_case_label::hir(exec_list *instructions,
state->switch_state.previous_default = this;
/* Set fallthru condition on 'run_default' bool. */
- body.emit(assign(fallthru_var, body.constant(true),
- state->switch_state.run_default));
+ body.emit(assign(fallthru_var,
+ logic_or(fallthru_var,
+ state->switch_state.run_default)));
}
/* Case statements do not have r-values. */