nir/spirv: Use the correct sources for CompareExchange on images
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 6 Sep 2016 22:13:42 +0000 (15:13 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Sep 2016 00:08:13 +0000 (17:08 -0700)
The CompareExchange operation has two "Memory Semantics" parameters instead
of one so the real arguments start at w[7] instead of w[6].

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/compiler/spirv/spirv_to_nir.c

index 4c0c794f62c8f7b245689c32382dacedeb65d67b..0d6a70e4660f17e091734990872a81d0e7593228 100644 (file)
@@ -1749,8 +1749,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
       break;
 
    case SpvOpAtomicCompareExchange:
-      intrin->src[2] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
-      intrin->src[3] = nir_src_for_ssa(vtn_ssa_value(b, w[6])->def);
+      intrin->src[2] = nir_src_for_ssa(vtn_ssa_value(b, w[8])->def);
+      intrin->src[3] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
       break;
 
    case SpvOpAtomicISub: