mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
nir/spirv: Restrict the number of channels in texture coordinates
Some SPIR-V texturing instructions pack more than the texture coordinate into the coordinate source. We need to mask off the unused channels. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
3c312be7b3
commit
fffa4111df
1 changed files with 2 additions and 1 deletions
|
|
@ -1568,7 +1568,8 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
|
|||
coord_components++;
|
||||
|
||||
coord = vtn_ssa_value(b, w[idx++])->def;
|
||||
p->src = nir_src_for_ssa(coord);
|
||||
p->src = nir_src_for_ssa(nir_channels(&b->nb, coord,
|
||||
(1 << coord_components) - 1));
|
||||
p->src_type = nir_tex_src_coord;
|
||||
p++;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue