Files
wgpu/naga/tests/out/spv/atomicOps-int64.spvasm
T
Atlas Dostal abba12ae4e Add support for 64 bit integer atomic operations in shaders.
Add the following flags to `wgpu_types::Features`:

- `SHADER_INT64_ATOMIC_ALL_OPS` enables all atomic operations on `atomic<i64>` and
  `atomic<u64>` values.

- `SHADER_INT64_ATOMIC_MIN_MAX` is a subset of the above, enabling only
  `AtomicFunction::Min` and `AtomicFunction::Max` operations on `atomic<i64>` and
  `atomic<u64>` values in the `Storage` address space. These are the only 64-bit
  atomic operations available on Metal as of 3.1.

Add corresponding flags to `naga::valid::Capabilities`. These are supported by the
WGSL front end, and all Naga backends.

Platform support:

- On Direct3d 12, in `D3D12_FEATURE_DATA_D3D12_OPTIONS9`, if
  `AtomicInt64OnTypedResourceSupported` and `AtomicInt64OnGroupSharedSupported` are
  both available, then both wgpu features described above are available.

- On Metal, `SHADER_INT64_ATOMIC_MIN_MAX` is available on Apple9 hardware, and on
  hardware that advertises both Apple8 and Mac2 support. This also requires Metal
  Shading Language 2.4 or later. Metal does not yet support the more general
  `SHADER_INT64_ATOMIC_ALL_OPS`.

- On Vulkan, if the `VK_KHR_shader_atomic_int64` extension is available with both the
  `shader_buffer_int64_atomics` and `shader_shared_int64_atomics` features, then both
  wgpu features described above are available.
2024-06-08 18:36:26 -07:00

