[Mesa-dev] [PATCH] nir: lower_load_const_to_scalar fix for 8/16b types
Rob Clark
robdclark at gmail.com
Tue Mar 13 19:45:01 UTC 2018
Signed-off-by: Rob Clark <robdclark at gmail.com>
---
src/compiler/nir/nir_lower_load_const_to_scalar.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 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 e494facfd21..9d37e3fecef 100644
--- a/src/compiler/nir/nir_lower_load_const_to_scalar.c
+++ b/src/compiler/nir/nir_lower_load_const_to_scalar.c
@@ -52,9 +52,14 @@ lower_load_const_instr_scalar(nir_load_const_instr *lower)
nir_load_const_instr_create(b.shader, 1, lower->def.bit_size);
if (lower->def.bit_size == 64)
load_comp->value.f64[0] = lower->value.f64[i];
- else
+ else if (lower->def.bit_size == 32)
load_comp->value.u32[0] = lower->value.u32[i];
- assert(lower->def.bit_size == 64 || lower->def.bit_size == 32);
+ else if (lower->def.bit_size == 16)
+ load_comp->value.u16[0] = lower->value.u16[i];
+ else if (lower->def.bit_size == 8)
+ load_comp->value.u8[0] = lower->value.u8[i];
+ else
+ assert(!"invalid bit size");
nir_builder_instr_insert(&b, &load_comp->instr);
loads[i] = &load_comp->def;
}
--
2.14.3
More information about the mesa-dev
mailing list