[Mesa-dev] [PATCH 3/3] ttn: fix dest size for some texture instructions

Rob Clark robdclark at gmail.com
Mon May 15 18:33:04 UTC 2017


Some, like lod, don't return 4 components.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index bdcf218..d4914ac 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -1464,7 +1464,9 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
 
    assert(src_number == num_srcs);
 
-   nir_ssa_dest_init(&instr->instr, &instr->dest, 4, 32, NULL);
+   nir_ssa_dest_init(&instr->instr, &instr->dest,
+		     nir_tex_instr_dest_size(instr),
+		     32, NULL);
    nir_builder_instr_insert(b, &instr->instr);
 
    /* Resolve the writemask on the texture op. */
-- 
2.9.3



More information about the mesa-dev mailing list