spirv/nir: add capability check for SpvCapabilityAtomicStorage
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 28 Oct 2017 08:57:35 +0000 (10:57 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 3 Jul 2018 10:41:46 +0000 (12:41 +0200)
Capability that informs if atomic counters are supported. From SPIR-V
1.0 spec, section 3.7, "Storage Class", item 10 from table:

(Column "Storage Class"):

   "AtomicCounter For holding atomic counters. Visible across all
    functions of the current invocation. Atomic counter-specific
    memory."

(Column "Required Capability"):

   "AtomicStorage"

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/shader_info.h
src/compiler/spirv/spirv_to_nir.c

index 208235d81584c273e65d9206a3d4cf64b263e5ad..8c58ee285ec9daecce84e3a9e58fd79a91ce0935 100644 (file)
@@ -57,6 +57,7 @@ struct spirv_supported_capabilities {
    bool descriptor_array_dynamic_indexing;
    bool runtime_descriptor_array;
    bool stencil_export;
+   bool atomic_storage;
 };
 
 typedef struct shader_info {
index 270f263d0471c5017d9cb75ca330668d1b3c6f72..9d2f57cef94e803a884db4324d7d9c698cd348f0 100644 (file)
@@ -3389,7 +3389,6 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityFloat16Buffer:
       case SpvCapabilityFloat16:
       case SpvCapabilityInt64Atomics:
-      case SpvCapabilityAtomicStorage:
       case SpvCapabilityStorageImageMultisample:
       case SpvCapabilityInt8:
       case SpvCapabilitySparseResidency:
@@ -3399,6 +3398,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
                   spirv_capability_to_string(cap));
          break;
 
+      case SpvCapabilityAtomicStorage:
+         spv_check_supported(atomic_storage, cap);
+         break;
+
       case SpvCapabilityFloat64:
          spv_check_supported(float64, cap);
          break;