diff --git a/src/asahi/lib/agx_meta.c b/src/asahi/lib/agx_meta.c index b9297851cc3..f83c5609980 100644 --- a/src/asahi/lib/agx_meta.c +++ b/src/asahi/lib/agx_meta.c @@ -44,12 +44,11 @@ build_background_op(nir_builder *b, enum agx_meta_op op, unsigned rt, tex->dest_type = nir_type_uint32; tex->sampler_dim = msaa ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D; tex->op = nir_texop_tex; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); if (msaa) { - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_load_sample_id(b)); + tex->src[1] = + nir_tex_src_for_ssa(nir_tex_src_ms_index, nir_load_sample_id(b)); } tex->coord_components = 2; diff --git a/src/broadcom/vulkan/v3dv_meta_copy.c b/src/broadcom/vulkan/v3dv_meta_copy.c index fc4a438c404..18a43c30762 100644 --- a/src/broadcom/vulkan/v3dv_meta_copy.c +++ b/src/broadcom/vulkan/v3dv_meta_copy.c @@ -2014,10 +2014,8 @@ get_texel_buffer_copy_fs(struct v3dv_device *device, VkFormat format, nir_tex_instr *tex = nir_tex_instr_create(b.shader, 2); tex->sampler_dim = GLSL_SAMPLER_DIM_BUF; tex->op = nir_texop_txf; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(texel_offset); - tex->src[1].src_type = nir_tex_src_texture_deref; - tex->src[1].src = nir_src_for_ssa(tex_deref); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, texel_offset); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, tex_deref); tex->dest_type = nir_type_uint32; tex->is_array = false; tex->coord_components = 1; @@ -3365,12 +3363,9 @@ build_nir_tex_op_read(struct nir_builder *b, nir_tex_instr *tex = nir_tex_instr_create(b->shader, 3); tex->sampler_dim = dim; tex->op = nir_texop_tex; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(tex_pos); - tex->src[1].src_type = nir_tex_src_texture_deref; - tex->src[1].src = nir_src_for_ssa(tex_deref); - tex->src[2].src_type = nir_tex_src_sampler_deref; - tex->src[2].src = nir_src_for_ssa(tex_deref); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, tex_pos); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, tex_deref); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, tex_deref); tex->dest_type = nir_get_nir_type_for_glsl_base_type(tex_type); tex->is_array = glsl_sampler_type_is_array(sampler_type); tex->coord_components = tex_pos->num_components; @@ -3391,14 +3386,10 @@ build_nir_tex_op_ms_fetch_sample(struct nir_builder *b, nir_tex_instr *tex = nir_tex_instr_create(b->shader, 4); tex->sampler_dim = GLSL_SAMPLER_DIM_MS; tex->op = nir_texop_txf_ms; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(tex_pos); - tex->src[1].src_type = nir_tex_src_texture_deref; - tex->src[1].src = nir_src_for_ssa(tex_deref); - tex->src[2].src_type = nir_tex_src_sampler_deref; - tex->src[2].src = nir_src_for_ssa(tex_deref); - tex->src[3].src_type = nir_tex_src_ms_index; - tex->src[3].src = nir_src_for_ssa(sample_idx); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, tex_pos); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, tex_deref); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, tex_deref); + tex->src[3] = nir_tex_src_for_ssa(nir_tex_src_ms_index, sample_idx); tex->dest_type = nir_get_nir_type_for_glsl_base_type(tex_type); tex->is_array = false; tex->coord_components = tex_pos->num_components; diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 5b5bfd75c4c..b12e286f384 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -2484,38 +2484,33 @@ nir_visitor::visit(ir_texture *ir) if (!nir_deref_mode_is(sampler_deref, nir_var_uniform) || nir_deref_instr_get_variable(sampler_deref)->data.bindless) { nir_ssa_def *load = nir_load_deref(&b, sampler_deref); - instr->src[0].src = nir_src_for_ssa(load); - instr->src[0].src_type = nir_tex_src_texture_handle; - instr->src[1].src = nir_src_for_ssa(load); - instr->src[1].src_type = nir_tex_src_sampler_handle; + instr->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_handle, load); + instr->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_handle, load); } else { - instr->src[0].src = nir_src_for_ssa(&sampler_deref->dest.ssa); - instr->src[0].src_type = nir_tex_src_texture_deref; - instr->src[1].src = nir_src_for_ssa(&sampler_deref->dest.ssa); - instr->src[1].src_type = nir_tex_src_sampler_deref; + instr->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &sampler_deref->dest.ssa); + instr->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &sampler_deref->dest.ssa); } unsigned src_number = 2; if (ir->coordinate != NULL) { instr->coord_components = ir->coordinate->type->vector_elements; - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->coordinate)); - instr->src[src_number].src_type = nir_tex_src_coord; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_coord, + evaluate_rvalue(ir->coordinate)); src_number++; } if (ir->projector != NULL) { - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->projector)); - instr->src[src_number].src_type = nir_tex_src_projector; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_projector, + evaluate_rvalue(ir->projector)); src_number++; } if (ir->shadow_comparator != NULL) { - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->shadow_comparator)); - instr->src[src_number].src_type = nir_tex_src_comparator; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_comparator, + evaluate_rvalue(ir->shadow_comparator)); src_number++; } @@ -2533,25 +2528,22 @@ nir_visitor::visit(ir_texture *ir) } else { assert(ir->offset->type->is_vector() || ir->offset->type->is_scalar()); - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->offset)); - instr->src[src_number].src_type = nir_tex_src_offset; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_offset, + evaluate_rvalue(ir->offset)); src_number++; } } if (ir->clamp) { - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->clamp)); - instr->src[src_number].src_type = nir_tex_src_min_lod; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_min_lod, + evaluate_rvalue(ir->clamp)); src_number++; } switch (ir->op) { case ir_txb: - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->lod_info.bias)); - instr->src[src_number].src_type = nir_tex_src_bias; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_bias, + evaluate_rvalue(ir->lod_info.bias)); src_number++; break; @@ -2559,28 +2551,24 @@ nir_visitor::visit(ir_texture *ir) case ir_txf: case ir_txs: if (ir->lod_info.lod != NULL) { - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->lod_info.lod)); - instr->src[src_number].src_type = nir_tex_src_lod; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_lod, + evaluate_rvalue(ir->lod_info.lod)); src_number++; } break; case ir_txd: - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->lod_info.grad.dPdx)); - instr->src[src_number].src_type = nir_tex_src_ddx; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_ddx, + evaluate_rvalue(ir->lod_info.grad.dPdx)); src_number++; - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->lod_info.grad.dPdy)); - instr->src[src_number].src_type = nir_tex_src_ddy; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_ddy, + evaluate_rvalue(ir->lod_info.grad.dPdy)); src_number++; break; case ir_txf_ms: - instr->src[src_number].src = - nir_src_for_ssa(evaluate_rvalue(ir->lod_info.sample_index)); - instr->src[src_number].src_type = nir_tex_src_ms_index; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + evaluate_rvalue(ir->lod_info.sample_index)); src_number++; break; diff --git a/src/compiler/nir/nir_lower_bitmap.c b/src/compiler/nir/nir_lower_bitmap.c index 436b4c17525..3033ac1c0ab 100644 --- a/src/compiler/nir/nir_lower_bitmap.c +++ b/src/compiler/nir/nir_lower_bitmap.c @@ -79,14 +79,12 @@ lower_bitmap(nir_shader *shader, nir_builder *b, tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; tex->dest_type = nir_type_float32; - tex->src[0].src_type = nir_tex_src_texture_deref; - tex->src[0].src = nir_src_for_ssa(&tex_deref->dest.ssa); - tex->src[1].src_type = nir_tex_src_sampler_deref; - tex->src[1].src = nir_src_for_ssa(&tex_deref->dest.ssa); - tex->src[2].src_type = nir_tex_src_coord; - tex->src[2].src = - nir_src_for_ssa(nir_channels(b, texcoord, - (1 << tex->coord_components) - 1)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &tex_deref->dest.ssa); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &tex_deref->dest.ssa); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_channels(b, texcoord, (1 << tex->coord_components) - 1)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/compiler/nir/nir_lower_fb_read.c b/src/compiler/nir/nir_lower_fb_read.c index ce4dff452ec..a61cff23b0b 100644 --- a/src/compiler/nir/nir_lower_fb_read.c +++ b/src/compiler/nir/nir_lower_fb_read.c @@ -69,14 +69,12 @@ nir_lower_fb_read_instr(nir_builder *b, nir_instr *instr, UNUSED void *cb_data) tex->coord_components = 3; tex->dest_type = nir_type_float32; tex->is_array = true; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = - nir_src_for_ssa(nir_vec3(b, nir_channel(b, fragcoord, 0), nir_channel(b, fragcoord, 1), layer)); - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(sampid); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_vec3(b, nir_channel(b, fragcoord, 0), nir_channel(b, fragcoord, 1), layer)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, sampid); struct nir_io_semantics io = nir_intrinsic_io_semantics(intr); - tex->src[2].src = nir_src_for_ssa(nir_imm_intN_t(b, io.location - FRAG_RESULT_DATA0, 32)); - tex->src[2].src_type = nir_tex_src_texture_handle; + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_texture_handle, + nir_imm_intN_t(b, io.location - FRAG_RESULT_DATA0, 32)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index b672b11e708..116a9b6d73d 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -2690,10 +2690,7 @@ vtn_create_ssa_value(struct vtn_builder *b, const struct glsl_type *type) static nir_tex_src vtn_tex_src(struct vtn_builder *b, unsigned index, nir_tex_src_type type) { - nir_tex_src src; - src.src = nir_src_for_ssa(vtn_get_nir_ssa(b, index)); - src.src_type = type; - return src; + return nir_tex_src_for_ssa(type, vtn_get_nir_ssa(b, index)); } static uint32_t diff --git a/src/freedreno/vulkan/tu_clear_blit.cc b/src/freedreno/vulkan/tu_clear_blit.cc index b0ecd2f259f..eb87d50c9b6 100644 --- a/src/freedreno/vulkan/tu_clear_blit.cc +++ b/src/freedreno/vulkan/tu_clear_blit.cc @@ -619,8 +619,8 @@ build_blit_fs_shader(bool zscale) b->shader->info.num_textures = 1; BITSET_SET(b->shader->info.textures_used, 0); - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_load_var(b, in_coords)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_load_var(b, in_coords)); tex->coord_components = coord_components; nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); @@ -675,12 +675,11 @@ build_ms_copy_fs_shader(void) nir_ssa_def *coord = nir_f2i32(b, nir_load_var(b, in_coords)); - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); tex->coord_components = 2; - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_load_sample_id(b)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + nir_load_sample_id(b)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/gallium/auxiliary/nir/nir_draw_helpers.c b/src/gallium/auxiliary/nir/nir_draw_helpers.c index 9390e6065b9..ddf1eb735b5 100644 --- a/src/gallium/auxiliary/nir/nir_draw_helpers.c +++ b/src/gallium/auxiliary/nir/nir_draw_helpers.c @@ -77,8 +77,7 @@ nir_lower_pstipple_block(nir_block *block, tex->dest_type = nir_type_float32; tex->texture_index = state->stip_tex->data.binding; tex->sampler_index = state->stip_tex->data.binding; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(texcoord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, texcoord); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index 807d7ff7725..44a8a8f4193 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -1457,34 +1457,33 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) unsigned src_number = 0; - instr->src[src_number].src = nir_src_for_ssa(&deref->dest.ssa); - instr->src[src_number].src_type = nir_tex_src_texture_deref; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); src_number++; - instr->src[src_number].src = nir_src_for_ssa(&deref->dest.ssa); - instr->src[src_number].src_type = nir_tex_src_sampler_deref; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &deref->dest.ssa); src_number++; - instr->src[src_number].src = - nir_src_for_ssa(nir_swizzle(b, src[0], SWIZ(X, Y, Z, W), - instr->coord_components)); - instr->src[src_number].src_type = nir_tex_src_coord; + instr->src[src_number] = + nir_tex_src_for_ssa(nir_tex_src_coord, + nir_trim_vector(b, src[0], instr->coord_components)); src_number++; if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXP) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_projector; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_projector, + ttn_channel(b, src[0], W)); src_number++; } if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXB) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_bias; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_bias, + ttn_channel(b, src[0], W)); src_number++; } if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXB2) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[1], X)); - instr->src[src_number].src_type = nir_tex_src_bias; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_bias, + ttn_channel(b, src[1], X)); src_number++; } @@ -1499,16 +1498,16 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) } if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXL2) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[1], X)); - instr->src[src_number].src_type = nir_tex_src_lod; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_lod, + ttn_channel(b, src[1], X)); src_number++; } if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXF || tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXF_LZ) { if (op == nir_texop_txf_ms) { - instr->src[src_number].src = nir_src_for_ssa(ttn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_ms_index; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + ttn_channel(b, src[0], W)); } else { if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXF_LZ) instr->src[src_number].src = nir_src_for_ssa(nir_imm_int(b, 0)); @@ -1520,15 +1519,13 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) } if (tgsi_inst->Instruction.Opcode == TGSI_OPCODE_TXD) { - instr->src[src_number].src_type = nir_tex_src_ddx; - instr->src[src_number].src = - nir_src_for_ssa(nir_swizzle(b, src[1], SWIZ(X, Y, Z, W), - nir_tex_instr_src_size(instr, src_number))); + instr->src[src_number] = + nir_tex_src_for_ssa(nir_tex_src_ddx, + nir_trim_vector(b, src[1], nir_tex_instr_src_size(instr, src_number))); src_number++; - instr->src[src_number].src_type = nir_tex_src_ddy; - instr->src[src_number].src = - nir_src_for_ssa(nir_swizzle(b, src[2], SWIZ(X, Y, Z, W), - nir_tex_instr_src_size(instr, src_number))); + instr->src[src_number] = + nir_tex_src_for_ssa(nir_tex_src_ddy, + nir_trim_vector(b, src[2], nir_tex_instr_src_size(instr, src_number))); src_number++; } @@ -1564,9 +1561,8 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) src.swizzle[2] = tex_offset->SwizzleZ; src.swizzle[3] = TGSI_SWIZZLE_W; - instr->src[src_number].src_type = nir_tex_src_offset; - instr->src[src_number].src = nir_src_for_ssa( - nir_mov_alu(b, src, nir_tex_instr_src_size(instr, src_number))); + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_offset, + nir_mov_alu(b, src, nir_tex_instr_src_size(instr, src_number))); src_number++; } @@ -1624,15 +1620,15 @@ ttn_txq(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src) nir_deref_instr *deref = nir_build_deref_var(b, var); - txs->src[0].src = nir_src_for_ssa(&deref->dest.ssa); - txs->src[0].src_type = nir_tex_src_texture_deref; + txs->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); - qlv->src[0].src = nir_src_for_ssa(&deref->dest.ssa); - qlv->src[0].src_type = nir_tex_src_texture_deref; + qlv->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); /* lod: */ - txs->src[1].src = nir_src_for_ssa(ttn_channel(b, src[0], X)); - txs->src[1].src_type = nir_tex_src_lod; + txs->src[1] = nir_tex_src_for_ssa(nir_tex_src_lod, + ttn_channel(b, src[0], X)); nir_ssa_dest_init(&txs->instr, &txs->dest, nir_tex_instr_dest_size(txs), 32); diff --git a/src/gallium/drivers/d3d12/d3d12_blit.cpp b/src/gallium/drivers/d3d12/d3d12_blit.cpp index 474d4c7bb52..19d3eb02786 100644 --- a/src/gallium/drivers/d3d12/d3d12_blit.cpp +++ b/src/gallium/drivers/d3d12/d3d12_blit.cpp @@ -676,8 +676,7 @@ get_stencil_resolve_fs(struct d3d12_context *ctx, bool no_flip) nir_tex_instr *txs = nir_tex_instr_create(b.shader, 1); txs->op = nir_texop_txs; txs->sampler_dim = GLSL_SAMPLER_DIM_MS; - txs->src[0].src_type = nir_tex_src_texture_deref; - txs->src[0].src = nir_src_for_ssa(tex_deref); + txs->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, tex_deref); txs->is_array = false; txs->dest_type = nir_type_int; @@ -699,12 +698,10 @@ get_stencil_resolve_fs(struct d3d12_context *ctx, bool no_flip) nir_tex_instr *tex = nir_tex_instr_create(b.shader, 3); tex->sampler_dim = GLSL_SAMPLER_DIM_MS; tex->op = nir_texop_txf_ms; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_channels(&b, nir_f2i32(&b, pos_src), 0x3)); - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_imm_int(&b, 0)); /* just use first sample */ - tex->src[2].src_type = nir_tex_src_texture_deref; - tex->src[2].src = nir_src_for_ssa(tex_deref); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_channels(&b, nir_f2i32(&b, pos_src), 0x3)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, nir_imm_int(&b, 0)); /* just use first sample */ + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, tex_deref); tex->dest_type = nir_type_uint32; tex->is_array = false; tex->coord_components = 2; diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c index 196cdb8ae75..ae8af3030d2 100644 --- a/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c +++ b/src/gallium/drivers/vc4/vc4_nir_lower_txf_ms.c @@ -117,8 +117,8 @@ vc4_nir_lower_txf_ms_instr(nir_builder *b, nir_instr *instr, void *data) nir_ior(b, sample_addr, pixel_addr), nir_iadd(b, subspan_addr, tile_addr)); - txf->src[0].src_type = nir_tex_src_coord; - txf->src[0].src = nir_src_for_ssa(nir_vec2(b, addr, nir_imm_int(b, 0))); + txf->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_vec2(b, addr, nir_imm_int(b, 0))); nir_ssa_dest_init(&txf->instr, &txf->dest, 4, 32); nir_builder_instr_insert(b, &txf->instr); diff --git a/src/gallium/drivers/zink/zink_lower_cubemap_to_array.c b/src/gallium/drivers/zink/zink_lower_cubemap_to_array.c index bd80c3d55c8..f09679186f4 100644 --- a/src/gallium/drivers/zink/zink_lower_cubemap_to_array.c +++ b/src/gallium/drivers/zink/zink_lower_cubemap_to_array.c @@ -442,8 +442,7 @@ lower_tex_to_txl(nir_builder *b, nir_tex_instr *tex) if (bias_idx >= 0) lod = nir_fadd(b, lod, nir_ssa_for_src(b, tex->src[bias_idx].src, 1)); lod = nir_fadd_imm(b, lod, -1.0); - txl->src[s].src = nir_src_for_ssa(lod); - txl->src[s].src_type = nir_tex_src_lod; + txl->src[s] = nir_tex_src_for_ssa(nir_tex_src_lod, lod); b->cursor = nir_before_instr(&tex->instr); nir_ssa_dest_init(&txl->instr, &txl->dest, diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 70684b94c0f..46ed6ad7a47 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -162,8 +162,7 @@ blorp_create_nir_tex_instr(nir_builder *b, struct brw_blorp_blit_vars *v, nir_load_var(b, v->v_src_z)); } - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(pos); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, pos); tex->coord_components = 3; nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); @@ -188,8 +187,7 @@ blorp_nir_tex(nir_builder *b, struct brw_blorp_blit_vars *v, assert(pos->num_components == 2); tex->sampler_dim = GLSL_SAMPLER_DIM_2D; - tex->src[1].src_type = nir_tex_src_lod; - tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_lod, nir_imm_int(b, 0)); nir_builder_instr_insert(b, &tex->instr); @@ -204,8 +202,7 @@ blorp_nir_txf(nir_builder *b, struct brw_blorp_blit_vars *v, blorp_create_nir_tex_instr(b, v, nir_texop_txf, pos, 2, dst_type); tex->sampler_dim = GLSL_SAMPLER_DIM_3D; - tex->src[1].src_type = nir_tex_src_lod; - tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_lod, nir_imm_int(b, 0)); nir_builder_instr_insert(b, &tex->instr); @@ -232,8 +229,7 @@ blorp_nir_txf_ms(nir_builder *b, struct brw_blorp_blit_vars *v, if (!mcs) mcs = nir_imm_zero(b, 4, 32); - tex->src[2].src_type = nir_tex_src_ms_mcs_intel; - tex->src[2].src = nir_src_for_ssa(mcs); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_ms_mcs_intel, mcs); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/intel/blorp/blorp_nir_builder.h b/src/intel/blorp/blorp_nir_builder.h index fe78c13a544..7f8446dabdd 100644 --- a/src/intel/blorp/blorp_nir_builder.h +++ b/src/intel/blorp/blorp_nir_builder.h @@ -55,8 +55,7 @@ blorp_nir_txf_ms_mcs(nir_builder *b, nir_ssa_def *xy_pos, nir_ssa_def *layer) tex->coord_components = 2; coord = nir_channels(b, xy_pos, 0x3); } - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); /* Blorp only has one texture and it's bound at unit 0 */ tex->texture_index = 0; diff --git a/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c b/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c index 741df4e7db7..70a772b3a13 100644 --- a/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c +++ b/src/intel/vulkan_hasvk/anv_nir_lower_ycbcr_textures.c @@ -52,8 +52,8 @@ get_texture_size(struct ycbcr_state *state, nir_deref_instr *texture) tex->is_shadow = glsl_sampler_type_is_shadow(type); tex->dest_type = nir_type_int32; - tex->src[0].src_type = nir_tex_src_texture_deref; - tex->src[0].src = nir_src_for_ssa(&texture->dest.ssa); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &texture->dest.ssa); nir_ssa_dest_init(&tex->instr, &tex->dest, nir_tex_instr_dest_size(tex), 32); @@ -139,8 +139,8 @@ create_plane_tex_instr_implicit(struct ycbcr_state *state, break; } } - tex->src[tex->num_srcs - 1].src = nir_src_for_ssa(nir_imm_int(b, plane)); - tex->src[tex->num_srcs - 1].src_type = nir_tex_src_plane; + tex->src[tex->num_srcs - 1] = nir_tex_src_for_ssa(nir_tex_src_plane, + nir_imm_int(b, plane)); tex->sampler_dim = old_tex->sampler_dim; tex->dest_type = old_tex->dest_type; diff --git a/src/mesa/main/ff_fragment_shader.c b/src/mesa/main/ff_fragment_shader.c index d2aed05c788..40a8b9b62f0 100644 --- a/src/mesa/main/ff_fragment_shader.c +++ b/src/mesa/main/ff_fragment_shader.c @@ -799,26 +799,24 @@ load_texture(struct texenv_fragment_program *p, GLuint unit) } nir_deref_instr *deref = nir_build_deref_var(p->b, var); - tex->src[0].src = nir_src_for_ssa(&deref->dest.ssa); - tex->src[0].src_type = nir_tex_src_texture_deref; - tex->src[1].src = nir_src_for_ssa(&deref->dest.ssa); - tex->src[1].src_type = nir_tex_src_sampler_deref; + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &deref->dest.ssa); nir_ssa_def *src2 = nir_channels(p->b, texcoord, nir_component_mask(tex->coord_components)); - tex->src[2].src_type = nir_tex_src_coord; - tex->src[2].src = nir_src_for_ssa(src2); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_coord, src2); - tex->src[3].src_type = nir_tex_src_projector; - tex->src[3].src = nir_src_for_ssa(nir_channel(p->b, texcoord, 3)); + tex->src[3] = nir_tex_src_for_ssa(nir_tex_src_projector, + nir_channel(p->b, texcoord, 3)); if (p->state->unit[unit].shadow) { tex->is_shadow = true; nir_ssa_def *src4 = nir_channel(p->b, texcoord, tex->coord_components); - tex->src[4].src_type = nir_tex_src_comparator; - tex->src[4].src = nir_src_for_ssa(src4); + tex->src[4] = nir_tex_src_for_ssa(nir_tex_src_comparator, src4); } nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 6b684ed0e6d..7aed33de386 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -575,34 +575,33 @@ ptn_tex(struct ptn_compile *c, nir_alu_dest dest, nir_ssa_def **src, unsigned src_number = 0; - instr->src[src_number].src = nir_src_for_ssa(&deref->dest.ssa); - instr->src[src_number].src_type = nir_tex_src_texture_deref; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); src_number++; - instr->src[src_number].src = nir_src_for_ssa(&deref->dest.ssa); - instr->src[src_number].src_type = nir_tex_src_sampler_deref; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &deref->dest.ssa); src_number++; - instr->src[src_number].src = - nir_src_for_ssa(nir_swizzle(b, src[0], SWIZ(X, Y, Z, W), - instr->coord_components)); - instr->src[src_number].src_type = nir_tex_src_coord; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_trim_vector(b, src[0], + instr->coord_components)); src_number++; if (prog_inst->Opcode == OPCODE_TXP) { - instr->src[src_number].src = nir_src_for_ssa(ptn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_projector; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_projector, + ptn_channel(b, src[0], W)); src_number++; } if (prog_inst->Opcode == OPCODE_TXB) { - instr->src[src_number].src = nir_src_for_ssa(ptn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_bias; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_bias, + ptn_channel(b, src[0], W)); src_number++; } if (prog_inst->Opcode == OPCODE_TXL) { - instr->src[src_number].src = nir_src_for_ssa(ptn_channel(b, src[0], W)); - instr->src[src_number].src_type = nir_tex_src_lod; + instr->src[src_number] = nir_tex_src_for_ssa(nir_tex_src_lod, + ptn_channel(b, src[0], W)); src_number++; } diff --git a/src/mesa/state_tracker/st_atifs_to_nir.c b/src/mesa/state_tracker/st_atifs_to_nir.c index 42584f0159e..18802a8689c 100644 --- a/src/mesa/state_tracker/st_atifs_to_nir.c +++ b/src/mesa/state_tracker/st_atifs_to_nir.c @@ -359,14 +359,12 @@ compile_setupinst(struct st_translate *t, tex->coord_components = glsl_get_sampler_dim_coordinate_components(tex->sampler_dim); - tex->src[0].src_type = nir_tex_src_texture_deref; - tex->src[0].src = nir_src_for_ssa(&tex_deref->dest.ssa); - tex->src[1].src_type = nir_tex_src_sampler_deref; - tex->src[1].src = nir_src_for_ssa(&tex_deref->dest.ssa); - tex->src[2].src_type = nir_tex_src_coord; - tex->src[2].src = - nir_src_for_ssa(nir_channels(t->b, coord, - (1 << tex->coord_components) - 1)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &tex_deref->dest.ssa); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &tex_deref->dest.ssa); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_channels(t->b, coord, (1 << tex->coord_components) - 1)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(t->b, &tex->instr); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index b6722f3d758..7e4a1fd81b2 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -125,14 +125,14 @@ sample_via_nir(nir_builder *b, nir_variable *texcoord, tex->sampler_dim = GLSL_SAMPLER_DIM_2D; tex->coord_components = 2; tex->dest_type = alu_type; - tex->src[0].src_type = nir_tex_src_texture_deref; - tex->src[0].src = nir_src_for_ssa(&deref->dest.ssa); - tex->src[1].src_type = nir_tex_src_sampler_deref; - tex->src[1].src = nir_src_for_ssa(&deref->dest.ssa); - tex->src[2].src_type = nir_tex_src_coord; - tex->src[2].src = - nir_src_for_ssa(nir_channels(b, nir_load_var(b, texcoord), - (1 << tex->coord_components) - 1)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &deref->dest.ssa); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &deref->dest.ssa); + tex->src[2] = + nir_tex_src_for_ssa(nir_tex_src_coord, + nir_trim_vector(b, nir_load_var(b, texcoord), + tex->coord_components)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(b, &tex->instr); diff --git a/src/mesa/state_tracker/st_pbo_compute.c b/src/mesa/state_tracker/st_pbo_compute.c index 66979f23bd6..82aa82f1bed 100644 --- a/src/mesa/state_tracker/st_pbo_compute.c +++ b/src/mesa/state_tracker/st_pbo_compute.c @@ -678,10 +678,8 @@ create_conversion_shader(struct st_context *st, enum pipe_texture_target target, txf->coord_components = coord_components; txf->texture_index = 0; txf->sampler_index = 0; - txf->src[0].src_type = nir_tex_src_coord; - txf->src[0].src = nir_src_for_ssa(coord); - txf->src[1].src_type = nir_tex_src_lod; - txf->src[1].src = nir_src_for_ssa(nir_imm_int(&b, 0)); + txf->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); + txf->src[1] = nir_tex_src_for_ssa(nir_tex_src_lod, nir_imm_int(&b, 0)); txf->src[2].src_type = nir_tex_src_texture_deref; nir_deref_instr *sampler_deref = nir_build_deref_var(&b, sampler); txf->src[2].src = nir_src_for_ssa(&sampler_deref->dest.ssa); diff --git a/src/microsoft/vulkan/dzn_nir.c b/src/microsoft/vulkan/dzn_nir.c index 204a9ffb5ff..cf13545219f 100644 --- a/src/microsoft/vulkan/dzn_nir.c +++ b/src/microsoft/vulkan/dzn_nir.c @@ -704,18 +704,18 @@ dzn_nir_blit_fs(const struct dzn_nir_blit_info *info) tex->is_array = info->src_is_array; tex->sampler_dim = info->sampler_dim; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_f2i32(&b, coord)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_f2i32(&b, coord)); tex->coord_components = coord_comps; - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_imm_int(&b, s)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + nir_imm_int(&b, s)); - tex->src[2].src_type = nir_tex_src_lod; - tex->src[2].src = nir_src_for_ssa(nir_imm_int(&b, 0)); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_lod, + nir_imm_int(&b, 0)); - tex->src[3].src_type = nir_tex_src_texture_deref; - tex->src[3].src = nir_src_for_ssa(&tex_deref->dest.ssa); + tex->src[3] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &tex_deref->dest.ssa); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); @@ -736,18 +736,18 @@ dzn_nir_blit_fs(const struct dzn_nir_blit_info *info) if (ms) { tex->op = nir_texop_txf_ms; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_f2i32(&b, coord)); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, + nir_f2i32(&b, coord)); tex->coord_components = coord_comps; - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_load_sample_id(&b)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + nir_load_sample_id(&b)); - tex->src[2].src_type = nir_tex_src_lod; - tex->src[2].src = nir_src_for_ssa(nir_imm_int(&b, 0)); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_lod, + nir_imm_int(&b, 0)); - tex->src[3].src_type = nir_tex_src_texture_deref; - tex->src[3].src = nir_src_for_ssa(&tex_deref->dest.ssa); + tex->src[3] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &tex_deref->dest.ssa); } else { nir_variable *sampler_var = nir_variable_create(b.shader, nir_var_uniform, glsl_bare_sampler_type(), "sampler"); @@ -756,15 +756,14 @@ dzn_nir_blit_fs(const struct dzn_nir_blit_info *info) tex->op = nir_texop_tex; tex->sampler_index = 0; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); tex->coord_components = coord_comps; - tex->src[1].src_type = nir_tex_src_texture_deref; - tex->src[1].src = nir_src_for_ssa(&tex_deref->dest.ssa); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_texture_deref, + &tex_deref->dest.ssa); - tex->src[2].src_type = nir_tex_src_sampler_deref; - tex->src[2].src = nir_src_for_ssa(&sampler_deref->dest.ssa); + tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_sampler_deref, + &sampler_deref->dest.ssa); } nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); diff --git a/src/panfrost/lib/pan_blitter.c b/src/panfrost/lib/pan_blitter.c index 14b470af9c1..97d1de679fa 100644 --- a/src/panfrost/lib/pan_blitter.c +++ b/src/panfrost/lib/pan_blitter.c @@ -549,15 +549,15 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev, tex->is_array = key->surfaces[i].array; tex->sampler_dim = sampler_dim; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_f2i32(&b, coord)); + tex->src[0] = + nir_tex_src_for_ssa(nir_tex_src_coord, nir_f2i32(&b, coord)); tex->coord_components = coord_comps; - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_imm_int(&b, s)); + tex->src[1] = + nir_tex_src_for_ssa(nir_tex_src_ms_index, nir_imm_int(&b, s)); - tex->src[2].src_type = nir_tex_src_lod; - tex->src[2].src = nir_src_for_ssa(nir_imm_int(&b, 0)); + tex->src[2] = + nir_tex_src_for_ssa(nir_tex_src_lod, nir_imm_int(&b, 0)); nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32); nir_builder_instr_insert(&b, &tex->instr); @@ -577,20 +577,19 @@ pan_blitter_get_blit_shader(struct panfrost_device *dev, if (ms) { tex->op = nir_texop_txf_ms; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(nir_f2i32(&b, coord)); + tex->src[0] = + nir_tex_src_for_ssa(nir_tex_src_coord, nir_f2i32(&b, coord)); tex->coord_components = coord_comps; - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_load_sample_id(&b)); + tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_ms_index, + nir_load_sample_id(&b)); - tex->src[2].src_type = nir_tex_src_lod; - tex->src[2].src = nir_src_for_ssa(nir_imm_int(&b, 0)); + tex->src[2] = + nir_tex_src_for_ssa(nir_tex_src_lod, nir_imm_int(&b, 0)); } else { tex->op = nir_texop_txl; - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); tex->coord_components = coord_comps; } diff --git a/src/panfrost/vulkan/panvk_vX_meta_copy.c b/src/panfrost/vulkan/panvk_vX_meta_copy.c index 5982bd0d572..7337efd5ee7 100644 --- a/src/panfrost/vulkan/panvk_vX_meta_copy.c +++ b/src/panfrost/vulkan/panvk_vX_meta_copy.c @@ -326,13 +326,12 @@ panvk_meta_copy_img2img_shader(struct panfrost_device *pdev, unreachable("Invalid texture dimension"); } - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(coord); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, coord); tex->coord_components = texdim + texisarray; if (is_ms) { - tex->src[1].src_type = nir_tex_src_ms_index; - tex->src[1].src = nir_src_for_ssa(nir_load_sample_id(&b)); + tex->src[1] = + nir_tex_src_for_ssa(nir_tex_src_ms_index, nir_load_sample_id(&b)); } nir_ssa_dest_init(&tex->instr, &tex->dest, 4, @@ -1358,8 +1357,7 @@ panvk_meta_copy_img2buf_shader(struct panfrost_device *pdev, unreachable("Invalid texture dimension"); } - tex->src[0].src_type = nir_tex_src_coord; - tex->src[0].src = nir_src_for_ssa(imgcoords); + tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_coord, imgcoords); tex->coord_components = texdim + texisarray; nir_ssa_dest_init(&tex->instr, &tex->dest, 4, nir_alu_type_get_type_size(tex->dest_type));