246 lines
7.9 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: rspirv
; Bound: 193
OpCapability Shader
OpCapability Int64Atomics
OpCapability Int64
OpExtension "SPV_KHR_storage_buffer_storage_class"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %29 "cs_main" %26
OpExecutionMode %29 LocalSize 2 1 1
OpDecorate %5 ArrayStride 8
OpMemberDecorate %8 0 Offset 0
OpMemberDecorate %8 1 Offset 8
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %11 Block
OpMemberDecorate %11 0 Offset 0
OpDecorate %13 DescriptorSet 0
OpDecorate %13 Binding 1
OpDecorate %14 Block
OpMemberDecorate %14 0 Offset 0
OpDecorate %16 DescriptorSet 0
OpDecorate %16 Binding 2
OpDecorate %17 Block
OpMemberDecorate %17 0 Offset 0
OpDecorate %26 BuiltIn LocalInvocationId
%2 = OpTypeVoid
%3 = OpTypeInt 64 0
%4 = OpTypeInt 64 1
%7 = OpTypeInt 32 0
%6 = OpConstant %7 2
%5 = OpTypeArray %4 %6
%8 = OpTypeStruct %3 %5
%9 = OpTypeVector %7 3
%11 = OpTypeStruct %3
%12 = OpTypePointer StorageBuffer %11
%10 = OpVariable %12 StorageBuffer
%14 = OpTypeStruct %5
%15 = OpTypePointer StorageBuffer %14
%13 = OpVariable %15 StorageBuffer
%17 = OpTypeStruct %8
%18 = OpTypePointer StorageBuffer %17
%16 = OpVariable %18 StorageBuffer
%20 = OpTypePointer Workgroup %3
%19 = OpVariable %20 Workgroup
%22 = OpTypePointer Workgroup %5
%21 = OpVariable %22 Workgroup
%24 = OpTypePointer Workgroup %8
%23 = OpVariable %24 Workgroup
%27 = OpTypePointer Input %9
%26 = OpVariable %27 Input
%30 = OpTypeFunction %2
%31 = OpTypePointer StorageBuffer %3
%32 = OpConstant %7 0
%34 = OpTypePointer StorageBuffer %5
%36 = OpTypePointer StorageBuffer %8
%38 = OpConstant %3 1
%39 = OpConstant %4 1
%41 = OpConstantNull %3
%42 = OpConstantNull %5
%43 = OpConstantNull %8
%44 = OpConstantNull %9
%46 = OpTypeBool
%45 = OpTypeVector %46 3
%51 = OpConstant %7 264
%54 = OpTypeInt 32 1
%53 = OpConstant %54 1
%55 = OpConstant %7 64
%56 = OpTypePointer StorageBuffer %4
%57 = OpConstant %7 1
%61 = OpConstant %54 2
%62 = OpConstant %7 256
%63 = OpTypePointer Workgroup %4
%29 = OpFunction %2 None %30
%25 = OpLabel
%28 = OpLoad %9 %26
%33 = OpAccessChain %31 %10 %32
%35 = OpAccessChain %34 %13 %32
%37 = OpAccessChain %36 %16 %32
OpBranch %40
%40 = OpLabel
%47 = OpIEqual %45 %28 %44
%48 = OpAll %46 %47
OpSelectionMerge %49 None
OpBranchConditional %48 %50 %49
%50 = OpLabel
OpStore %19 %41
OpStore %21 %42
OpStore %23 %43
OpBranch %49
%49 = OpLabel
OpControlBarrier %6 %6 %51
OpBranch %52
%52 = OpLabel
OpAtomicStore %33 %53 %55 %38
%58 = OpAccessChain %56 %35 %57
OpAtomicStore %58 %53 %55 %39
%59 = OpAccessChain %31 %37 %32
OpAtomicStore %59 %53 %55 %38
%60 = OpAccessChain %56 %37 %57 %57
OpAtomicStore %60 %53 %55 %39
OpAtomicStore %19 %61 %62 %38
%64 = OpAccessChain %63 %21 %57
OpAtomicStore %64 %61 %62 %39
%65 = OpAccessChain %20 %23 %32
OpAtomicStore %65 %61 %62 %38
%66 = OpAccessChain %63 %23 %57 %57
OpAtomicStore %66 %61 %62 %39
OpControlBarrier %6 %6 %51
%67 = OpAtomicLoad %3 %33 %53 %55
%68 = OpAccessChain %56 %35 %57
%69 = OpAtomicLoad %4 %68 %53 %55
%70 = OpAccessChain %31 %37 %32
%71 = OpAtomicLoad %3 %70 %53 %55
%72 = OpAccessChain %56 %37 %57 %57
%73 = OpAtomicLoad %4 %72 %53 %55
%74 = OpAtomicLoad %3 %19 %61 %62
%75 = OpAccessChain %63 %21 %57
%76 = OpAtomicLoad %4 %75 %61 %62
%77 = OpAccessChain %20 %23 %32
%78 = OpAtomicLoad %3 %77 %61 %62
%79 = OpAccessChain %63 %23 %57 %57
%80 = OpAtomicLoad %4 %79 %61 %62
OpControlBarrier %6 %6 %51
%81 = OpAtomicIAdd %3 %33 %53 %55 %38
%83 = OpAccessChain %56 %35 %57
%82 = OpAtomicIAdd %4 %83 %53 %55 %39
%85 = OpAccessChain %31 %37 %32
%84 = OpAtomicIAdd %3 %85 %53 %55 %38
%87 = OpAccessChain %56 %37 %57 %57
%86 = OpAtomicIAdd %4 %87 %53 %55 %39
%88 = OpAtomicIAdd %3 %19 %61 %62 %38
%90 = OpAccessChain %63 %21 %57
%89 = OpAtomicIAdd %4 %90 %61 %62 %39
%92 = OpAccessChain %20 %23 %32
%91 = OpAtomicIAdd %3 %92 %61 %62 %38
%94 = OpAccessChain %63 %23 %57 %57
%93 = OpAtomicIAdd %4 %94 %61 %62 %39
OpControlBarrier %6 %6 %51
%95 = OpAtomicISub %3 %33 %53 %55 %38
%97 = OpAccessChain %56 %35 %57
%96 = OpAtomicISub %4 %97 %53 %55 %39
%99 = OpAccessChain %31 %37 %32
%98 = OpAtomicISub %3 %99 %53 %55 %38
%101 = OpAccessChain %56 %37 %57 %57
%100 = OpAtomicISub %4 %101 %53 %55 %39
%102 = OpAtomicISub %3 %19 %61 %62 %38
%104 = OpAccessChain %63 %21 %57
%103 = OpAtomicISub %4 %104 %61 %62 %39
%106 = OpAccessChain %20 %23 %32
%105 = OpAtomicISub %3 %106 %61 %62 %38
%108 = OpAccessChain %63 %23 %57 %57
%107 = OpAtomicISub %4 %108 %61 %62 %39
OpControlBarrier %6 %6 %51
%109 = OpAtomicUMax %3 %33 %53 %55 %38
%111 = OpAccessChain %56 %35 %57
%110 = OpAtomicSMax %4 %111 %53 %55 %39
%113 = OpAccessChain %31 %37 %32
%112 = OpAtomicUMax %3 %113 %53 %55 %38
%115 = OpAccessChain %56 %37 %57 %57
%114 = OpAtomicSMax %4 %115 %53 %55 %39
%116 = OpAtomicUMax %3 %19 %61 %62 %38
%118 = OpAccessChain %63 %21 %57
%117 = OpAtomicSMax %4 %118 %61 %62 %39
%120 = OpAccessChain %20 %23 %32
%119 = OpAtomicUMax %3 %120 %61 %62 %38
%122 = OpAccessChain %63 %23 %57 %57
%121 = OpAtomicSMax %4 %122 %61 %62 %39
OpControlBarrier %6 %6 %51
%123 = OpAtomicUMin %3 %33 %53 %55 %38
%125 = OpAccessChain %56 %35 %57
%124 = OpAtomicSMin %4 %125 %53 %55 %39
%127 = OpAccessChain %31 %37 %32
%126 = OpAtomicUMin %3 %127 %53 %55 %38
%129 = OpAccessChain %56 %37 %57 %57
%128 = OpAtomicSMin %4 %129 %53 %55 %39
%130 = OpAtomicUMin %3 %19 %61 %62 %38
%132 = OpAccessChain %63 %21 %57
%131 = OpAtomicSMin %4 %132 %61 %62 %39
%134 = OpAccessChain %20 %23 %32
%133 = OpAtomicUMin %3 %134 %61 %62 %38
%136 = OpAccessChain %63 %23 %57 %57
%135 = OpAtomicSMin %4 %136 %61 %62 %39
OpControlBarrier %6 %6 %51
%137 = OpAtomicAnd %3 %33 %53 %55 %38
%139 = OpAccessChain %56 %35 %57
%138 = OpAtomicAnd %4 %139 %53 %55 %39
%141 = OpAccessChain %31 %37 %32
%140 = OpAtomicAnd %3 %141 %53 %55 %38
%143 = OpAccessChain %56 %37 %57 %57
%142 = OpAtomicAnd %4 %143 %53 %55 %39
%144 = OpAtomicAnd %3 %19 %61 %62 %38
%146 = OpAccessChain %63 %21 %57
%145 = OpAtomicAnd %4 %146 %61 %62 %39
%148 = OpAccessChain %20 %23 %32
%147 = OpAtomicAnd %3 %148 %61 %62 %38
%150 = OpAccessChain %63 %23 %57 %57
%149 = OpAtomicAnd %4 %150 %61 %62 %39
OpControlBarrier %6 %6 %51
%151 = OpAtomicOr %3 %33 %53 %55 %38
%153 = OpAccessChain %56 %35 %57
%152 = OpAtomicOr %4 %153 %53 %55 %39
%155 = OpAccessChain %31 %37 %32
%154 = OpAtomicOr %3 %155 %53 %55 %38
%157 = OpAccessChain %56 %37 %57 %57
%156 = OpAtomicOr %4 %157 %53 %55 %39
%158 = OpAtomicOr %3 %19 %61 %62 %38
%160 = OpAccessChain %63 %21 %57
%159 = OpAtomicOr %4 %160 %61 %62 %39
%162 = OpAccessChain %20 %23 %32
%161 = OpAtomicOr %3 %162 %61 %62 %38
%164 = OpAccessChain %63 %23 %57 %57
%163 = OpAtomicOr %4 %164 %61 %62 %39
OpControlBarrier %6 %6 %51
%165 = OpAtomicXor %3 %33 %53 %55 %38
%167 = OpAccessChain %56 %35 %57
%166 = OpAtomicXor %4 %167 %53 %55 %39
%169 = OpAccessChain %31 %37 %32
%168 = OpAtomicXor %3 %169 %53 %55 %38
%171 = OpAccessChain %56 %37 %57 %57
%170 = OpAtomicXor %4 %171 %53 %55 %39
%172 = OpAtomicXor %3 %19 %61 %62 %38
%174 = OpAccessChain %63 %21 %57
%173 = OpAtomicXor %4 %174 %61 %62 %39
%176 = OpAccessChain %20 %23 %32
%175 = OpAtomicXor %3 %176 %61 %62 %38
%178 = OpAccessChain %63 %23 %57 %57
%177 = OpAtomicXor %4 %178 %61 %62 %39
%179 = OpAtomicExchange %3 %33 %53 %55 %38
%181 = OpAccessChain %56 %35 %57
%180 = OpAtomicExchange %4 %181 %53 %55 %39
%183 = OpAccessChain %31 %37 %32
%182 = OpAtomicExchange %3 %183 %53 %55 %38
%185 = OpAccessChain %56 %37 %57 %57
%184 = OpAtomicExchange %4 %185 %53 %55 %39
%186 = OpAtomicExchange %3 %19 %61 %62 %38
%188 = OpAccessChain %63 %21 %57
%187 = OpAtomicExchange %4 %188 %61 %62 %39
%190 = OpAccessChain %20 %23 %32
%189 = OpAtomicExchange %3 %190 %61 %62 %38
%192 = OpAccessChain %63 %23 %57 %57
%191 = OpAtomicExchange %4 %192 %61 %62 %39
OpReturn
OpFunctionEnd