xref: /aosp_15_r20/external/skia/tests/sksl/shared/SampleLocations.asm.vert (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1               OpCapability Shader
2          %1 = OpExtInstImport "GLSL.std.450"
3               OpMemoryModel Logical GLSL450
4               OpEntryPoint Vertex %main "main" %3 %sk_InstanceID %sk_VertexID %vcoord_Stage0
5               OpName %sk_PerVertex "sk_PerVertex"
6               OpMemberName %sk_PerVertex 0 "sk_Position"
7               OpMemberName %sk_PerVertex 1 "sk_PointSize"
8               OpName %sk_InstanceID "sk_InstanceID"
9               OpName %sk_VertexID "sk_VertexID"
10               OpName %vcoord_Stage0 "vcoord_Stage0"
11               OpName %main "main"
12               OpName %x "x"
13               OpName %y "y"
14               OpName %ileft "ileft"
15               OpName %iright "iright"
16               OpName %itop "itop"
17               OpName %ibot "ibot"
18               OpName %outset "outset"
19               OpName %l "l"
20               OpName %r "r"
21               OpName %t "t"
22               OpName %b "b"
23               OpName %vertexpos "vertexpos"
24               OpMemberDecorate %sk_PerVertex 0 BuiltIn Position
25               OpMemberDecorate %sk_PerVertex 1 BuiltIn PointSize
26               OpDecorate %sk_PerVertex Block
27               OpDecorate %sk_InstanceID BuiltIn InstanceIndex
28               OpDecorate %sk_VertexID BuiltIn VertexIndex
29               OpDecorate %vcoord_Stage0 Location 1
30               OpDecorate %vcoord_Stage0 NoPerspective
31      %float = OpTypeFloat 32
32    %v4float = OpTypeVector %float 4
33%sk_PerVertex = OpTypeStruct %v4float %float
34%_ptr_Output_sk_PerVertex = OpTypePointer Output %sk_PerVertex
35          %3 = OpVariable %_ptr_Output_sk_PerVertex Output
36        %int = OpTypeInt 32 1
37%_ptr_Input_int = OpTypePointer Input %int
38%sk_InstanceID = OpVariable %_ptr_Input_int Input
39%sk_VertexID = OpVariable %_ptr_Input_int Input
40    %v2float = OpTypeVector %float 2
41%_ptr_Output_v2float = OpTypePointer Output %v2float
42%vcoord_Stage0 = OpVariable %_ptr_Output_v2float Output
43       %void = OpTypeVoid
44         %16 = OpTypeFunction %void
45%_ptr_Function_int = OpTypePointer Function %int
46    %int_200 = OpConstant %int 200
47    %int_929 = OpConstant %int 929
48     %int_17 = OpConstant %int 17
49      %int_1 = OpConstant %int 1
50   %int_1637 = OpConstant %int 1637
51    %int_313 = OpConstant %int 313
52   %int_1901 = OpConstant %int 1901
53%_ptr_Function_float = OpTypePointer Function %float
54%float_0_03125 = OpConstant %float 0.03125
55      %int_0 = OpConstant %int 0
56      %int_2 = OpConstant %int 2
57       %bool = OpTypeBool
58%float_0_0625 = OpConstant %float 0.0625
59%_ptr_Function_v2float = OpTypePointer Function %v2float
60     %int_n1 = OpConstant %int -1
61%_ptr_Output_float = OpTypePointer Output %float
62    %float_0 = OpConstant %float 0
63    %float_1 = OpConstant %float 1
64%_ptr_Output_v4float = OpTypePointer Output %v4float
65       %main = OpFunction %void None %16
66         %17 = OpLabel
67          %x = OpVariable %_ptr_Function_int Function
68          %y = OpVariable %_ptr_Function_int Function
69      %ileft = OpVariable %_ptr_Function_int Function
70     %iright = OpVariable %_ptr_Function_int Function
71       %itop = OpVariable %_ptr_Function_int Function
72       %ibot = OpVariable %_ptr_Function_int Function
73     %outset = OpVariable %_ptr_Function_float Function
74         %63 = OpVariable %_ptr_Function_float Function
75          %l = OpVariable %_ptr_Function_float Function
76          %r = OpVariable %_ptr_Function_float Function
77          %t = OpVariable %_ptr_Function_float Function
78          %b = OpVariable %_ptr_Function_float Function
79  %vertexpos = OpVariable %_ptr_Function_v2float Function
80         %92 = OpVariable %_ptr_Function_float Function
81        %104 = OpVariable %_ptr_Function_float Function
82         %20 = OpLoad %int %sk_InstanceID
83         %22 = OpSMod %int %20 %int_200
84               OpStore %x %22
85         %24 = OpLoad %int %sk_InstanceID
86         %25 = OpSDiv %int %24 %int_200
87               OpStore %y %25
88         %27 = OpLoad %int %sk_InstanceID
89         %29 = OpIMul %int %27 %int_929
90         %31 = OpSMod %int %29 %int_17
91               OpStore %ileft %31
92         %34 = OpIAdd %int %31 %int_1
93         %35 = OpLoad %int %sk_InstanceID
94         %37 = OpIMul %int %35 %int_1637
95         %38 = OpISub %int %int_17 %31
96         %39 = OpSMod %int %37 %38
97         %40 = OpIAdd %int %34 %39
98               OpStore %iright %40
99         %42 = OpLoad %int %sk_InstanceID
100         %44 = OpIMul %int %42 %int_313
101         %45 = OpSMod %int %44 %int_17
102               OpStore %itop %45
103         %47 = OpIAdd %int %45 %int_1
104         %48 = OpLoad %int %sk_InstanceID
105         %50 = OpIMul %int %48 %int_1901
106         %51 = OpISub %int %int_17 %45
107         %52 = OpSMod %int %50 %51
108         %53 = OpIAdd %int %47 %52
109               OpStore %ibot %53
110               OpStore %outset %float_0_03125
111         %58 = OpIAdd %int %22 %25
112         %60 = OpSMod %int %58 %int_2
113         %61 = OpIEqual %bool %int_0 %60
114               OpSelectionMerge %66 None
115               OpBranchConditional %61 %64 %65
116         %64 = OpLabel
117         %67 = OpFNegate %float %float_0_03125
118               OpStore %63 %67
119               OpBranch %66
120         %65 = OpLabel
121               OpStore %63 %float_0_03125
122               OpBranch %66
123         %66 = OpLabel
124         %68 = OpLoad %float %63
125               OpStore %outset %68
126         %70 = OpConvertSToF %float %31
127         %72 = OpFMul %float %70 %float_0_0625
128         %73 = OpFSub %float %72 %68
129               OpStore %l %73
130         %75 = OpConvertSToF %float %40
131         %76 = OpFMul %float %75 %float_0_0625
132         %77 = OpFAdd %float %76 %68
133               OpStore %r %77
134         %79 = OpConvertSToF %float %45
135         %80 = OpFMul %float %79 %float_0_0625
136         %81 = OpFSub %float %80 %68
137               OpStore %t %81
138         %83 = OpConvertSToF %float %53
139         %84 = OpFMul %float %83 %float_0_0625
140         %85 = OpFAdd %float %84 %68
141               OpStore %b %85
142         %88 = OpConvertSToF %float %22
143         %89 = OpLoad %int %sk_VertexID
144         %90 = OpSMod %int %89 %int_2
145         %91 = OpIEqual %bool %int_0 %90
146               OpSelectionMerge %95 None
147               OpBranchConditional %91 %93 %94
148         %93 = OpLabel
149               OpStore %92 %73
150               OpBranch %95
151         %94 = OpLabel
152               OpStore %92 %77
153               OpBranch %95
154         %95 = OpLabel
155         %96 = OpLoad %float %92
156         %97 = OpFAdd %float %88 %96
157         %98 = OpAccessChain %_ptr_Function_float %vertexpos %int_0
158               OpStore %98 %97
159         %99 = OpLoad %int %y
160        %100 = OpConvertSToF %float %99
161        %101 = OpLoad %int %sk_VertexID
162        %102 = OpSDiv %int %101 %int_2
163        %103 = OpIEqual %bool %int_0 %102
164               OpSelectionMerge %107 None
165               OpBranchConditional %103 %105 %106
166        %105 = OpLabel
167        %108 = OpLoad %float %t
168               OpStore %104 %108
169               OpBranch %107
170        %106 = OpLabel
171        %109 = OpLoad %float %b
172               OpStore %104 %109
173               OpBranch %107
174        %107 = OpLabel
175        %110 = OpLoad %float %104
176        %111 = OpFAdd %float %100 %110
177        %112 = OpAccessChain %_ptr_Function_float %vertexpos %int_1
178               OpStore %112 %111
179        %113 = OpLoad %int %sk_VertexID
180        %114 = OpSMod %int %113 %int_2
181        %115 = OpIEqual %bool %int_0 %114
182        %116 = OpSelect %int %115 %int_n1 %int_1
183        %118 = OpConvertSToF %float %116
184        %119 = OpAccessChain %_ptr_Output_float %vcoord_Stage0 %int_0
185               OpStore %119 %118
186        %121 = OpLoad %int %sk_VertexID
187        %122 = OpSDiv %int %121 %int_2
188        %123 = OpIEqual %bool %int_0 %122
189        %124 = OpSelect %int %123 %int_n1 %int_1
190        %125 = OpConvertSToF %float %124
191        %126 = OpAccessChain %_ptr_Output_float %vcoord_Stage0 %int_1
192               OpStore %126 %125
193        %127 = OpLoad %v2float %vertexpos
194        %128 = OpCompositeExtract %float %127 0
195        %129 = OpLoad %v2float %vertexpos
196        %130 = OpCompositeExtract %float %129 1
197        %133 = OpCompositeConstruct %v4float %128 %130 %float_0 %float_1
198        %134 = OpAccessChain %_ptr_Output_v4float %3 %int_0
199               OpStore %134 %133
200               OpReturn
201               OpFunctionEnd
202