nir: Get rid of nir_shader::stage
[mesa.git] / src / compiler / nir / nir_lower_drawpixels.c
index e221fd5ce0fec611fe69288e82d4fae88bee6018..acec9443431be774195661f0175d41394d5d3ef8 100644 (file)
@@ -135,7 +135,9 @@ lower_color(lower_drawpixels_state *state, nir_intrinsic_instr *intr)
    tex->texture_index = state->options->drawpix_sampler;
    tex->dest_type = nir_type_float;
    tex->src[0].src_type = nir_tex_src_coord;
-   tex->src[0].src = nir_src_for_ssa(texcoord);
+   tex->src[0].src =
+      nir_src_for_ssa(nir_channels(b, texcoord,
+                                   (1 << tex->coord_components) - 1));
 
    nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32, NULL);
    nir_builder_instr_insert(b, &tex->instr);
@@ -250,7 +252,7 @@ nir_lower_drawpixels(nir_shader *shader,
       .shader = shader,
    };
 
-   assert(shader->stage == MESA_SHADER_FRAGMENT);
+   assert(shader->info.stage == MESA_SHADER_FRAGMENT);
 
    nir_foreach_function(function, shader) {
       if (function->impl)