glsl/ast: Use logical-or instead of conditional assignment to set fallthru_var
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
This commit is contained in:
@@ -6763,8 +6763,7 @@ ast_case_label::hir(exec_list *instructions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
body.emit(assign(fallthru_var,
|
body.emit(assign(fallthru_var,
|
||||||
body.constant(true),
|
logic_or(fallthru_var, equal(label, deref_test_var))));
|
||||||
equal(label, deref_test_var)));
|
|
||||||
} else { /* default case */
|
} else { /* default case */
|
||||||
if (state->switch_state.previous_default) {
|
if (state->switch_state.previous_default) {
|
||||||
YYLTYPE loc = this->get_location();
|
YYLTYPE loc = this->get_location();
|
||||||
@@ -6777,8 +6776,9 @@ ast_case_label::hir(exec_list *instructions,
|
|||||||
state->switch_state.previous_default = this;
|
state->switch_state.previous_default = this;
|
||||||
|
|
||||||
/* Set fallthru condition on 'run_default' bool. */
|
/* Set fallthru condition on 'run_default' bool. */
|
||||||
body.emit(assign(fallthru_var, body.constant(true),
|
body.emit(assign(fallthru_var,
|
||||||
state->switch_state.run_default));
|
logic_or(fallthru_var,
|
||||||
|
state->switch_state.run_default)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Case statements do not have r-values. */
|
/* Case statements do not have r-values. */
|
||||||
|
Reference in New Issue
Block a user