summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-03-27 18:31:01 -0500
committerKarol Herbst <[email protected]>2019-04-14 22:25:56 +0200
commitc4b28d1730e9322821847a94bac2ee4ac60d8617 (patch)
tree8527cadd19f2b77a7bb66d93b052945c7046e201 /src/compiler/nir
parent893dd34702ca576707960b87045adb494ef9434d (diff)
nir/load_const_to_scalar: Get rid of a bit size switch statement
Now that nir_const_value is a scalar, we don't need the switch on bit size in order to pluck off components properly. Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_lower_load_const_to_scalar.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/compiler/nir/nir_lower_load_const_to_scalar.c b/src/compiler/nir/nir_lower_load_const_to_scalar.c
index 47dc83613ef..a65dcb06d0c 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -50,25 +50,7 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)
for (unsigned i = 0; i < lower->def.num_components; i++) {
nir_load_const_instr *load_comp =
nir_load_const_instr_create(b.shader, 1, lower->def.bit_size);
- switch (lower->def.bit_size) {
- case 64:
- load_comp->value[0].u64 = lower->value[i].u64;
- break;
- case 32:
- load_comp->value[0].u32 = lower->value[i].u32;
- break;
- case 16:
- load_comp->value[0].u16 = lower->value[i].u16;
- break;
- case 8:
- load_comp->value[0].u8 = lower->value[i].u8;
- break;
- case 1:
- load_comp->value[0].b = lower->value[i].b;
- break;
- default:
- assert(!"invalid bit size");
- }
+ load_comp->value[0] = lower->value[i];
nir_builder_instr_insert(&b, &load_comp->instr);
loads[i] = &load_comp->def;
}