summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/lima/ir/gp/nir.c5
-rw-r--r--src/gallium/drivers/lima/ir/pp/nir.c6
2 files changed, 2 insertions, 9 deletions
diff --git a/src/gallium/drivers/lima/ir/gp/nir.c b/src/gallium/drivers/lima/ir/gp/nir.c
index 6e0b8995da4..4bb556e294f 100644
--- a/src/gallium/drivers/lima/ir/gp/nir.c
+++ b/src/gallium/drivers/lima/ir/gp/nir.c
@@ -177,10 +177,7 @@ static bool gpir_emit_intrinsic(gpir_block *block, nir_instr *ni)
return false;
int offset = nir_intrinsic_base(instr);
-
- nir_const_value *const_offset = nir_src_as_const_value(instr->src[0]);
- assert(const_offset);
- offset += (int)const_offset->f32[0];
+ offset += (int)nir_src_as_float(instr->src[0]);
load->index = offset / 4;
load->component = offset % 4;
diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c
index 4f15f7c1564..5d15668b2a3 100644
--- a/src/gallium/drivers/lima/ir/pp/nir.c
+++ b/src/gallium/drivers/lima/ir/pp/nir.c
@@ -209,7 +209,6 @@ static ppir_node *ppir_emit_intrinsic(ppir_block *block, nir_instr *ni)
unsigned mask = 0;
ppir_load_node *lnode;
ppir_store_node *snode;
- nir_const_value *const_offset;
switch (instr->intrinsic) {
case nir_intrinsic_load_input:
@@ -234,10 +233,7 @@ static ppir_node *ppir_emit_intrinsic(ppir_block *block, nir_instr *ni)
lnode->num_components = instr->num_components;
lnode->index = nir_intrinsic_base(instr);
-
- const_offset = nir_src_as_const_value(instr->src[0]);
- assert(const_offset);
- lnode->index += (uint32_t)const_offset->f32[0];
+ lnode->index += (uint32_t)nir_src_as_float(instr->src[0]);
return &lnode->node;