xref: /aosp_15_r20/external/skia/tests/sksl/shared/TemporaryIndexLookup.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 "colorGreen"
9               OpMemberName %_UniformBuffer 1 "colorRed"
10               OpMemberName %_UniformBuffer 2 "testMatrix3x3"
11               OpName %_entrypoint_v "_entrypoint_v"
12               OpName %GetTestMatrix_f33 "GetTestMatrix_f33"
13               OpName %main "main"
14               OpName %expected "expected"
15               OpName %i "i"
16               OpName %j "j"
17               OpDecorate %sk_FragColor RelaxedPrecision
18               OpDecorate %sk_FragColor Location 0
19               OpDecorate %sk_FragColor Index 0
20               OpMemberDecorate %_UniformBuffer 0 Offset 0
21               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
22               OpMemberDecorate %_UniformBuffer 1 Offset 16
23               OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
24               OpMemberDecorate %_UniformBuffer 2 Offset 32
25               OpMemberDecorate %_UniformBuffer 2 ColMajor
26               OpMemberDecorate %_UniformBuffer 2 MatrixStride 16
27               OpDecorate %_UniformBuffer Block
28               OpDecorate %8 Binding 0
29               OpDecorate %8 DescriptorSet 0
30               OpDecorate %73 RelaxedPrecision
31               OpDecorate %79 RelaxedPrecision
32      %float = OpTypeFloat 32
33    %v4float = OpTypeVector %float 4
34%_ptr_Output_v4float = OpTypePointer Output %v4float
35%sk_FragColor = OpVariable %_ptr_Output_v4float Output
36    %v3float = OpTypeVector %float 3
37%mat3v3float = OpTypeMatrix %v3float 3
38%_UniformBuffer = OpTypeStruct %v4float %v4float %mat3v3float
39%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
40          %8 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
41       %void = OpTypeVoid
42         %15 = OpTypeFunction %void
43    %float_0 = OpConstant %float 0
44    %v2float = OpTypeVector %float 2
45         %19 = OpConstantComposite %v2float %float_0 %float_0
46%_ptr_Function_v2float = OpTypePointer Function %v2float
47         %23 = OpTypeFunction %mat3v3float
48%_ptr_Uniform_mat3v3float = OpTypePointer Uniform %mat3v3float
49        %int = OpTypeInt 32 1
50      %int_2 = OpConstant %int 2
51         %30 = OpTypeFunction %v4float %_ptr_Function_v2float
52%_ptr_Function_float = OpTypePointer Function %float
53%_ptr_Function_int = OpTypePointer Function %int
54      %int_0 = OpConstant %int 0
55      %int_3 = OpConstant %int 3
56       %bool = OpTypeBool
57    %float_1 = OpConstant %float 1
58%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
59%_ptr_Function_v3float = OpTypePointer Function %v3float
60%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
61      %int_1 = OpConstant %int 1
62%_entrypoint_v = OpFunction %void None %15
63         %16 = OpLabel
64         %20 = OpVariable %_ptr_Function_v2float Function
65               OpStore %20 %19
66         %22 = OpFunctionCall %v4float %main %20
67               OpStore %sk_FragColor %22
68               OpReturn
69               OpFunctionEnd
70%GetTestMatrix_f33 = OpFunction %mat3v3float None %23
71         %24 = OpLabel
72         %25 = OpAccessChain %_ptr_Uniform_mat3v3float %8 %int_2
73         %29 = OpLoad %mat3v3float %25
74               OpReturnValue %29
75               OpFunctionEnd
76       %main = OpFunction %v4float None %30
77         %31 = OpFunctionParameter %_ptr_Function_v2float
78         %32 = OpLabel
79   %expected = OpVariable %_ptr_Function_float Function
80          %i = OpVariable %_ptr_Function_int Function
81          %j = OpVariable %_ptr_Function_int Function
82         %58 = OpVariable %_ptr_Function_mat3v3float Function
83               OpStore %expected %float_0
84               OpStore %i %int_0
85               OpBranch %38
86         %38 = OpLabel
87               OpLoopMerge %42 %41 None
88               OpBranch %39
89         %39 = OpLabel
90         %43 = OpLoad %int %i
91         %45 = OpSLessThan %bool %43 %int_3
92               OpBranchConditional %45 %40 %42
93         %40 = OpLabel
94               OpStore %j %int_0
95               OpBranch %48
96         %48 = OpLabel
97               OpLoopMerge %52 %51 None
98               OpBranch %49
99         %49 = OpLabel
100         %53 = OpLoad %int %j
101         %54 = OpSLessThan %bool %53 %int_3
102               OpBranchConditional %54 %50 %52
103         %50 = OpLabel
104         %55 = OpLoad %float %expected
105         %57 = OpFAdd %float %55 %float_1
106               OpStore %expected %57
107         %60 = OpFunctionCall %mat3v3float %GetTestMatrix_f33
108               OpStore %58 %60
109         %61 = OpLoad %int %i
110         %62 = OpAccessChain %_ptr_Function_v3float %58 %61
111         %64 = OpLoad %v3float %62
112         %65 = OpLoad %int %j
113         %66 = OpVectorExtractDynamic %float %64 %65
114         %67 = OpFUnordNotEqual %bool %66 %57
115               OpSelectionMerge %69 None
116               OpBranchConditional %67 %68 %69
117         %68 = OpLabel
118         %70 = OpAccessChain %_ptr_Uniform_v4float %8 %int_1
119         %73 = OpLoad %v4float %70
120               OpReturnValue %73
121         %69 = OpLabel
122               OpBranch %51
123         %51 = OpLabel
124         %74 = OpLoad %int %j
125         %75 = OpIAdd %int %74 %int_1
126               OpStore %j %75
127               OpBranch %48
128         %52 = OpLabel
129               OpBranch %41
130         %41 = OpLabel
131         %76 = OpLoad %int %i
132         %77 = OpIAdd %int %76 %int_1
133               OpStore %i %77
134               OpBranch %38
135         %42 = OpLabel
136         %78 = OpAccessChain %_ptr_Uniform_v4float %8 %int_0
137         %79 = OpLoad %v4float %78
138               OpReturnValue %79
139               OpFunctionEnd
140