nir_to_tgsi: Declare immediates as float on non-native-ints hardware.
Makes the values more legible on i915g, and may keep us from tripping asserts on nouveau's non-native-integer HW. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11744>
This commit is contained in:
@@ -460,9 +460,18 @@ ntt_setup_registers(struct ntt_compile *c, struct exec_list *list)
|
||||
static struct ureg_src
|
||||
ntt_get_load_const_src(struct ntt_compile *c, nir_load_const_instr *instr)
|
||||
{
|
||||
uint32_t values[4];
|
||||
int num_components = instr->def.num_components;
|
||||
|
||||
if (!c->native_integers) {
|
||||
float values[4];
|
||||
assert(instr->def.bit_size == 32);
|
||||
for (int i = 0; i < num_components; i++)
|
||||
values[i] = uif(instr->value[i].u32);
|
||||
|
||||
return ureg_DECL_immediate(c->ureg, values, num_components);
|
||||
} else {
|
||||
uint32_t values[4];
|
||||
|
||||
if (instr->def.bit_size == 32) {
|
||||
for (int i = 0; i < num_components; i++)
|
||||
values[i] = instr->value[i].u32;
|
||||
@@ -477,6 +486,7 @@ ntt_get_load_const_src(struct ntt_compile *c, nir_load_const_instr *instr)
|
||||
|
||||
return ureg_DECL_immediate_uint(c->ureg, values, num_components);
|
||||
}
|
||||
}
|
||||
|
||||
static struct ureg_src
|
||||
ntt_reladdr(struct ntt_compile *c, struct ureg_src addr)
|
||||
|
Reference in New Issue
Block a user