~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/compiler/nir/nir_lower_readonly_images_to_tex.c

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
   if (glsl_sampler_type_is_array(deref->type))
128
128
      coord_components++;
129
129
 
130
 
   tex->src[0].src_type = nir_tex_src_texture_deref;
131
 
   tex->src[0].src = nir_src_for_ssa(&deref->dest.ssa);
 
130
   tex->src[0] = nir_tex_src_for_ssa(nir_tex_src_texture_deref,
 
131
                                     &deref->dest.ssa);
132
132
 
133
133
   if (options->per_variable) {
134
134
      assert(nir_deref_instr_get_variable(deref));
140
140
      assert(intrin->src[1].is_ssa);
141
141
      nir_ssa_def *coord =
142
142
         nir_trim_vector(b, intrin->src[1].ssa, coord_components);
143
 
      tex->src[1].src_type = nir_tex_src_coord;
144
 
      tex->src[1].src = nir_src_for_ssa(coord);
 
143
      tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_coord, coord);
145
144
      tex->coord_components = coord_components;
146
145
 
147
146
      assert(intrin->src[3].is_ssa);
148
147
      nir_ssa_def *lod = intrin->src[3].ssa;
149
 
      tex->src[2].src_type = nir_tex_src_lod;
150
 
      tex->src[2].src = nir_src_for_ssa(lod);
 
148
      tex->src[2] = nir_tex_src_for_ssa(nir_tex_src_lod, lod);
151
149
 
152
150
      assert(num_srcs == 3);
153
151
 
154
152
      tex->dest_type = nir_intrinsic_dest_type(intrin);
155
 
      nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32, NULL);
 
153
      nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32);
156
154
      break;
157
155
   }
158
156
 
159
157
   case nir_intrinsic_image_deref_size: {
160
158
      assert(intrin->src[1].is_ssa);
161
159
      nir_ssa_def *lod = intrin->src[1].ssa;
162
 
      tex->src[1].src_type = nir_tex_src_lod;
163
 
      tex->src[1].src = nir_src_for_ssa(lod);
 
160
      tex->src[1] = nir_tex_src_for_ssa(nir_tex_src_lod, lod);
164
161
 
165
162
      assert(num_srcs == 2);
166
163
 
167
164
      tex->dest_type = nir_type_uint32;
168
 
      nir_ssa_dest_init(&tex->instr, &tex->dest,
169
 
                        coord_components, 32, NULL);
 
165
      nir_ssa_dest_init(&tex->instr, &tex->dest, coord_components, 32);
170
166
      break;
171
167
   }
172
168