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