spirv/nir: Don't increment coord_components for array lod queries
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 21 Jul 2016 03:57:37 +0000 (20:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 22 Jul 2016 23:48:54 +0000 (16:48 -0700)
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@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-dev@lists.freedesktop.org>
src/compiler/spirv/spirv_to_nir.c

index b1bb48be577bce33c8a18dcd40e6769a7863187a..6654f5f7c6d46d4d71c559993be797ae2feae9af 100644 (file)
@@ -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;