Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
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;
unsigned mask = 0;
ppir_load_node *lnode;
ppir_store_node *snode;
- nir_const_value *const_offset;
switch (instr->intrinsic) {
case nir_intrinsic_load_input:
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;