Mesa (master): spirv/nir: Don' t increment coord_components for array lod queries

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Jul 22 23:33:09 UTC 2016


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jul 20 20:57:37 2016 -0700

spirv/nir: Don't increment coord_components for array lod queries

For lod query instructions, we really don't care whether or not the sampler
is an array type because that doesn't factor into the LOD.

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "12.0" <mesa-dev at lists.freedesktop.org>

---

 src/compiler/spirv/spirv_to_nir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c
index b1bb48b..6654f5f 100644
--- a/src/compiler/spirv/spirv_to_nir.c
+++ b/src/compiler/spirv/spirv_to_nir.c
@@ -1511,7 +1511,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
          assert("Invalid sampler type");
       }
 
-      if (instr->is_array)
+      if (instr->is_array && instr->op != nir_texop_lod)
          instr->coord_components++;
    } else {
       instr->coord_components = 0;




More information about the mesa-commit mailing list