nir/spirv: Swap the argument order for AtomicCompareExchange
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 6 Sep 2016 22:02:31 +0000 (15:02 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 7 Sep 2016 00:08:13 +0000 (17:08 -0700)
SPIR-V has the two arguments in the opposite order from GLSL.  NIR uses the
GLSL order so we had them backwards.

Fixes dEQP-VK.spirv_assembly.instruction.compute.opatomic.compex

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 fda38f91106eda914fa9f4d390b79ea39d2b3c8e..4c0c794f62c8f7b245689c32382dacedeb65d67b 100644 (file)
@@ -1847,8 +1847,8 @@ fill_common_atomic_sources(struct vtn_builder *b, SpvOp opcode,
       break;
 
    case SpvOpAtomicCompareExchange:
-      src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
-      src[1] = nir_src_for_ssa(vtn_ssa_value(b, w[8])->def);
+      src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[8])->def);
+      src[1] = nir_src_for_ssa(vtn_ssa_value(b, w[7])->def);
       break;
       /* Fall through */