mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
Use the local (not global) invocation id to decide which invocation should do the initialization, so that every workgroup gets initialized, not just the first.
88 lines
2.2 KiB
Plaintext
88 lines
2.2 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.0
|
|
; Generator: rspirv
|
|
; Bound: 58
|
|
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %35 "compute" %23 %26 %28 %31 %33
|
|
OpExecutionMode %35 LocalSize 1 1 1
|
|
OpMemberDecorate %13 0 Offset 0
|
|
OpMemberDecorate %13 1 Offset 16
|
|
OpMemberDecorate %14 0 Offset 0
|
|
OpMemberDecorate %14 1 Offset 4
|
|
OpMemberDecorate %14 2 Offset 8
|
|
OpDecorate %16 ArrayStride 4
|
|
OpMemberDecorate %18 0 Offset 0
|
|
OpMemberDecorate %19 0 Offset 0
|
|
OpDecorate %23 BuiltIn GlobalInvocationId
|
|
OpDecorate %26 BuiltIn LocalInvocationId
|
|
OpDecorate %28 BuiltIn LocalInvocationIndex
|
|
OpDecorate %31 BuiltIn WorkgroupId
|
|
OpDecorate %33 BuiltIn NumWorkgroups
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeFloat 32
|
|
%3 = OpConstant %4 1.0
|
|
%6 = OpTypeInt 32 0
|
|
%5 = OpConstant %6 1
|
|
%7 = OpConstant %4 0.0
|
|
%9 = OpTypeInt 32 1
|
|
%8 = OpConstant %9 1
|
|
%10 = OpConstant %9 0
|
|
%11 = OpConstant %6 2
|
|
%12 = OpTypeVector %4 4
|
|
%13 = OpTypeStruct %12 %4
|
|
%14 = OpTypeStruct %4 %6 %4
|
|
%15 = OpTypeBool
|
|
%16 = OpTypeArray %6 %8
|
|
%17 = OpTypeVector %6 3
|
|
%18 = OpTypeStruct %6
|
|
%19 = OpTypeStruct %6
|
|
%21 = OpTypePointer Workgroup %16
|
|
%20 = OpVariable %21 Workgroup
|
|
%24 = OpTypePointer Input %17
|
|
%23 = OpVariable %24 Input
|
|
%26 = OpVariable %24 Input
|
|
%29 = OpTypePointer Input %6
|
|
%28 = OpVariable %29 Input
|
|
%31 = OpVariable %24 Input
|
|
%33 = OpVariable %24 Input
|
|
%36 = OpTypeFunction %2
|
|
%38 = OpConstantNull %16
|
|
%39 = OpConstantNull %17
|
|
%40 = OpTypeVector %15 3
|
|
%45 = OpConstant %6 264
|
|
%47 = OpTypePointer Workgroup %6
|
|
%56 = OpConstant %6 0
|
|
%35 = OpFunction %2 None %36
|
|
%22 = OpLabel
|
|
%25 = OpLoad %17 %23
|
|
%27 = OpLoad %17 %26
|
|
%30 = OpLoad %6 %28
|
|
%32 = OpLoad %17 %31
|
|
%34 = OpLoad %17 %33
|
|
OpBranch %37
|
|
%37 = OpLabel
|
|
%41 = OpIEqual %40 %27 %39
|
|
%42 = OpAll %15 %41
|
|
OpSelectionMerge %43 None
|
|
OpBranchConditional %42 %44 %43
|
|
%44 = OpLabel
|
|
OpStore %20 %38
|
|
OpBranch %43
|
|
%43 = OpLabel
|
|
OpControlBarrier %11 %11 %45
|
|
OpBranch %46
|
|
%46 = OpLabel
|
|
%48 = OpCompositeExtract %6 %25 0
|
|
%49 = OpCompositeExtract %6 %27 0
|
|
%50 = OpIAdd %6 %48 %49
|
|
%51 = OpIAdd %6 %50 %30
|
|
%52 = OpCompositeExtract %6 %32 0
|
|
%53 = OpIAdd %6 %51 %52
|
|
%54 = OpCompositeExtract %6 %34 0
|
|
%55 = OpIAdd %6 %53 %54
|
|
%57 = OpAccessChain %47 %20 %56
|
|
OpStore %57 %55
|
|
OpReturn
|
|
OpFunctionEnd |