Lines Matching defs:tex
174 nir_tex_instr *tex = nir_instr_as_tex(instr);
176 for (unsigned i = 0; i < tex->num_srcs; i++) {
177 if (tex->src[i].src_type == nir_tex_src_texture_deref ||
178 tex->src[i].src_type == nir_tex_src_sampler_deref) {
179 nir_deref_instr *deref = nir_src_as_deref(tex->src[i].src);
182 if (tex->src[i].src_type == nir_tex_src_texture_deref)
183 tex->texture_index = deref->var->data.driver_location;
185 tex->sampler_index = deref->var->data.driver_location;
187 nir_instr_rewrite_src(&tex->instr, &tex->src[i].src,
191 assert(tex->src[i].src.is_ssa);
192 b.cursor = nir_before_instr(&tex->instr);
194 nir_ssa_def *offset = nir_u2u32(&b, tex->src[i].src.ssa);
195 if (tex->src[i].src_type == nir_tex_src_texture_deref)
196 tex->src[count].src_type = nir_tex_src_texture_offset;
198 tex->src[count].src_type = nir_tex_src_sampler_offset;
199 nir_instr_rewrite_src(&tex->instr, &tex->src[count].src,
206 tex->src[count].src_type = tex->src[i].src_type;
207 nir_instr_move_src(&tex->instr, &tex->src[count].src,
208 &tex->src[i].src);
213 tex->num_srcs = count;