Mesa (master): zink: avoid incorrect vector-construction

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 18 11:13:00 UTC 2020


Module: Mesa
Branch: master
Commit: 5fc1562a7215c63b40f22f0320f458387e61e9b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5fc1562a7215c63b40f22f0320f458387e61e9b5

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Jan  3 12:22:38 2020 +0100

zink: avoid incorrect vector-construction

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3275>

---

 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index 5ed0d0ba6b8..bb916cf7a98 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -1462,7 +1462,7 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
       return;
    }
 
-   if (proj) {
+   if (proj && coord_components > 0) {
       SpvId constituents[coord_components + 1];
       if (coord_components == 1)
          constituents[0] = coord;
@@ -1506,7 +1506,7 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
    spirv_builder_emit_decoration(&ctx->builder, result,
                                  SpvDecorationRelaxedPrecision);
 
-   if (dref) {
+   if (dref && nir_dest_num_components(tex->dest) > 1) {
       SpvId components[4] = { result, result, result, result };
       result = spirv_builder_emit_composite_construct(&ctx->builder,
                                                       dest_type,



More information about the mesa-commit mailing list