From: Jason Ekstrand Date: Fri, 3 Mar 2017 03:03:01 +0000 (-0800) Subject: nir/spirv: Restrict the number of channels in texture coordinates X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fffa4111dfe6eb10fb478967ca0798331dfd525f;p=mesa.git 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 Reviewed-by: Kenneth Graunke Reviewed-by: Connor Abbott --- diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 8a02904e179..5b7d8f911e7 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -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;