spirv: Claim support for the simple memory model
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 26 Oct 2017 17:08:21 +0000 (10:08 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 26 Oct 2017 22:24:38 +0000 (15:24 -0700)
It's rather surprising that we've never actually hit this before.
Aparently, Ian's SPIR-V generator currently claims the Simple when you
don't do anything complex.  We really shouldn't assert-fail on it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/spirv/spirv_to_nir.c

index fe0a4efceb13b651a6bb7c674fe61f671f6d59e2..6825e0d6a82ab8135bef97e4d48f2c30087305b0 100644 (file)
@@ -2802,7 +2802,8 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
 
    case SpvOpMemoryModel:
       assert(w[1] == SpvAddressingModelLogical);
-      assert(w[2] == SpvMemoryModelGLSL450);
+      assert(w[2] == SpvMemoryModelSimple ||
+             w[2] == SpvMemoryModelGLSL450);
       break;
 
    case SpvOpEntryPoint: {