xref: /aosp_15_r20/external/skia/tests/sksl/compute/ArrayAdd.asm.comp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint GLCompute %main "main" %sk_GlobalInvocationID
5               OpExecutionMode %main LocalSize 256 1 1
6               OpName %inputBlock "inputBlock"
7               OpMemberName %inputBlock 0 "offset"
8               OpMemberName %inputBlock 1 "src"
9               OpName %outputBlock "outputBlock"
10               OpMemberName %outputBlock 0 "dest"
11               OpName %sk_GlobalInvocationID "sk_GlobalInvocationID"
12               OpName %main "main"
13               OpDecorate %_runtimearr_int ArrayStride 4
14               OpMemberDecorate %inputBlock 0 Offset 0
15               OpMemberDecorate %inputBlock 1 Offset 4
16               OpDecorate %inputBlock BufferBlock
17               OpDecorate %3 Binding 0
18               OpDecorate %3 DescriptorSet 0
19               OpMemberDecorate %outputBlock 0 Offset 0
20               OpDecorate %outputBlock BufferBlock
21               OpDecorate %9 Binding 1
22               OpDecorate %9 DescriptorSet 0
23               OpDecorate %sk_GlobalInvocationID BuiltIn GlobalInvocationId
24       %uint = OpTypeInt 32 0
25        %int = OpTypeInt 32 1
26%_runtimearr_int = OpTypeRuntimeArray %int
27 %inputBlock = OpTypeStruct %uint %_runtimearr_int
28%_ptr_Uniform_inputBlock = OpTypePointer Uniform %inputBlock
29          %3 = OpVariable %_ptr_Uniform_inputBlock Uniform
30%outputBlock = OpTypeStruct %_runtimearr_int
31%_ptr_Uniform_outputBlock = OpTypePointer Uniform %outputBlock
32          %9 = OpVariable %_ptr_Uniform_outputBlock Uniform
33     %v3uint = OpTypeVector %uint 3
34%_ptr_Input_v3uint = OpTypePointer Input %v3uint
35%sk_GlobalInvocationID = OpVariable %_ptr_Input_v3uint Input
36       %void = OpTypeVoid
37         %16 = OpTypeFunction %void
38      %int_1 = OpConstant %int 1
39%_ptr_Uniform_int = OpTypePointer Uniform %int
40      %int_0 = OpConstant %int 0
41%_ptr_Uniform_uint = OpTypePointer Uniform %uint
42       %main = OpFunction %void None %16
43         %17 = OpLabel
44         %19 = OpLoad %v3uint %sk_GlobalInvocationID
45         %20 = OpCompositeExtract %uint %19 0
46         %21 = OpAccessChain %_ptr_Uniform_int %3 %int_1 %20
47         %23 = OpLoad %int %21
48         %24 = OpLoad %v3uint %sk_GlobalInvocationID
49         %25 = OpCompositeExtract %uint %24 0
50         %27 = OpAccessChain %_ptr_Uniform_uint %3 %int_0
51         %29 = OpLoad %uint %27
52         %30 = OpIAdd %uint %25 %29
53         %31 = OpAccessChain %_ptr_Uniform_int %3 %int_1 %30
54         %32 = OpLoad %int %31
55         %33 = OpIAdd %int %23 %32
56         %34 = OpLoad %v3uint %sk_GlobalInvocationID
57         %35 = OpCompositeExtract %uint %34 0
58         %36 = OpAccessChain %_ptr_Uniform_int %9 %int_0 %35
59               OpStore %36 %33
60               OpReturn
61               OpFunctionEnd
62