Debian Codegraph @

third_party/spirv-cross/shaders-msl/asm/frag/line-directive.line.asm.frag

raw
1 ; SPIR-V
2 ; Version: 1.0
3 ; Generator: Google Shaderc over Glslang; 7
4 ; Bound: 83
5 ; Schema: 0
6 OpCapability Shader
7 %2 = OpExtInstImport "GLSL.std.450"
8 OpMemoryModel Logical GLSL450
9 OpEntryPoint Fragment %main "main" %FragColor %vColor
10 OpExecutionMode %main OriginUpperLeft
11 %1 = OpString "test.frag"
12 OpSource GLSL 450 %1 "// OpModuleProcessed entry-point main
13 // OpModuleProcessed client vulkan100
14 // OpModuleProcessed target-env vulkan1.0
15 // OpModuleProcessed entry-point main
16 #line 1
17 #version 450
18
19 layout(location = 0) in float vColor;
20 layout(location = 0) out float FragColor;
21
22 void func()
23 {
24 FragColor = 1.0;
25 FragColor = 2.0;
26 if (vColor < 0.0)
27 {
28 FragColor = 3.0;
29 }
30 else
31 {
32 FragColor = 4.0;
33 }
34
35 for (int i = 0; i < 40 + vColor; i += int(vColor) + 5)
36 {
37 FragColor += 0.2;
38 FragColor += 0.3;
39 }
40
41 switch (int(vColor))
42 {
43 case 0:
44 FragColor += 0.2;
45 break;
46
47 case 1:
48 FragColor += 0.4;
49 break;
50
51 default:
52 FragColor += 0.8;
53 break;
54 }
55
56 do
57 {
58 FragColor += 10.0 + vColor;
59 } while(FragColor < 100.0);
60 }
61
62 void main()
63 {
64 func();
65 }
66 "
67 OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
68 OpSourceExtension "GL_GOOGLE_include_directive"
69 OpName %main "main"
70 OpName %func_ "func("
71 OpName %FragColor "FragColor"
72 OpName %vColor "vColor"
73 OpName %i "i"
74 OpDecorate %FragColor Location 0
75 OpDecorate %vColor Location 0
76 %void = OpTypeVoid
77 %4 = OpTypeFunction %void
78 %float = OpTypeFloat 32
79 %_ptr_Output_float = OpTypePointer Output %float
80 %FragColor = OpVariable %_ptr_Output_float Output
81 %float_1 = OpConstant %float 1
82 %float_2 = OpConstant %float 2
83 %_ptr_Input_float = OpTypePointer Input %float
84 %vColor = OpVariable %_ptr_Input_float Input
85 %float_0 = OpConstant %float 0
86 %bool = OpTypeBool
87 %float_3 = OpConstant %float 3
88 %float_4 = OpConstant %float 4
89 %int = OpTypeInt 32 1
90
91 ; Should be ignored
92 OpLine %1 5 0
93
94 %_ptr_Function_int = OpTypePointer Function %int
95 %int_0 = OpConstant %int 0
96 %float_40 = OpConstant %float 40
97 %float_0_200000003 = OpConstant %float 0.200000003
98 %float_0_300000012 = OpConstant %float 0.300000012
99 %int_5 = OpConstant %int 5
100
101 ; Should be ignored
102 OpLine %1 5 0
103
104 %float_0_400000006 = OpConstant %float 0.400000006
105 %float_0_800000012 = OpConstant %float 0.800000012
106 %float_10 = OpConstant %float 10
107 %float_100 = OpConstant %float 100
108 %main = OpFunction %void None %4
109 OpLine %1 46 0
110 %6 = OpLabel
111 OpLine %1 48 0
112 %82 = OpFunctionCall %void %func_
113 OpReturn
114 OpFunctionEnd
115
116 ; Should be ignored
117 OpLine %1 5 0
118
119 %func_ = OpFunction %void None %4
120 OpLine %1 6 0
121 %8 = OpLabel
122 %i = OpVariable %_ptr_Function_int Function
123 OpLine %1 8 0
124 OpStore %FragColor %float_1
125 OpLine %1 9 0
126 OpStore %FragColor %float_2
127 OpLine %1 10 0
128 %16 = OpLoad %float %vColor
129 %19 = OpFOrdLessThan %bool %16 %float_0
130 OpSelectionMerge %21 None
131 OpBranchConditional %19 %20 %23
132 %20 = OpLabel
133 OpLine %1 12 0
134 OpStore %FragColor %float_3
135 OpBranch %21
136 %23 = OpLabel
137 OpLine %1 16 0
138 OpStore %FragColor %float_4
139 OpBranch %21
140 %21 = OpLabel
141 OpLine %1 19 0
142 OpStore %i %int_0
143 OpBranch %29
144 %29 = OpLabel
145 OpLoopMerge %31 %32 None
146 OpBranch %33
147 %33 = OpLabel
148 %34 = OpLoad %int %i
149 %35 = OpConvertSToF %float %34
150 %37 = OpLoad %float %vColor
151 %38 = OpFAdd %float %float_40 %37
152 %39 = OpFOrdLessThan %bool %35 %38
153 OpBranchConditional %39 %30 %31
154 %30 = OpLabel
155 OpLine %1 21 0
156 %41 = OpLoad %float %FragColor
157 %42 = OpFAdd %float %41 %float_0_200000003
158 OpStore %FragColor %42
159 OpLine %1 22 0
160 %44 = OpLoad %float %FragColor
161 %45 = OpFAdd %float %44 %float_0_300000012
162 OpStore %FragColor %45
163 OpBranch %32
164 %32 = OpLabel
165 OpLine %1 19 0
166 %46 = OpLoad %float %vColor
167 %47 = OpConvertFToS %int %46
168 %49 = OpIAdd %int %47 %int_5
169 %50 = OpLoad %int %i
170 %51 = OpIAdd %int %50 %49
171 OpStore %i %51
172 OpBranch %29
173 %31 = OpLabel
174 OpLine %1 25 0
175 %52 = OpLoad %float %vColor
176 %53 = OpConvertFToS %int %52
177 OpSelectionMerge %57 None
178 OpSwitch %53 %56 0 %54 1 %55
179 %56 = OpLabel
180 OpLine %1 36 0
181 %66 = OpLoad %float %FragColor
182 %67 = OpFAdd %float %66 %float_0_800000012
183 OpStore %FragColor %67
184 OpLine %1 37 0
185 OpBranch %57
186 %54 = OpLabel
187 OpLine %1 28 0
188 %58 = OpLoad %float %FragColor
189 %59 = OpFAdd %float %58 %float_0_200000003
190 OpStore %FragColor %59
191 OpLine %1 29 0
192 OpBranch %57
193 %55 = OpLabel
194 OpLine %1 32 0
195 %62 = OpLoad %float %FragColor
196 %63 = OpFAdd %float %62 %float_0_400000006
197 OpStore %FragColor %63
198 OpLine %1 33 0
199 OpBranch %57
200 %57 = OpLabel
201 OpBranch %70
202 OpLine %1 43 0
203 %70 = OpLabel
204 OpLoopMerge %72 %73 None
205 OpBranch %71
206 %71 = OpLabel
207 OpLine %1 42 0
208 %75 = OpLoad %float %vColor
209 %76 = OpFAdd %float %float_10 %75
210 %77 = OpLoad %float %FragColor
211 %78 = OpFAdd %float %77 %76
212 OpStore %FragColor %78
213 OpBranch %73
214 %73 = OpLabel
215 OpLine %1 43 0
216 %79 = OpLoad %float %FragColor
217 %81 = OpFOrdLessThan %bool %79 %float_100
218 OpBranchConditional %81 %70 %72
219 %72 = OpLabel
220 OpReturn
221 OpFunctionEnd