This a total of 1 extra instruction in the shader and gives us a lot more
flexibility in how we do blits.
tex->src[0].src = nir_src_for_ssa(nir_load_var(&b, tex_pos_in));
tex->dest_type = nir_type_float; /* TODO */
- switch (tex_dim) {
- case GLSL_SAMPLER_DIM_2D:
- tex->coord_components = 2;
- break;
- case GLSL_SAMPLER_DIM_3D:
- tex->coord_components = 3;
- break;
- default:
- assert(!"Unsupported texture dimension");
- }
+ if (tex_dim == GLSL_SAMPLER_DIM_2D)
+ tex->is_array = true;
+ tex->coord_components = 3;
tex->sampler = nir_deref_var_create(tex, sampler);