spirv/nir: Fix some texture opcode asserts
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 21 Jul 2016 02:23:17 +0000 (19:23 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 22 Jul 2016 23:27:35 +0000 (16:27 -0700)
We can't get an lod with txf_ms and SPIR-V considers textureGrad to be an
explicit-LOD texturing instruction.

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 1efda9ba85cb57a3e00912a39dab79e3c775a41e..22cd2e73912b8250390680f253ad0a069095b6f8 100644 (file)
@@ -1444,12 +1444,12 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
 
       if (operands & SpvImageOperandsLodMask) {
          assert(texop == nir_texop_txl || texop == nir_texop_txf ||
-                texop == nir_texop_txf_ms || texop == nir_texop_txs);
+                texop == nir_texop_txs);
          (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_lod);
       }
 
       if (operands & SpvImageOperandsGradMask) {
-         assert(texop == nir_texop_tex);
+         assert(texop == nir_texop_txl);
          texop = nir_texop_txd;
          (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_ddx);
          (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_ddy);