aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-03-30 12:06:52 -0500
committerMarge Bot <[email protected]>2020-03-31 00:18:05 +0000
commit1033255952b4555b4435c6e92cdc8119a353697a (patch)
treed756dbc814fdea62183a63bca7cd138547a45be3 /src
parentac7a940eba264d3df556df025162df8cbad5da37 (diff)
nir: Handle vec8/16 in lower_phis_to_scalar
Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4365>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/nir/nir_lower_phis_to_scalar.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/compiler/nir/nir_lower_phis_to_scalar.c b/src/compiler/nir/nir_lower_phis_to_scalar.c
index 45894dee352..22f8f448557 100644
--- a/src/compiler/nir/nir_lower_phis_to_scalar.c
+++ b/src/compiler/nir/nir_lower_phis_to_scalar.c
@@ -65,9 +65,7 @@ is_phi_src_scalarizable(nir_phi_src *src,
* are ok too.
*/
return nir_op_infos[src_alu->op].output_size == 0 ||
- src_alu->op == nir_op_vec2 ||
- src_alu->op == nir_op_vec3 ||
- src_alu->op == nir_op_vec4;
+ nir_op_is_vec(src_alu->op);
}
case nir_instr_type_phi:
@@ -212,13 +210,7 @@ lower_phis_to_scalar_block(nir_block *block,
* will be redundant, but copy propagation should clean them up for
* us. No need to add the complexity here.
*/
- nir_op vec_op;
- switch (phi->dest.ssa.num_components) {
- case 2: vec_op = nir_op_vec2; break;
- case 3: vec_op = nir_op_vec3; break;
- case 4: vec_op = nir_op_vec4; break;
- default: unreachable("Invalid number of components");
- }
+ nir_op vec_op = nir_op_vec(phi->dest.ssa.num_components);
nir_alu_instr *vec = nir_alu_instr_create(state->mem_ctx, vec_op);
nir_ssa_dest_init(&vec->instr, &vec->dest.dest,