From: Karol Herbst Date: Sat, 13 Apr 2019 17:33:41 +0000 (+0200) Subject: lima: use nir_src_as_float X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=606b74035e6c97cbee2efaeff235892770ab7cc0;p=mesa.git lima: use nir_src_as_float Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand Reviewed-by: Qiang Yu --- 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;