spirv: implement Volatile image operand
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 29 Jun 2020 13:56:38 +0000 (14:56 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 17:15:22 +0000 (17:15 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6090>

src/compiler/spirv/spirv_to_nir.c

index dabb3c674bf504ddf06b3983a92fcca47e076b75..99910d2e448f396bc2f28d23e07a65fae1ebf62c 100644 (file)
@@ -3041,7 +3041,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
          image.lod = nir_imm_int(&b->nb, 0);
       }
 
-      /* TODO: Volatile. */
+      if (operands & SpvImageOperandsVolatileTexelMask)
+         access |= ACCESS_VOLATILE;
 
       break;
    }
@@ -3081,7 +3082,8 @@ vtn_handle_image(struct vtn_builder *b, SpvOp opcode,
          image.lod = nir_imm_int(&b->nb, 0);
       }
 
-      /* TODO: Volatile. */
+      if (operands & SpvImageOperandsVolatileTexelMask)
+         access |= ACCESS_VOLATILE;
 
       break;
    }