xref: /aosp_15_r20/external/skia/tests/sksl/shared/CompileTimeConstantVariables.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               OpName %_entrypoint_v "_entrypoint_v"
10               OpName %main "main"
11               OpName %integerInput "integerInput"
12               OpDecorate %sk_FragColor RelaxedPrecision
13               OpDecorate %sk_FragColor Location 0
14               OpDecorate %sk_FragColor Index 0
15               OpMemberDecorate %_UniformBuffer 0 Offset 0
16               OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
17               OpDecorate %_UniformBuffer Block
18               OpDecorate %7 Binding 0
19               OpDecorate %7 DescriptorSet 0
20               OpDecorate %29 RelaxedPrecision
21               OpDecorate %30 RelaxedPrecision
22               OpDecorate %45 RelaxedPrecision
23               OpDecorate %56 RelaxedPrecision
24               OpDecorate %57 RelaxedPrecision
25               OpDecorate %65 RelaxedPrecision
26               OpDecorate %66 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
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        %int = OpTypeInt 32 1
42%_ptr_Function_int = OpTypePointer Function %int
43%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
44      %int_0 = OpConstant %int 0
45       %bool = OpTypeBool
46%float_2_1400001 = OpConstant %float 2.1400001
47         %38 = OpConstantComposite %v4float %float_2_1400001 %float_2_1400001 %float_2_1400001 %float_2_1400001
48      %int_1 = OpConstant %int 1
49      %int_2 = OpConstant %int 2
50    %float_1 = OpConstant %float 1
51%float_0_200000003 = OpConstant %float 0.200000003
52         %53 = OpConstantComposite %v4float %float_1 %float_0_200000003 %float_2_1400001 %float_1
53%float_3_1400001 = OpConstant %float 3.1400001
54         %63 = OpConstantComposite %v4float %float_3_1400001 %float_3_1400001 %float_3_1400001 %float_3_1400001
55         %72 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0
56         %73 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
57%_entrypoint_v = OpFunction %void None %12
58         %13 = OpLabel
59         %17 = OpVariable %_ptr_Function_v2float Function
60               OpStore %17 %16
61         %19 = OpFunctionCall %v4float %main %17
62               OpStore %sk_FragColor %19
63               OpReturn
64               OpFunctionEnd
65       %main = OpFunction %v4float None %20
66         %21 = OpFunctionParameter %_ptr_Function_v2float
67         %22 = OpLabel
68%integerInput = OpVariable %_ptr_Function_int Function
69         %26 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
70         %29 = OpLoad %v4float %26
71         %30 = OpCompositeExtract %float %29 1
72         %31 = OpConvertFToS %int %30
73               OpStore %integerInput %31
74         %32 = OpIEqual %bool %31 %int_0
75               OpSelectionMerge %36 None
76               OpBranchConditional %32 %34 %35
77         %34 = OpLabel
78               OpReturnValue %38
79         %35 = OpLabel
80         %40 = OpIEqual %bool %31 %int_1
81               OpSelectionMerge %43 None
82               OpBranchConditional %40 %41 %42
83         %41 = OpLabel
84         %44 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
85         %45 = OpLoad %v4float %44
86               OpReturnValue %45
87         %42 = OpLabel
88         %47 = OpIEqual %bool %31 %int_2
89               OpSelectionMerge %50 None
90               OpBranchConditional %47 %48 %49
91         %48 = OpLabel
92               OpReturnValue %53
93         %49 = OpLabel
94         %55 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
95         %56 = OpLoad %v4float %55
96         %57 = OpCompositeExtract %float %56 0
97         %58 = OpFMul %float %57 %float_3_1400001
98         %59 = OpFOrdLessThan %bool %float_3_1400001 %58
99               OpSelectionMerge %62 None
100               OpBranchConditional %59 %60 %61
101         %60 = OpLabel
102               OpReturnValue %63
103         %61 = OpLabel
104         %64 = OpAccessChain %_ptr_Uniform_v4float %7 %int_0
105         %65 = OpLoad %v4float %64
106         %66 = OpCompositeExtract %float %65 0
107         %67 = OpFMul %float %66 %float_2_1400001
108         %68 = OpFOrdGreaterThanEqual %bool %float_2_1400001 %67
109               OpSelectionMerge %71 None
110               OpBranchConditional %68 %69 %70
111         %69 = OpLabel
112               OpReturnValue %72
113         %70 = OpLabel
114               OpReturnValue %73
115         %71 = OpLabel
116               OpBranch %62
117         %62 = OpLabel
118               OpBranch %50
119         %50 = OpLabel
120               OpBranch %43
121         %43 = OpLabel
122               OpBranch %36
123         %36 = OpLabel
124               OpUnreachable
125               OpFunctionEnd
126