xref: /aosp_15_r20/external/skia/tests/sksl/shared/UniformArray.asm.frag (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor
5               OpExecutionMode %_entrypoint_v OriginUpperLeft
6               OpName %sk_FragColor "sk_FragColor"
7               OpName %_UniformBuffer "_UniformBuffer"
8               OpMemberName %_UniformBuffer 0 "testArray"
9               OpMemberName %_UniformBuffer 1 "colorGreen"
10               OpMemberName %_UniformBuffer 2 "colorRed"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %main "main"
13               OpName %index "index"
14               OpDecorate %sk_FragColor RelaxedPrecision
15               OpDecorate %sk_FragColor Location 0
16               OpDecorate %sk_FragColor Index 0
17               OpDecorate %_arr_float_int_5 ArrayStride 16
18               OpMemberDecorate %_UniformBuffer 0 Offset 0
19               OpMemberDecorate %_UniformBuffer 1 Offset 80
20               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
21               OpMemberDecorate %_UniformBuffer 2 Offset 96
22               OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
23               OpDecorate %_UniformBuffer Block
24               OpDecorate %7 Binding 0
25               OpDecorate %7 DescriptorSet 0
26               OpDecorate %53 RelaxedPrecision
27               OpDecorate %57 RelaxedPrecision
28      %float = OpTypeFloat 32
29    %v4float = OpTypeVector %float 4
30%_ptr_Output_v4float = OpTypePointer Output %v4float
31%sk_FragColor = OpVariable %_ptr_Output_v4float Output
32        %int = OpTypeInt 32 1
33      %int_5 = OpConstant %int 5
34%_arr_float_int_5 = OpTypeArray %float %int_5
35%_UniformBuffer = OpTypeStruct %_arr_float_int_5 %v4float %v4float
36%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
37          %7 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
38       %void = OpTypeVoid
39         %15 = OpTypeFunction %void
40    %float_0 = OpConstant %float 0
41    %v2float = OpTypeVector %float 2
42         %19 = OpConstantComposite %v2float %float_0 %float_0
43%_ptr_Function_v2float = OpTypePointer Function %v2float
44         %23 = OpTypeFunction %v4float %_ptr_Function_v2float
45%_ptr_Function_int = OpTypePointer Function %int
46      %int_0 = OpConstant %int 0
47       %bool = OpTypeBool
48%_ptr_Uniform__arr_float_int_5 = OpTypePointer Uniform %_arr_float_int_5
49%_ptr_Uniform_float = OpTypePointer Uniform %float
50      %int_1 = OpConstant %int 1
51%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
52      %int_2 = OpConstant %int 2
53%_entrypoint_v = OpFunction %void None %15
54         %16 = OpLabel
55         %20 = OpVariable %_ptr_Function_v2float Function
56               OpStore %20 %19
57         %22 = OpFunctionCall %v4float %main %20
58               OpStore %sk_FragColor %22
59               OpReturn
60               OpFunctionEnd
61       %main = OpFunction %v4float None %23
62         %24 = OpFunctionParameter %_ptr_Function_v2float
63         %25 = OpLabel
64      %index = OpVariable %_ptr_Function_int Function
65               OpStore %index %int_0
66               OpBranch %29
67         %29 = OpLabel
68               OpLoopMerge %33 %32 None
69               OpBranch %30
70         %30 = OpLabel
71         %34 = OpLoad %int %index
72         %35 = OpSLessThan %bool %34 %int_5
73               OpBranchConditional %35 %31 %33
74         %31 = OpLabel
75         %37 = OpAccessChain %_ptr_Uniform__arr_float_int_5 %7 %int_0
76         %39 = OpLoad %int %index
77         %40 = OpAccessChain %_ptr_Uniform_float %37 %39
78         %42 = OpLoad %float %40
79         %43 = OpLoad %int %index
80         %45 = OpIAdd %int %43 %int_1
81         %46 = OpConvertSToF %float %45
82         %47 = OpFUnordNotEqual %bool %42 %46
83               OpSelectionMerge %49 None
84               OpBranchConditional %47 %48 %49
85         %48 = OpLabel
86         %50 = OpAccessChain %_ptr_Uniform_v4float %7 %int_2
87         %53 = OpLoad %v4float %50
88               OpReturnValue %53
89         %49 = OpLabel
90               OpBranch %32
91         %32 = OpLabel
92         %54 = OpLoad %int %index
93         %55 = OpIAdd %int %54 %int_1
94               OpStore %index %55
95               OpBranch %29
96         %33 = OpLabel
97         %56 = OpAccessChain %_ptr_Uniform_v4float %7 %int_1
98         %57 = OpLoad %v4float %56
99               OpReturnValue %57
100               OpFunctionEnd
101