mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
95 lines
2.2 KiB
Plaintext
95 lines
2.2 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 42
|
|
OpCapability Shader
|
|
OpExtension "SPV_KHR_storage_buffer_storage_class"
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %18 "main" %26
|
|
OpExecutionMode %18 LocalSize 1 1 1
|
|
%3 = OpString "workgroup-var-init.wgsl"
|
|
OpSource Unknown 0 %3 "struct WStruct {
|
|
arr: array<u32, 512>,
|
|
atom: atomic<i32>,
|
|
atom_arr: array<array<atomic<i32>, 8>, 8>,
|
|
}
|
|
|
|
var<workgroup> w_mem: WStruct;
|
|
|
|
@group(0) @binding(0)
|
|
var<storage, read_write> output: array<u32, 512>;
|
|
|
|
@compute @workgroup_size(1)
|
|
fn main() {
|
|
output = w_mem.arr;
|
|
}"
|
|
OpMemberName %11 0 "arr"
|
|
OpMemberName %11 1 "atom"
|
|
OpMemberName %11 2 "atom_arr"
|
|
OpName %11 "WStruct"
|
|
OpName %12 "w_mem"
|
|
OpName %14 "output"
|
|
OpName %18 "main"
|
|
OpDecorate %5 ArrayStride 4
|
|
OpDecorate %8 ArrayStride 4
|
|
OpDecorate %10 ArrayStride 32
|
|
OpMemberDecorate %11 0 Offset 0
|
|
OpMemberDecorate %11 1 Offset 2048
|
|
OpMemberDecorate %11 2 Offset 2052
|
|
OpDecorate %14 DescriptorSet 0
|
|
OpDecorate %14 Binding 0
|
|
OpDecorate %15 Block
|
|
OpMemberDecorate %15 0 Offset 0
|
|
OpDecorate %26 BuiltIn LocalInvocationId
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeInt 32 0
|
|
%6 = OpConstant %4 512
|
|
%5 = OpTypeArray %4 %6
|
|
%7 = OpTypeInt 32 1
|
|
%9 = OpConstant %4 8
|
|
%8 = OpTypeArray %7 %9
|
|
%10 = OpTypeArray %8 %9
|
|
%11 = OpTypeStruct %5 %7 %10
|
|
%13 = OpTypePointer Workgroup %11
|
|
%12 = OpVariable %13 Workgroup
|
|
%15 = OpTypeStruct %5
|
|
%16 = OpTypePointer StorageBuffer %15
|
|
%14 = OpVariable %16 StorageBuffer
|
|
%19 = OpTypeFunction %2
|
|
%20 = OpTypePointer StorageBuffer %5
|
|
%21 = OpConstant %4 0
|
|
%24 = OpConstantNull %11
|
|
%25 = OpTypeVector %4 3
|
|
%27 = OpTypePointer Input %25
|
|
%26 = OpVariable %27 Input
|
|
%29 = OpConstantNull %25
|
|
%31 = OpTypeBool
|
|
%30 = OpTypeVector %31 3
|
|
%36 = OpConstant %4 2
|
|
%37 = OpConstant %4 264
|
|
%39 = OpTypePointer Workgroup %5
|
|
%18 = OpFunction %2 None %19
|
|
%17 = OpLabel
|
|
%22 = OpAccessChain %20 %14 %21
|
|
OpBranch %23
|
|
%23 = OpLabel
|
|
%28 = OpLoad %25 %26
|
|
%32 = OpIEqual %30 %28 %29
|
|
%33 = OpAll %31 %32
|
|
OpSelectionMerge %34 None
|
|
OpBranchConditional %33 %35 %34
|
|
%35 = OpLabel
|
|
OpStore %12 %24
|
|
OpBranch %34
|
|
%34 = OpLabel
|
|
OpControlBarrier %36 %36 %37
|
|
OpBranch %38
|
|
%38 = OpLabel
|
|
OpLine %3 14 14
|
|
%40 = OpAccessChain %39 %12 %21
|
|
%41 = OpLoad %5 %40
|
|
OpLine %3 14 5
|
|
OpStore %22 %41
|
|
OpReturn
|
|
OpFunctionEnd |