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