mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
nir/opt_gcm: Use nir_op_is_derivative more
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
This commit is contained in:
parent
e0246ed8e4
commit
6d3425653a
1 changed files with 9 additions and 19 deletions
|
|
@ -311,30 +311,20 @@ gcm_pin_instructions(nir_function_impl *impl, struct gcm_state *state)
|
|||
instr->index = state->num_instrs++;
|
||||
|
||||
switch (instr->type) {
|
||||
case nir_instr_type_alu:
|
||||
switch (nir_instr_as_alu(instr)->op) {
|
||||
case nir_op_fddx:
|
||||
case nir_op_fddy:
|
||||
case nir_op_fddx_fine:
|
||||
case nir_op_fddy_fine:
|
||||
case nir_op_fddx_coarse:
|
||||
case nir_op_fddy_coarse:
|
||||
case nir_instr_type_alu: {
|
||||
nir_alu_instr *alu = nir_instr_as_alu(instr);
|
||||
|
||||
if (nir_op_is_derivative(alu->op)) {
|
||||
/* These can only go in uniform control flow */
|
||||
instr->pass_flags = GCM_INSTR_SCHEDULE_EARLIER_ONLY;
|
||||
break;
|
||||
|
||||
case nir_op_mov:
|
||||
if (!is_src_scalarizable(&(nir_instr_as_alu(instr)->src[0].src))) {
|
||||
instr->pass_flags = GCM_INSTR_PINNED;
|
||||
break;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
|
||||
default:
|
||||
} else if (alu->op == nir_op_mov &&
|
||||
!is_src_scalarizable(&alu->src[0].src)) {
|
||||
instr->pass_flags = GCM_INSTR_PINNED;
|
||||
} else {
|
||||
instr->pass_flags = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_instr_type_tex: {
|
||||
nir_tex_instr *tex = nir_instr_as_tex(instr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue