summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_lower_drawpixels.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-03-08 15:20:31 -0800
committerEric Anholt <[email protected]>2017-05-02 10:24:40 -0700
commitfba6559a1e76a22135b14490fdf5a6f1de1ae272 (patch)
tree3c0c75f5b78da28eb14e1637d18f20fce77a18cc /src/compiler/nir/nir_lower_drawpixels.c
parent6ef1bd4fa57b36efc7919773fd26c36fd43d2ea9 (diff)
nir: Pick just the channels we want for bitmap and drawpixels lowering.
NIR now validates that SSA references use the same number of channels as are in the SSA value. v2: Reword commit message, since the commit didn't land before the validation change did. Fixes: 370d68babcbb ("nir/validate: Validate that bit sizes and components always match") Reviewed-by: Jason Ekstrand <[email protected]> (v1) Cc: <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_lower_drawpixels.c')
-rw-r--r--src/compiler/nir/nir_lower_drawpixels.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_drawpixels.c b/src/compiler/nir/nir_lower_drawpixels.c
index e221fd5ce0f..c01ae9e2536 100644
--- a/src/compiler/nir/nir_lower_drawpixels.c
+++ b/src/compiler/nir/nir_lower_drawpixels.c
@@ -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);