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