Mesa (master): nir/lower_tex: Use tex_instr_dest_size for txs destinations
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Tue Mar 14 15:56:35 UTC 2017
Module: Mesa
Branch: master
Commit: 0bf0365393497d2d29fd24b4c42f17d5ad9bd4e2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0bf0365393497d2d29fd24b4c42f17d5ad9bd4e2
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Thu Mar 2 19:27:57 2017 -0800
nir/lower_tex: Use tex_instr_dest_size for txs destinations
Using coord_components of the source texture is correct for everything
except cube maps where it's off by one.
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
---
src/compiler/nir/nir_lower_tex.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 66e2317..213406a 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -172,7 +172,8 @@ get_texture_size(nir_builder *b, nir_tex_instr *tex)
txs->src[0].src = nir_src_for_ssa(nir_imm_int(b, 0));
txs->src[0].src_type = nir_tex_src_lod;
- nir_ssa_dest_init(&txs->instr, &txs->dest, tex->coord_components, 32, NULL);
+ nir_ssa_dest_init(&txs->instr, &txs->dest,
+ nir_tex_instr_dest_size(txs), 32, NULL);
nir_builder_instr_insert(b, &txs->instr);
return nir_i2f(b, &txs->dest.ssa);
More information about the mesa-commit
mailing list