From: Karol Herbst Date: Sun, 31 Mar 2019 01:54:21 +0000 (+0200) Subject: intel/nir: use nir_src_is_const and nir_src_as_uint X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbf2ecaf352df43de3dea56f27c1eeae198ab3dc;p=mesa.git intel/nir: use nir_src_is_const and nir_src_as_uint Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand --- diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index 899d871a4e5..43bc6f5a20c 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -70,10 +70,9 @@ add_const_offset_to_base_block(nir_block *block, nir_builder *b, if ((mode == nir_var_shader_in && is_input(intrin)) || (mode == nir_var_shader_out && is_output(intrin))) { nir_src *offset = nir_get_io_offset_src(intrin); - nir_const_value *const_offset = nir_src_as_const_value(*offset); - if (const_offset) { - intrin->const_index[0] += const_offset->u32[0]; + if (nir_src_is_const(*offset)) { + intrin->const_index[0] += nir_src_as_uint(*offset); b->cursor = nir_before_instr(&intrin->instr); nir_instr_rewrite_src(&intrin->instr, offset, nir_src_for_ssa(nir_imm_int(b, 0))); @@ -181,9 +180,8 @@ remap_patch_urb_offsets(nir_block *block, nir_builder *b, nir_src *vertex = nir_get_io_vertex_index_src(intrin); if (vertex) { - nir_const_value *const_vertex = nir_src_as_const_value(*vertex); - if (const_vertex) { - intrin->const_index[0] += const_vertex->u32[0] * + if (nir_src_is_const(*vertex)) { + intrin->const_index[0] += nir_src_as_uint(*vertex) * vue_map->num_per_vertex_slots; } else { b->cursor = nir_before_instr(&intrin->instr);