• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" ?>
2<genxml>
3
4  <enum name="Channel">
5    <value name="R" value="0"/>
6    <value name="G" value="1"/>
7    <value name="B" value="2"/>
8    <value name="A" value="3"/>
9    <value name="1" value="4"/>
10    <value name="0" value="5"/>
11  </enum>
12
13  <enum name="ZS Func">
14    <value name="Never" value="0"/>
15    <value name="Less" value="1"/>
16    <value name="Equal" value="2"/>
17    <value name="Lequal" value="3"/>
18    <value name="Greater" value="4"/>
19    <value name="Not Equal" value="5"/>
20    <value name="Gequal" value="6"/>
21    <value name="Always" value="7"/>
22  </enum>
23
24  <enum name="Compare func">
25    <value name="Lequal" value="0"/>
26    <value name="Gequal" value="1"/>
27    <value name="Less" value="2"/>
28    <value name="Greater" value="3"/>
29    <value name="Equal" value="4"/>
30    <value name="Not Equal" value="5"/>
31    <value name="Always" value="6"/>
32    <value name="Never" value="7"/>
33  </enum>
34
35  <enum name="Stencil Op">
36    <value name="Keep" value="0"/>
37    <value name="Zero" value="1"/>
38    <value name="Replace" value="2"/>
39    <value name="Incr Sat" value="3"/>
40    <value name="Decr Sat" value="4"/>
41    <value name="Invert" value="5"/>
42    <value name="Incr Wrap" value="6"/>
43    <value name="Decr Wrap" value="7"/>
44  </enum>
45
46  <enum name="Visibility Mode">
47    <value name="None" value="0"/>
48    <value name="Counting" value="2"/>
49    <value name="Boolean" value="3"/>
50  </enum>
51
52  <enum name="Polygon Mode">
53    <value name="Fill" value="0"/>
54    <value name="Line" value="1"/>
55    <value name="Point" value="2"/>
56  </enum>
57
58  <enum name="Primitive">
59    <value name="Points" value="0"/>
60    <value name="Lines" value="1"/>
61    <value name="Line strip" value="3"/>
62    <value name="Line loop" value="5"/>
63    <value name="Triangles" value="6"/>
64    <value name="Triangle strip" value="9"/>
65    <value name="Triangle fan" value="11"/>
66    <value name="Quads" value="14"/>
67    <value name="Quad strip" value="15"/>
68  </enum>
69
70  <enum name="Object Type">
71    <value name="Triangle" value="0"/>
72    <value name="Line" value="1"/>
73    <value name="Point sprite UV=10" value="2"/>
74    <value name="Point sprite UV=01" value="4"/>
75    <!-- Line-filled tri. Point-filled tri. UV. Rect. Match RGX. -->
76  </enum>
77
78  <enum name="Layout">
79    <value name="Linear" value="0"/>
80    <!-- Default layout if no other layout is set -->
81    <value name="Null" value="1"/>
82    <!-- Morton order -->
83    <value name="Twiddled" value="2"/>
84    <!-- With a metadata buffer -->
85    <value name="Compressed" value="3"/>
86  </enum>
87
88  <enum name="Channels">
89    <value name="R8" value="0x00"/>
90    <value name="R16" value="0x09"/>
91    <value name="R8G8" value="0x0A"/>
92    <value name="R5G6B5" value="0x0B"/>
93    <value name="R4G4B4A4" value="0x0C"/>
94    <value name="A1R5G5B5" value="0x0D"/>
95    <value name="R5G5B5A1" value="0x0E"/>
96    <value name="R32" value="0x21"/>
97    <value name="R16G16" value="0x23"/>
98    <value name="R11G11B10" value="0x25"/>
99    <value name="R10G10B10A2" value="0x26"/>
100    <value name="R9G9B9E5" value="0x27"/>
101    <value name="R8G8B8A8" value="0x28"/>
102    <value name="R32G32" value="0x31"/>
103    <value name="R16G16B16A16" value="0x32"/>
104
105    <!-- Software-defined value selected not to clash with the hardware values.
106         Texture buffer reads from this format are lowered. It is invalid to
107         use this format for anything else. -->
108    <value name="R32G32B32 (Emulated)" value="0x36"/>
109
110    <value name="R32G32B32A32" value="0x38"/>
111    <value name="GBGR 422" value="0x40"/> <!-- Subsampled, swizzle BRG1 -->
112    <value name="BGRG 422" value="0x41"/> <!-- Subsampled, swizzle BRG1 -->
113
114    <!-- Compressed -->
115    <value name="PVRTC 2bpp" value="0x50"/>
116    <value name="PVRTC 4bpp" value="0x51"/>
117
118    <value name="ETC2 RGB8" value="0x58"/>
119    <value name="ETC2 RGBA8" value="0x59"/>
120    <value name="ETC2 RGB8A1" value="0x5A"/>
121    <value name="EAC R11" value="0x5B"/>
122    <value name="EAC RG11" value="0x5C"/>
123
124    <!-- For LDR use with UNORM/no-sRGB, for sRGB use with UNORM/sRGB, for HDR
125         use with FLOAT/no-sRGB -->
126    <value name="ASTC 4x4" value="0x60"/>
127    <value name="ASTC 5x4" value="0x61"/>
128    <value name="ASTC 5x5" value="0x62"/>
129    <value name="ASTC 6x5" value="0x63"/>
130    <value name="ASTC 6x6" value="0x64"/>
131    <value name="ASTC 8x5" value="0x65"/>
132    <value name="ASTC 8x6" value="0x66"/>
133    <value name="ASTC 8x8" value="0x67"/>
134    <value name="ASTC 10x5" value="0x68"/>
135    <value name="ASTC 10x6" value="0x69"/>
136    <value name="ASTC 10x8" value="0x6A"/>
137    <value name="ASTC 10x10" value="0x6B"/>
138    <value name="ASTC 12x10" value="0x6C"/>
139    <value name="ASTC 12x12" value="0x6D"/>
140
141    <value name="BC1" value="0x74"/>
142    <value name="BC2" value="0x75"/>
143    <value name="BC3" value="0x76"/>
144    <value name="BC4" value="0x77"/>
145    <value name="BC5" value="0x78"/>
146    <value name="BC6H" value="0x79"/>
147    <value name="BC6H Ufloat" value="0x7A"/>
148    <value name="BC7" value="0x7B"/>
149  </enum>
150
151  <enum name="Texture Type">
152    <value name="Unorm" value="0"/>
153    <value name="Snorm" value="1"/>
154    <value name="Uint" value="2"/>
155    <value name="Sint" value="3"/>
156    <value name="Float" value="4"/>
157    <value name="XR" value="5"/>
158  </enum>
159
160  <struct name="CF binding header" size="4">
161    <field name="Number of 32-bit slots" size="8" start="0:0" type="uint"/>
162    <field name="Number of coefficient registers" size="8" start="0:8" type="uint"/>
163  </struct>
164
165  <enum name="Shade model">
166    <value name="Flat vertex 0" value="0"/>
167    <value name="Flat vertex 2" value="2"/>
168    <value name="Linear" value="3"/>
169    <value name="Flat vertex 1" value="6"/>
170    <value name="Perspective" value="7"/>
171  </enum>
172
173  <enum name="Coefficient source">
174    <value name="Varying" value="0"/>
175    <value name="Fragcoord Z" value="1"/>
176    <value name="Point coord" value="2"/>
177    <value name="Primitive ID" value="3"/>
178    <!-- Vec2 only -->
179    <value name="Barycentric coord" value="5"/>
180  </enum>
181
182  <struct name="CF binding" size="4">
183    <field name="Components" size="2" start="0" type="uint" modifier="minus(1)"/>
184    <field name="Shade model" size="3" start="2" type="Shade model"/>
185    <field name="Source" size="3" start="5" type="Coefficient source"/>
186    <field name="Base slot" size="8" start="8" type="uint"/>
187    <field name="Base coefficient register" size="8" start="16" type="uint"/>
188  </struct>
189
190  <enum name="Texture dimension">
191    <value name="1D" value="0"/>
192    <value name="1D Array" value="1"/>
193    <value name="2D" value="2"/>
194    <value name="2D Array" value="3"/>
195    <value name="2D Multisampled" value="4"/>
196    <value name="3D" value="5"/>
197    <value name="Cube" value="6"/>
198    <value name="Cube Array" value="7"/>
199    <value name="2D Array Multisampled" value="8"/>
200  </enum>
201
202  <enum name="Sample Count">
203    <value name="2" value="0"/>
204    <value name="4" value="1"/>
205  </enum>
206
207  <struct name="PBE" size="24">
208    <field name="Dimension" size="4" start="0" type="Texture dimension"/>
209    <field name="Layout" size="2" start="4" type="Layout"/>
210    <field name="Channels" size="7" start="6" type="Channels"/>
211    <field name="Type" size="3" start="13" type="Texture Type"/>
212    <field name="Swizzle R" size="2" start="16" type="Channel"/>
213    <field name="Swizzle G" size="2" start="18" type="Channel"/>
214    <field name="Swizzle B" size="2" start="20" type="Channel"/>
215    <field name="Swizzle A" size="2" start="22" type="Channel"/>
216    <field name="Width" size="14" start="24" type="uint" modifier="minus(1)"/>
217    <field name="Height" size="14" start="38" type="uint" modifier="minus(1)"/>
218    <field name="Unk 52" size="1" start="52" type="bool"/>
219    <field name="Rotate 90" size="1" start="53" type="bool"/>
220    <field name="Flip vertical" size="1" start="54" type="bool"/>
221    <field name="Samples" size="1" start="56" type="Sample Count"/>
222    <field name="Unk mipmapped" size="1" start="58" type="bool"/>
223    <field name="Compressed 1" size="1" start="59" type="bool"/>
224    <field name="Buffer" size="36" start="64" type="address" modifier="shr(4)"/>
225    <field name="Level" size="4" start="100" type="uint"/>
226
227    <!-- If layout is not linear. Layers must be zero unless rendering to an
228    array texture (with a layered framebuffer) -->
229    <field name="Levels" size="4" start="104" type="uint" modifier="minus(1)"/>
230    <field name="Layers" size="14" start="108" type="uint" modifier="minus(1)"/>
231    <field name="Page-aligned layers" size="1" start="124" type="bool"/>
232
233    <!-- Should writes to this image convert to sRGB?
234
235      Note that imageblock writes do not use this flag, instead doing the
236      conversion when writing into the tilebuffer. -->
237    <field name="sRGB" size="1" start="125" type="bool"/>
238
239    <!-- Read the next word (set for compression or linear 2D arrays) -->
240    <field name="Extended" size="1" start="127" type="bool"/>
241
242    <!-- If layout is linear. Off by 4? -->
243    <field name="Stride" size="21" start="104" type="hex"/>
244
245    <!-- If layout is compressed -->
246    <field name="Acceleration buffer" size="64" start="128" type="address" modifier="shr(4)"/>
247
248    <!-- If layout is linear, stride has the minus 1 encoded -->
249    <field name="Depth (linear)" size="11" start="128" type="uint" modifier="minus(1)"/>
250    <field name="Layer stride (linear)" size="27" start="139" type="uint" modifier="shr(7)"/>
251
252    <!-- If neither, for software use to accelerate atomics and multisampled
253         writes. These are forbidden for compressed images and linear 2D arrays,
254         leaving this area free.
255    -->
256    <field name="Level offset (sw)" size="27" start="128" type="uint" modifier="shr(7)"/>
257    <field name="Aligned width MSAA (sw)" size="15" start="128" type="uint"/>
258    <field name="Tile width (sw)" size="3" start="155" type="uint" modifier="log2"/>
259    <field name="Tile height (sw)" size="3" start="158" type="uint" modifier="log2"/>
260    <field name="Layer stride (sw)" size="27" start="161" type="uint" modifier="shr(7)"/>
261    <field name="Sample count log2 (sw)" size="2" start="188" type="uint"/>
262    <field name="Buffer offset (sw)" size="32" start="128" type="uint"/>
263  </struct>
264
265  <struct name="Texture" size="24">
266    <field name="Dimension" size="4" start="0" type="Texture dimension"/>
267    <field name="Layout" size="2" start="4" type="Layout"/>
268    <field name="Channels" size="7" start="6" type="Channels"/>
269    <field name="Type" size="3" start="13" type="Texture Type"/>
270    <field name="Swizzle R" size="3" start="16" type="Channel"/>
271    <field name="Swizzle G" size="3" start="19" type="Channel"/>
272    <field name="Swizzle B" size="3" start="22" type="Channel"/>
273    <field name="Swizzle A" size="3" start="25" type="Channel"/>
274    <field name="Width" size="14" start="28" type="uint" modifier="minus(1)"/>
275    <field name="Height" size="14" start="42" type="uint" modifier="minus(1)"/>
276    <field name="First level" size="4" start="56" type="uint"/>
277    <field name="Last level" size="4" start="60" type="uint"/>
278    <field name="Samples" size="1" start="64" type="Sample Count"/>
279    <field name="Address" size="36" start="66" type="hex" modifier="shr(4)"/>
280    <!-- Unknown bit set by Metal when mipmapping. Might relate to a mechanism
281    to switch tile size (or disable tiling altogether?) at small mip levels to
282    reduce wasted memory due to padding. Causing test flakiness when set. -->
283    <field name="Unk mipmapped" size="1" start="102" type="bool"/>
284    <field name="Compressed 1" size="1" start="103" type="bool"/>
285    <!-- This is set when no texture is bound, with layout 1 -->
286    <field name="Null" size="1" start="105" type="bool"/>
287    <field name="Compression" size="2" start="106" type="hex"/> <!-- 0 for uncompressed -->
288    <field name="sRGB" size="1" start="108" type="bool"/>
289    <field name="sRGB 2-channel" size="1" start="109" type="bool"/>
290    <field name="Stride" size="18" start="110" type="hex" modifier="shr(4)"/>
291    <!-- Note that 3D/arrays cannot be linear. -->
292    <field name="Depth" size="14" start="110" type="uint" modifier="minus(1)"/>
293    <field name="Page-aligned layers" size="1" start="126" type="bool"/>
294
295    <!-- Read the next word (set for compression or linear 2D arrays) -->
296    <field name="Extended" size="1" start="127" type="bool"/>
297
298    <!-- If layout is compressed -->
299    <field name="Acceleration buffer" size="64" start="128" type="address" modifier="shr(4)"/>
300
301    <!-- If layout is linear, stride has the minus 1 encoded -->
302    <field name="Depth (linear)" size="11" start="128" type="uint" modifier="minus(1)"/>
303    <field name="Layer stride (linear)" size="27" start="139" type="uint" modifier="shr(7)"/>
304
305    <!-- Buffer texture metadata  -->
306    <field name="Buffer size (sw)" size="32" start="128" type="uint"/>
307    <field name="Buffer offset (sw)" size="32" start="160" type="uint"/>
308  </struct>
309
310  <enum name="Wrap">
311    <value name="Clamp to edge" value="0"/>
312    <value name="Repeat" value="1"/>
313    <value name="Mirrored repeat" value="2"/>
314    <value name="Clamp to border" value="3"/>
315    <value name="Clamp (GL)" value="4"/>
316    <value name="Mirrored clamp to edge" value="5"/>
317  </enum>
318
319  <enum name="Mip filter">
320    <value name="None" value="0"/>
321    <value name="Nearest" value="1"/>
322    <value name="Linear" value="2"/>
323  </enum>
324
325  <enum name="Border colour">
326    <value name="Transparent black" value="0"/>
327    <value name="Opaque black" value="1"/>
328    <value name="Opaque white" value="2"/>
329    <value name="Custom" value="3"/>
330  </enum>
331
332  <enum name="Filter">
333    <value name="Nearest" value="0"/>
334    <value name="Linear" value="1"/>
335    <value name="Bicubic" value="2"/>
336  </enum>
337
338  <struct name="Sampler" size="8">
339    <field name="Minimum LOD" size="10" start="0" type="lod"/>
340    <field name="Maximum LOD" size="10" start="10" type="lod"/>
341    <field name="Maximum anisotropy" size="3" start="20" type="uint" modifier="log2"/>
342    <field name="Magnify" size="2" start="23" type="Filter"/>
343    <field name="Minify" size="2" start="25" type="Filter"/>
344    <field name="Mip filter" size="2" start="27" type="Mip filter"/>
345    <field name="Wrap S" size="3" start="29" type="Wrap"/>
346    <field name="Wrap T" size="3" start="32" type="Wrap"/>
347    <field name="Wrap R" size="3" start="35" type="Wrap"/>
348    <field name="Pixel coordinates" size="1" start="38" type="bool"/>
349    <field name="Compare func" size="3" start="39" type="Compare func"/>
350    <field name="Compare enable" size="1" start="42" type="bool"/>
351    <field name="Border colour" size="2" start="55" type="Border colour"/>
352    <field name="Seamful cube maps" size="1" start="57" type="bool"/>
353  </struct>
354
355  <struct name="Border" size="16">
356    <field name="Channel 0" size="32" start="0:0" type="hex"/>
357    <field name="Channel 1" size="32" start="1:0" type="hex"/>
358    <field name="Channel 2" size="32" start="2:0" type="hex"/>
359    <field name="Channel 3" size="32" start="3:0" type="hex"/>
360  </struct>
361
362  <!--- Pointed to from the command buffer -->
363  <struct name="Scissor" size="16">
364    <field name="Max X" size="16" start="0:0" type="uint"/>
365    <field name="Min X" size="16" start="0:16" type="uint"/>
366    <field name="Max Y" size="16" start="1:0" type="uint"/>
367    <field name="Min Y" size="16" start="1:16" type="uint"/>
368    <field name="Min Z" size="32" start="2:0" type="float"/>
369    <field name="Max Z" size="32" start="3:0" type="float"/>
370  </struct>
371
372  <!-- Note: this structure is not padded. It really is 12 bytes -->
373  <struct name="Depth bias" size="12">
374    <field name="Depth bias" size="32" start="0:0" type="float"/>
375    <field name="Slope scale" size="32" start="1:0" type="float"/>
376    <field name="Clamp" size="32" start="2:0" type="float"/>
377  </struct>
378
379  <enum name="Sampler states">
380    <value name="0" value="0"/>
381    <value name="4 compact" value="1"/>
382    <value name="8 compact" value="2"/>
383    <value name="12 compact" value="3"/>
384    <value name="16 compact" value="4"/>
385    <value name="8 extended" value="6"/>
386    <value name="16 extended" value="7"/>
387  </enum>
388
389  <struct name="Counts" size="4">
390    <field name="Unknown 0" size="1" start="0" type="hex"/>
391    <field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
392    <field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
393    <field name="Sampler state register count" size="3" start="9" type="Sampler states"/>
394    <field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
395    <field name="CF binding count" size="7" start="16" type="uint"/>
396
397    <!-- Only for fragment shaders -->
398    <field name="Unknown" size="16" start="16" type="hex"/>
399  </struct>
400
401  <!-- PPP state starts -->
402  <struct name="PPP Header" size="4">
403    <field name="Fragment control" size="1" start="0" type="bool"/>
404    <field name="Fragment control 2" size="1" start="1" type="bool"/>
405    <field name="Fragment front face" size="1" start="2" type="bool"/>
406    <field name="Fragment front face 2" size="1" start="3" type="bool"/>
407    <field name="Fragment front stencil" size="1" start="4" type="bool"/>
408    <field name="Fragment back face" size="1" start="5" type="bool"/>
409    <field name="Fragment back face 2" size="1" start="6" type="bool"/>
410    <field name="Fragment back stencil" size="1" start="7" type="bool"/>
411    <field name="Depth bias/scissor" size="1" start="8" type="bool"/>
412    <field name="Region clip" size="1" start="10" type="bool"/>
413    <field name="Viewport" size="1" start="11" type="bool"/>
414    <field name="Viewport count" size="4" start="12" type="uint" modifier="minus(1)"/>
415    <field name="W clamp" size="1" start="16" type="bool"/>
416    <field name="Output select" size="1" start="17" type="bool"/>
417    <field name="Varying counts 32" size="1" start="18" type="bool"/>
418    <field name="Varying counts 16" size="1" start="19" type="bool"/>
419    <field name="Cull" size="1" start="21" type="bool"/>
420    <field name="Cull 2" size="1" start="22" type="bool"/>
421    <field name="Fragment shader" size="1" start="23" type="bool"/>
422    <field name="Occlusion query" size="1" start="24" type="bool"/>
423    <field name="Occlusion query 2" size="1" start="25" type="bool"/>
424    <field name="Output unknown" size="1" start="26" type="bool"/>
425    <field name="Output size" size="1" start="27" type="bool"/>
426    <field name="Varying word 2" size="1" start="28" type="bool"/>
427  </struct>
428
429  <!-- Acts like a scissor at 32x32 tile boundaries, ignored unless clip tile is set -->
430  <struct name="Region clip" size="8">
431    <field name="Max X" size="9" start="0" type="uint" modifier="minus(1)"/>
432    <field name="Min X" size="9" start="16" type="uint"/>
433    <field name="Enable" size="1" start="31" type="bool"/>
434    <field name="Max Y" size="9" start="32" type="uint" modifier="minus(1)"/>
435    <field name="Min Y" size="9" start="48" type="uint"/>
436  </struct>
437
438  <struct name="Viewport control" size="4">
439     <!-- so far only seen zeroes, but it stands to reason this is meant as a
440          control word for the viewports -->
441  </struct>
442
443  <!-- Used to convert clip space coordinates to NDC, does not clip -->
444  <struct name="Viewport" size="24">
445    <field name="Translate X" size="32" start="0:0" type="float"/>
446    <field name="Scale X" size="32" start="1:0" type="float"/>
447    <field name="Translate Y" size="32" start="2:0" type="float"/>
448    <field name="Scale Y" size="32" start="3:0" type="float"/>
449    <field name="Translate Z" size="32" start="4:0" type="float"/>
450    <field name="Scale Z" size="32" start="5:0" type="float"/>
451  </struct>
452
453  <struct name="Fragment face" size="4">
454    <field name="Stencil reference" size="8" start="0" type="hex"/>
455    <!-- line width is 4:4 fixed point with off-by-one applied -->
456    <field name="Line width" size="8" start="8" type="hex"/>
457    <field name="Polygon mode" size="2" start="18" type="Polygon Mode"/>
458    <field name="Disable depth write" size="1" start="21" type="bool"/>
459    <field name="Unk - visibility test internal" size="2" start="22" type="hex"/>
460    <field name="Depth function" size="3" start="24" type="ZS Func"/>
461  </struct>
462
463  <enum name="Conservative depth">
464    <value name="Any" value="0"/>
465    <value name="Greater" value="1"/>
466    <value name="Less" value="2"/>
467    <value name="Unchanged" value="3"/>
468  </enum>
469
470  <struct name="Fragment face 2" size="4">
471    <!-- If either disable is zeroed, depth is written -->
472    <field name="Disable depth write" size="1" start="21" type="bool"/>
473    <!-- If depth written from FS -->
474    <field name="Conservative depth" size="2" start="22" type="Conservative depth"/>
475    <!-- Both depth functions must pass -->
476    <field name="Depth function" size="3" start="24" type="ZS Func"/>
477    <field name="Object type" size="4" start="28" type="Object Type"/>
478  </struct>
479
480  <struct name="Fragment stencil" size="4">
481    <field name="Write mask" size="8" start="0" type="hex"/>
482    <field name="Read mask" size="8" start="8" type="hex"/>
483    <field name="Depth pass" size="3" start="16" type="Stencil Op"/>
484    <field name="Depth fail" size="3" start="19" type="Stencil Op"/>
485    <field name="Stencil fail" size="3" start="22" type="Stencil Op"/>
486    <field name="Compare" size="3" start="25" type="ZS Func"/>
487  </struct>
488
489  <enum name="Pass type">
490    <value name="Opaque" value="0"/>
491    <value name="Translucent" value="1"/>
492    <value name="Punch through" value="2"/>
493    <value name="Translucent punch through" value="3"/>
494  </enum>
495
496  <struct name="Fragment control" size="4">
497    <field name="Unk 1" size="1" start="9" type="bool" exact="true"/>
498    <field name="Visibility mode" size="2" start="14" type="Visibility Mode"/>
499    <field name="Scissor enable" size="1" start="16" type="bool"/>
500    <field name="Depth bias enable" size="1" start="17" type="bool"/>
501    <field name="Stencil test enable" size="1" start="18" type="bool"/>
502    <field name="Two-sided stencil" size="1" start="19" type="bool"/>
503    <field name="Tag write disable" size="1" start="21" type="bool"/>
504    <field name="Sample mask after depth/stencil" size="1" start="25" type="bool"/>
505    <field name="Disable tri merging" size="1" start="26" type="bool"/>
506    <field name="Pass type" size="3" start="29" type="Pass type"/>
507  </struct>
508
509  <struct name="Fragment occlusion query" size="4">
510    <!-- 64-bit index into occlusion result buffer -->
511    <field name="Index" size="15" start="17" type="uint"/>
512  </struct>
513
514  <struct name="Fragment occlusion query 2" size="4">
515    <field name="Unknown" size="17" start="0" type="hex"/>
516  </struct>
517
518  <struct name="W Clamp" size="4">
519    <field name="W Clamp" size="32" start="0" type="float"/>
520  </struct>
521
522  <enum name="PPP Vertex">
523    <value name="0" value="1"/>
524    <value name="1" value="2"/>
525    <value name="2" value="3"/>
526  </enum>
527
528  <struct name="Cull" size="4">
529    <field name="Cull front" size="1" start="0" type="bool"/>
530    <field name="Cull back" size="1" start="1" type="bool"/>
531    <field name="Flat shading vertex" size="2" start="7" type="PPP Vertex"/>
532    <field name="Depth clip" size="1" start="10" type="bool"/>
533    <field name="Depth clamp" size="1" start="11" type="bool"/>
534    <field name="Primitive MSAA" size="1" start="15" type="bool"/>
535    <field name="Front face CCW" size="1" start="16" type="bool"/>
536    <field name="Rasterizer discard" size="1" start="17" type="bool"/>
537  </struct>
538
539  <struct name="Cull 2" size="4">
540    <field name="Clamp W" size="1" start="5" type="bool"/>
541    <field name="Draw clipped edges" size="1" start="9" type="bool"/>
542    <field name="Needs Primitive ID" size="1" start="12" type="bool"/>
543    <field name="Rasterizer discard" size="1" start="17" type="bool"/>
544  </struct>
545
546  <struct name="Varying Counts" size="4">
547    <field name="Smooth" size="8" start="0" type="uint"/>
548    <field name="Flat" size="8" start="8" type="uint"/>
549    <field name="Linear" size="8" start="16" type="uint"/>
550  </struct>
551
552  <struct name="Varying 2" size="8">
553    <!-- TODO -->
554  </struct>
555
556  <struct name="Output Select" size="4">
557    <field name="Clip distance plane 0" size="1" start="0" type="bool"/>
558    <field name="Clip distance plane 1" size="1" start="1" type="bool"/>
559    <field name="Clip distance plane 2" size="1" start="2" type="bool"/>
560    <field name="Clip distance plane 3" size="1" start="3" type="bool"/>
561    <field name="Clip distance plane 4" size="1" start="4" type="bool"/>
562    <field name="Clip distance plane 5" size="1" start="5" type="bool"/>
563    <field name="Clip distance plane 6" size="1" start="6" type="bool"/>
564    <field name="Clip distance plane 7" size="1" start="7" type="bool"/>
565    <field name="Clip distance plane 8" size="1" start="8" type="bool"/>
566    <field name="Clip distance plane 9" size="1" start="9" type="bool"/>
567    <field name="Clip distance plane 10" size="1" start="10" type="bool"/>
568    <field name="Clip distance plane 11" size="1" start="11" type="bool"/>
569    <field name="Clip distance plane 12" size="1" start="12" type="bool"/>
570    <field name="Clip distance plane 13" size="1" start="13" type="bool"/>
571    <field name="Clip distance plane 14" size="1" start="14" type="bool"/>
572    <field name="Clip distance plane 15" size="1" start="15" type="bool"/>
573    <field name="Varyings" size="1" start="16" type="bool"/>
574    <field name="Point size" size="1" start="18" type="bool"/>
575    <!-- For layered rendering, enable both and write the 2x16-bit tuple from
576      the vertex shader (layer, viewport). -->
577    <field name="Viewport target" size="1" start="19" type="bool"/>
578    <field name="Render target" size="1" start="20" type="bool"/>
579    <field name="Frag coord Z" size="1" start="21" type="bool"/>
580    <field name="Barycentric coordinates" size="1" start="22" type="bool"/>
581  </struct>
582
583  <struct name="Output Unknown" size="4">
584    <!-- So far always zero -->
585  </struct>
586
587  <struct name="Output Size" size="4">
588    <field name="Count" size="32" start="0" type="uint"/>
589  </struct>
590
591  <!-- Indexes into the scissor and depth bias arrays -->
592  <struct name="Depth bias/Scissor" size="4">
593    <field name="Scissor" size="16" start="0" type="uint"/>
594    <field name="Depth bias" size="16" start="16" type="uint"/>
595  </struct>
596
597  <struct name="Fragment Shader Word 0" size="4">
598    <field name="Unknown 0" size="1" start="0" type="hex"/>
599    <field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
600    <field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
601    <field name="Sampler state register count" size="3" start="9" type="Sampler states"/>
602    <field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
603    <field name="CF binding count" size="7" start="16" type="uint"/>
604  </struct>
605
606  <struct name="Fragment Shader Word 1" size="4">
607    <field name="Unknown 1:0" size="2" start="0" type="hex"/>
608    <field name="Pipeline" size="26" start="6" type="address" modifier="shr(6)"/>
609  </struct>
610
611  <struct name="Fragment Shader Word 2" size="4">
612    <field name="CF bindings" size="30" start="2" type="address" modifier="shr(2)"/>
613  </struct>
614
615  <struct name="Fragment Shader Word 3" size="4">
616    <!-- Seems to be set to small values depending on textures? and pushed
617         uniforms? Needs investigation -->
618    <field name="Unknown" start="0" size="4" type="hex"/>
619  </struct>
620  <!-- PPP state ends -->
621
622  <!-- USC state starts -->
623  <enum name="USC Control">
624    <value name="Preshader" value="0x38"/>
625    <value name="Fragment properties" value="0x58"/>
626    <value name="No preshader" value="0x88"/>
627    <value name="Shader" value="0x0d"/>
628    <value name="Uniform" value="0x1d"/>
629    <value name="Uniform high" value="0x3d"/>
630    <value name="Shared" value="0x4d"/>
631    <value name="Registers" value="0x8d"/>
632    <value name="Sampler" value="0x9d"/>
633    <value name="Texture" value="0xdd"/>
634  </enum>
635
636  <struct name="USC Uniform" size="8">
637    <field name="Tag" size="8" start="0:0" type="USC Control" exact="Uniform"/>
638    <field name="Start (halfs)" size="8" start="0:8" type="uint"/>
639    <field name="Size (halfs)" size="6" start="0:20" type="uint" modifier="groups(1)"/>
640    <field name="Buffer" size="38" start="0:26" type="address" modifier="shr(2)"/>
641  </struct>
642
643  <struct name="USC Uniform High" size="8">
644    <field name="Tag" size="8" start="0:0" type="USC Control" exact="Uniform High"/>
645    <field name="Start (halfs)" size="8" start="0:8" type="uint"/>
646    <field name="Size (halfs)" size="6" start="0:20" type="uint" modifier="groups(1)"/>
647    <field name="Buffer" size="38" start="0:26" type="address" modifier="shr(2)"/>
648  </struct>
649
650  <struct name="USC Texture" size="8">
651    <field name="Tag" size="8" start="0:0" type="USC Control" exact="Texture"/>
652    <field name="Start" size="8" start="0:8" type="uint"/>
653    <!-- Exact split is unknown. Count is at least 5 bits. Less than 8 bits. -->
654    <field name="Count" size="7" start="0:20" type="uint"/>
655    <field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
656  </struct>
657
658  <struct name="USC Sampler" size="8">
659    <field name="Tag" size="8" start="0:0" type="USC Control" exact="Sampler"/>
660    <field name="Start" size="8" start="0:8" type="uint"/>
661    <field name="Count" size="7" start="0:20" type="uint"/>
662    <!-- Exact split is unknown. -->
663    <field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
664  </struct>
665
666  <enum name="Shared layout">
667    <value name="Vertex/compute" value="0x24"/>
668    <value name="32x32" value="0x2f"/>
669    <value name="32x16" value="0x3f"/>
670    <value name="16x16" value="0x36"/>
671  </enum>
672
673  <struct name="USC Shared" size="4">
674    <field name="Tag" size="8" start="0" type="USC Control" exact="Shared"/>
675    <field name="Uses shared memory" size="1" start="8" type="bool"/>
676    <field name="Layout" size="6" start="10" type="Shared layout"/>
677    <field name="Sample count" size="2" start="16" type="uint" modifier="log2"/>
678    <field name="Sample stride in 8 bytes" size="4" start="20" type="uint"/>
679    <field name="Bytes per threadgroup" size="8" start="24" type="uint" modifier="groups(256)"/>
680  </struct>
681
682  <struct name="USC Shader" size="6">
683    <field name="Tag" size="8" start="0" type="USC Control" exact="Shader"/>
684    <field name="Loads varyings" size="1" start="8" type="bool"/>
685    <!-- Seen set for pixel rate fragment shaders? -->
686    <field name="Unk 1" size="1" start="9" type="bool"/>
687    <field name="Unk 2" size="6" start="10" type="uint"/>
688    <field name="Code" size="32" start="16" type="address"/>
689  </struct>
690
691  <struct name="USC Registers" size="4">
692    <field name="Tag" size="8" start="0" type="USC Control" exact="Registers"/>
693    <field name="Register count" size="5" start="8" type="uint" modifier="groups(8)"/>
694    <field name="Unk 1" size="1" start="13" type="bool"/>
695    <field name="Spill size" size="4" start="18" type="hex"/>
696    <field name="Unk 4" size="8" start="24" type="hex"/>
697  </struct>
698
699  <struct name="USC No Preshader" size="2">
700    <field name="Tag" size="8" start="0" type="USC Control" exact="No preshader"/>
701  </struct>
702
703  <struct name="USC Preshader" size="8">
704    <field name="Tag" size="8" start="0" type="USC Control" exact="Preshader"/>
705    <field name="Unk" size="24" start="8" type="hex" exact="0xc08000"/>
706    <field name="Code" size="32" start="32" type="address"/>
707  </struct>
708
709  <struct name="USC Fragment Properties" size="4">
710    <field name="Tag" size="8" start="0" type="USC Control" exact="Fragment properties"/>
711    <field name="Early-z testing" size="1" start="8" type="bool"/>
712    <field name="Unk 2" size="1" start="9" type="bool"/>
713    <field name="Unconditional discard 1" size="1" start="10" type="bool"/>
714    <field name="Unconditional discard 2" size="1" start="11" type="bool"/>
715    <field name="Unk 3" size="4" start="12" type="hex"/>
716    <field name="Unk 4" size="8" start="16" type="hex"/> <!-- TODO: determine relation, see docs/table.py -->
717    <field name="Unk 5" size="8" start="24" type="hex"/>
718  </struct>
719  <!-- USC commands end -->
720
721  <!-- VDM commands start. VDM commands are padded out to 8b alignment. -->
722  <enum name="VDM Block Type">
723    <value name="PPP State Update" value="0"/>
724    <value name="Barrier" value="1"/>
725    <value name="VDM State Update" value="2"/>
726    <value name="Index List" value="3"/>
727    <value name="Stream Link" value="4"/>
728    <value name="Tessellate" value="5"/>
729    <value name="Stream terminate" value="6"/>
730  </enum>
731
732  <struct name="PPP State" size="8">
733    <field name="Pointer (hi)" size="8" start="0" type="hex"/>
734    <field name="Size (words)" size="8" start="8" type="uint"/>
735    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="PPP State Update"/>
736    <field name="Pointer (lo)" size="32" start="32" type="address"/>
737  </struct>
738
739  <struct name="VDM Barrier">
740    <field name="USC cache inval" size="1" start="3" type="bool"/>
741    <field name="Unk 4" size="1" start="4" type="bool"/>
742    <field name="Unk 5" size="1" start="5" type="bool"/>
743    <field name="Unk 6" size="1" start="6" type="bool"/>
744    <field name="Unk 8" size="1" start="8" type="bool"/>
745    <field name="Unk 11" size="1" start="11" type="bool"/>
746    <field name="Unk 20" size="1" start="20" type="bool"/>
747    <field name="Unk 24" size="1" start="24" type="bool"/>
748    <field name="Unk 26" size="1" start="26" type="bool"/>
749    <field name="Returns" size="1" start="27" type="bool"/>
750    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="Barrier"/>
751  </struct>
752
753  <enum name="Index size">
754    <value name="U8" value="0"/>
755    <value name="U16" value="1"/>
756    <value name="U32" value="2"/>
757  </enum>
758
759  <struct name="VDM State" size="4">
760    <field name="Restart index present" size="1" start="0" type="bool"/>
761    <field name="Vertex shader word 0 present" size="1" start="1" type="bool"/>
762    <field name="Vertex shader word 1 present" size="1" start="2" type="bool"/>
763    <field name="Vertex outputs present" size="1" start="3" type="bool"/>
764    <field name="Tessellation present" size="1" start="4" type="bool"/>
765    <field name="Vertex unknown present" size="1" start="5" type="bool"/>
766    <field name="Tessellation scale present" size="1" start="7" type="bool"/>
767    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="VDM State Update"/>
768  </struct>
769
770  <struct name="VDM State Restart Index" size="4">
771    <field name="Value" size="32" start="0" type="hex"/>
772  </struct>
773
774  <struct name="VDM State Vertex Shader Word 0" size="4">
775    <field name="Unknown 0" size="1" start="0" type="hex"/>
776    <field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
777    <field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
778    <field name="Sampler state register count" size="3" start="9" type="Sampler states"/>
779    <field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
780  </struct>
781
782  <struct name="VDM State Vertex Shader Word 1" size="4">
783    <field name="Unknown 1:0" size="2" start="0" type="hex"/>
784    <field name="Pipeline" size="26" start="6" type="address" modifier="shr(6)"/>
785  </struct>
786
787  <struct name="VDM State Vertex Outputs" size="4">
788    <field name="Output count 1" size="8" start="0" type="uint"/>
789    <field name="Output count 2" size="8" start="8" type="uint"/>
790  </struct>
791
792  <enum name="VDM Vertex">
793    <value name="0" value="0"/>
794    <value name="1" value="1"/>
795    <value name="2" value="2"/>
796  </enum>
797
798  <enum name="Partition mode">
799    <value name="Pow 2" value="0"/>
800    <value name="Integer" value="1"/>
801    <value name="Fractional odd" value="2"/>
802    <value name="Fractional even" value="3"/>
803  </enum>
804
805  <enum name="Step function">
806    <value name="Constant" value="0"/>
807    <value name="Per patch" value="1"/>
808    <value name="Per instance" value="2"/>
809    <value name="Per patch and per instance" value="3"/>
810  </enum>
811
812  <enum name="Patch type">
813    <value name="Triangles" value="0"/>
814    <value name="Quads" value="1"/>
815  </enum>
816
817  <enum name="Factor type">
818    <value name="FP16" value="0"/>
819    <value name="FP32" value="1"/>
820  </enum>
821
822  <struct name="VDM State Tessellation" size="4">
823    <field name="Unknown" size="17" start="0" type="hex"/>
824    <field name="Step function" size="2" start="17" type="Step function"/>
825    <field name="Factor type" size="1" start="19" type="Factor type"/>
826    <field name="Patch type" size="1" start="20" type="Patch type"/>
827    <field name="Unknown 3" size="2" start="21" type="hex"/> <!-- 1 -->
828
829    <!-- Subtract 1 for fractional odd -->
830    <field name="Max tess factor" size="6" start="23" type="uint" modifier="minus(1)"/>
831    <field name="Counterclockwise winding" size="1" start="29" type="bool"/>
832    <field name="Partition mode" size="2" start="30" type="Partition mode"/>
833  </struct>
834
835  <struct name="VDM State Tessellation Scale" size="4">
836    <!-- Always applied. Set to 1.0 to "disable" -->
837    <field name="Scale" size="16" start="0" type="half"/>
838  </struct>
839
840  <struct name="VDM State Vertex Unknown" size="4">
841    <field name="Flat shading control" start="0" size="2" type="VDM Vertex"/>
842    <field name="Unknown 4" size="1" start="4" type="bool"/>
843    <field name="Unknown 5" size="1" start="5" type="bool"/>
844    <field name="Generate primitive ID" size="1" start="6" type="bool"/>
845  </struct>
846
847  <!--- Command to issue a direct non-indexed draw -->
848  <struct name="Index List" size="4">
849    <field name="Index buffer hi" size="8" start="0" type="hex"/>
850    <field name="Primitive" size="8" start="8" type="Primitive"/>
851    <field name="Restart enable" size="1" start="16" type="bool"/>
852    <field name="Index size" size="3" start="17" type="Index size"/>
853
854    <field name="Index buffer size present" size="1" start="20" type="bool"/>
855    <field name="Index buffer present" size="1" start="21" type="bool"/>
856
857    <!-- Order in the cmdstream is the same as bit order for these -->
858    <field name="Index count present" size="1" start="22" type="bool"/>
859    <field name="Instance count present" size="1" start="23" type="bool"/>
860    <field name="Start present" size="1" start="24" type="bool"/>
861    <!-- 2 words, 1st word is some kind of extra vertex offset? -->
862    <field name="Unk 1 present" size="1" start="25" type="bool"/>
863    <field name="Indirect buffer present" size="1" start="26" type="bool"/>
864    <!-- 1 word, unknown purpose -->
865    <field name="Unk 2 present" size="1" start="27" type="bool"/>
866
867    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="Index List"/>
868  </struct>
869
870  <struct name="Index List: Buffer lo" size="4">
871    <!-- Index buffer lsb -->
872    <field name="Buffer lo" size="32" start="0" type="hex"/>
873  </struct>
874
875  <struct name="Index List: Count" size="4">
876    <!-- Vertex count for non-indexed, index count for index count -->
877    <field name="Count" size="32" start="0" type="uint"/>
878  </struct>
879
880  <struct name="Index List: Instances" size="4">
881    <field name="Count" size="32" start="0" type="uint"/> <!-- must be nonzero -->
882  </struct>
883
884  <struct name="Index List: Start" size="4">
885    <!-- Base vertex for indexed draws -->
886    <field name="Start" size="32" start="0" type="uint"/>
887  </struct>
888
889  <struct name="Index List: Buffer size" size="4">
890    <field name="Size" size="32" start="0" type="uint" modifier="shr(2)"/>
891  </struct>
892
893  <struct name="Index List: Indirect buffer" size="8">
894    <field name="Address hi" size="8" start="0" type="hex"/>
895    <field name="Address lo" size="32" start="32" type="hex"/>
896  </struct>
897
898  <!-- Conditional branching and function calls may be supported, see the
899       STREAM_LINK0 struct in mesa/src/imagination/csbgen/rogue_vdm.xml for a
900       probable definition -->
901  <struct name="VDM Stream Link" size="8">
902    <field name="Target hi" size="8" start="0" type="hex"/>
903    <field name="With return" size="1" start="28" type="bool"/>
904    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="Stream Link"/>
905    <field name="Target lo" size="32" start="32" type="hex"/>
906  </struct>
907
908  <struct name="VDM Tessellate" size="4">
909    <field name="Factor buffer hi" size="8" start="0" type="hex"/>
910    <field name="Unknown 0" size="12" start="8" type="hex"/> <!-- 0xc -->
911
912    <!-- Set for both indirect and direct -->
913    <field name="Unknown 2" size="1" start="20" type="bool"/>
914
915    <!-- Present for both indirect and direct -->
916    <!-- XXX: Order is an (educated) guess -->
917    <field name="Factor buffer present" size="1" start="21" type="bool"/>
918
919    <!-- XXX: out of bits???? not set for indirect??? -->
920    <field name="Patch count present" size="1" start="22" type="bool"/>
921
922    <!-- These four are omitted for indirect draws -->
923    <!-- XXX: Order is an (educated) guess -->
924    <field name="Instance count present" size="1" start="22" type="bool"/>
925    <field name="Base patch present" size="1" start="23" type="bool"/>
926    <field name="Base instance present" size="1" start="25" type="bool"/>
927    <!-- XXX: Out of bits!!! -->
928    <field name="Instance stride present" size="1" start="25" type="bool"/>
929
930    <field name="Indirect present" size="1" start="26" type="bool"/>
931    <field name="Factor buffer size present" size="1" start="28" type="bool"/>
932
933    <field name="Unknown 1" size="1" start="28" type="hex"/> <!-- 1 -->
934    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="Tessellate"/>
935  </struct>
936
937  <struct name="VDM Tessellate: Factor buffer" size="4">
938    <field name="Factor buffer lo" size="32" start="0" type="hex"/>
939  </struct>
940
941  <struct name="VDM Tessellate: Patch count" size="4">
942    <field name="Patch count" size="32" start="0" type="uint"/>
943  </struct>
944
945  <struct name="VDM Tessellate: Instance count" size="4">
946    <field name="Instance count" size="32" start="0" type="uint"/>
947  </struct>
948
949  <struct name="VDM Tessellate: Base patch" size="4">
950    <field name="Base patch" size="32" start="0" type="uint"/>
951  </struct>
952
953  <struct name="VDM Tessellate: Base instance" size="4">
954    <field name="Base instance" size="32" start="0" type="uint"/>
955  </struct>
956
957  <struct name="VDM Tessellate: Instance stride" size="4">
958    <!-- Divided by 4 for QUADS -->
959    <field name="Instance stride" size="32" start="0" type="uint"/>
960  </struct>
961
962  <struct name="VDM Tessellate: Indirect" size="12">
963    <!-- Address of the indirect buffer, format presumably matches Metal -->
964    <field name="Address hi" size="8" start="0:0" type="hex"/>
965    <field name="Address lo" size="32" start="1:0" type="hex"/>
966
967    <!-- # of bytes in the buffer, presumably for hw bounds checking -->
968    <field name="Size" size="32" start="2:0" type="uint"/>
969  </struct>
970
971  <struct name="VDM Tessellate: Factor buffer size" size="4">
972    <field name="Size (words)" size="32" start="0" type="uint" modifier="minus(1)"/>
973  </struct>
974
975  <struct name="VDM Stream Terminate" size="32">
976    <field name="Block Type" size="3" start="29" type="VDM Block Type" exact="Stream Terminate"/>
977  </struct>
978
979  <!-- VDM commands end -->
980
981  <!-- CDM commands start -->
982  <enum name="CDM Block Type">
983    <value name="Launch" value="0"/>
984    <value name="Stream Link" value="1"/>
985    <value name="Stream Terminate" value="2"/>
986    <value name="Barrier" value="3"/>
987    <value name="Stream Return" value="4"/>
988  </enum>
989
990  <enum name="CDM Mode">
991    <!-- Global size + Local size -->
992    <value name="Direct" value="0"/>
993
994    <!-- Indirect buffer + Local size. Indirect buffer contains 3x 32-bit global
995         size. Used for indirect dispatch when the local size must be
996         fixed (e.g. due to local memory being used) -->
997    <value name="Indirect global" value="1"/>
998
999    <!-- Indirect buffer, containing 6x 32-bit size. Used for indirect dispatch
1000         when the driver wants to optimize the local size with an auxiliary
1001         compute kernel (requiring e.g. no local memory use) -->
1002    <value name="Indirect local" value="2"/>
1003  </enum>
1004
1005  <struct name="CDM Launch Word 0" size="4">
1006    <field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
1007    <field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
1008    <field name="Sampler state register count" size="3" start="9" type="Sampler states"/>
1009    <field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
1010    <field name="Mode" size="2" start="27" type="CDM Mode"/>
1011    <field name="Block Type" size="3" start="29" type="CDM Block Type" exact="Launch"/>
1012  </struct>
1013
1014  <struct name="CDM Launch Word 1" size="4">
1015    <field name="Pipeline" size="26" start="6" type="address" modifier="shr(6)"/>
1016  </struct>
1017
1018  <struct name="CDM Unk G14X" size="8">
1019    <field name="Unknown 30" size="1" start="1:30" type="bool" exact="true"/>
1020  </struct>
1021
1022  <struct name="CDM Indirect" size="8">
1023    <field name="Address hi" size="8" start="0" type="hex"/>
1024    <field name="Address lo" size="30" start="34" type="hex" modifier="shr(2)"/>
1025  </struct>
1026
1027  <struct name="CDM Global size" size="12">
1028    <field name="X" size="32" start="0:0" type="uint"/>
1029    <field name="Y" size="32" start="1:0" type="uint"/>
1030    <field name="Z" size="32" start="2:0" type="uint"/>
1031  </struct>
1032
1033  <struct name="CDM Local size" size="12">
1034    <field name="X" size="32" start="0:0" type="uint"/>
1035    <field name="Y" size="32" start="1:0" type="uint"/>
1036    <field name="Z" size="32" start="2:0" type="uint"/>
1037  </struct>
1038
1039  <struct name="CDM Barrier" size="4">
1040    <field name="Unk 0" size="1" start="0" type="bool"/>
1041    <field name="Unk 1" size="1" start="1" type="bool"/>
1042    <field name="Unk 2" size="1" start="2" type="bool"/>
1043    <field name="USC cache inval" size="1" start="3" type="bool"/>
1044    <field name="Unk 4" size="1" start="4" type="bool"/>
1045    <field name="Unk 5" size="1" start="5" type="bool"/>
1046    <field name="Unk 6" size="1" start="6" type="bool"/>
1047    <field name="Unk 7" size="1" start="7" type="bool"/>
1048    <field name="Unk 8" size="1" start="8" type="bool"/>
1049    <field name="Unk 9" size="1" start="9" type="bool"/>
1050    <field name="Unk 10" size="1" start="10" type="bool"/>
1051    <field name="Unk 11" size="1" start="11" type="bool"/>
1052    <field name="Unk 12" size="1" start="12" type="bool"/>
1053    <field name="Unk 13" size="1" start="13" type="bool"/>
1054    <field name="Unk 14" size="1" start="14" type="bool"/>
1055    <field name="Unk 15" size="1" start="15" type="bool"/>
1056    <field name="Unk 16" size="1" start="16" type="bool"/>
1057    <field name="Unk 17" size="1" start="17" type="bool"/>
1058    <field name="Unk 18" size="1" start="18" type="bool"/>
1059    <field name="Unk 19" size="1" start="19" type="bool"/>
1060    <field name="Unk 20" size="1" start="20" type="bool"/>
1061    <field name="Unk 24" size="1" start="24" type="bool"/>
1062    <field name="Unk 26" size="1" start="26" type="bool"/>
1063    <field name="Returns" size="1" start="27" type="bool"/>
1064    <field name="Block Type" size="3" start="29" type="CDM Block Type" exact="Barrier"/>
1065  </struct>
1066
1067  <struct name="CDM Stream Link" size="8">
1068    <field name="Target hi" size="8" start="0" type="hex"/>
1069    <field name="With return" size="1" start="28" type="bool"/>
1070    <field name="Block Type" size="3" start="29" type="CDM Block Type" exact="Stream Link"/>
1071    <field name="Target lo" size="32" start="32" type="hex"/>
1072  </struct>
1073
1074  <struct name="CDM Stream Terminate" size="8">
1075    <field name="Block Type" size="3" start="29" type="CDM Block Type" exact="Stream Terminate"/>
1076  </struct>
1077
1078  <struct name="CDM Stream Return" size="8">
1079    <field name="Block Type" size="3" start="29" type="CDM Block Type" exact="Stream Return"/>
1080  </struct>
1081  <!-- CDM commands end -->
1082
1083  <!--- The rest of this file is likely software defined by macOS kernel -->
1084  <enum name="IOGPU Attachment Type">
1085    <value name="Colour" value="0xE"/>
1086    <value name="Depth" value="0x10"/>
1087    <value name="Stencil" value="0x11"/>
1088    <value name="Visibility" value="0x12"/>
1089  </enum>
1090
1091  <struct name="IOGPU Attachment" size="24">
1092    <field name="Unk 0" start="0:0" size="16" type="hex"/>
1093    <field name="Address" start="0:16" size="48" type="address"/>
1094    <field name="Type" start="2:16" size="16" type="IOGPU Attachment Type"/>
1095    <field name="Size" start="3:9" size="32" type="uint"/>
1096    <field name="Unk 3" start="4:16" size="4" type="hex"/>
1097    <!-- Percent of total attachment space used for this attachment, expressed
1098         in a decimal percentage [0, 100] <field name="Percent" start="5:16" -->
1099    <field name="Percent" start="5:16" size="16" type="uint"/>
1100  </struct>
1101
1102  <enum name="ZLS Format">
1103    <value name="32F" value="0"/>
1104    <value name="16" value="2"/>
1105  </enum>
1106
1107  <struct name="ZLS Control" size="8">
1108    <field name="Unknown 0" start="0" size="1" type="bool"/>
1109    <field name="Unknown 1" start="1" size="1" type="bool"/>
1110    <field name="Z Compress 1" start="2" size="1" type="bool"/>
1111    <field name="Unknown 3" start="3" size="1" type="bool"/>
1112    <field name="S Compress 1" start="4" size="1" type="bool"/>
1113    <field name="Unknown 5" start="5" size="1" type="bool"/>
1114    <field name="Z Compress 2" start="6" size="1" type="bool"/>
1115    <field name="Unknown 7" start="7" size="1" type="bool"/>
1116    <field name="S Compress 2" start="8" size="1" type="bool"/>
1117    <field name="S Load Enable" start="14" size="1" type="bool"/>
1118    <field name="Z Load Enable" start="15" size="1" type="bool"/>
1119    <field name="S Store Enable" start="18" size="1" type="bool"/>
1120    <field name="Z Store Enable" start="19" size="1" type="bool"/>
1121    <field name="Z Format" start="25" size="2" type="ZLS Format"/>
1122    <field name="Z Resolve" start="56" size="1" type="bool"/>
1123    <field name="S Resolve" start="58" size="1" type="bool"/>
1124  </struct>
1125
1126  <struct name="IOGPU Header" size="64" os="darwin">
1127    <field name="Unk 0" start="0:0" size="32" type="hex"/>
1128    <field name="Total size" start="1:0" size="32" type="uint"/>
1129    <!-- 0x7 in 11.x -->
1130    <field name="Unk 2" start="2:0" size="32" type="hex"/>
1131    <field name="Attachment length" start="9:0" size="32" type="uint"/>
1132    <field name="Attachment offset" start="10:0" size="32" type="uint"/>
1133    <field name="Unknown offset" start="11:0" size="32" type="uint"/>
1134    <field name="Unk 4" start="12:0" size="32" type="hex"/>
1135    <field name="Unk 5" start="13:0" size="32" type="hex"/>
1136    <field name="Encoder" start="14:0" size="64" type="address"/>
1137  </struct>
1138
1139  <struct name="Spill Buffer Histogram" size="60" os="darwin">
1140    <field name="Bin 0" start="0:0" size="4" type="uint"/>
1141    <field name="Bin 1" start="1:0" size="4" type="uint"/>
1142    <field name="Bin 2" start="2:0" size="4" type="uint"/>
1143    <field name="Bin 3" start="3:0" size="4" type="uint"/>
1144    <field name="Bin 4" start="4:0" size="4" type="uint"/>
1145    <field name="Bin 5" start="5:0" size="4" type="uint"/>
1146    <field name="Bin 6" start="6:0" size="4" type="uint"/>
1147    <field name="Bin 7" start="7:0" size="4" type="uint"/>
1148    <field name="Bin 8" start="8:0" size="4" type="uint"/>
1149    <field name="Bin 9" start="9:0" size="4" type="uint"/>
1150    <field name="Bin 10" start="10:0" size="4" type="uint"/>
1151    <field name="Bin 11" start="11:0" size="4" type="uint"/>
1152    <field name="Bin 12" start="12:0" size="4" type="uint"/>
1153    <field name="Bin 13" start="13:0" size="4" type="uint"/>
1154    <field name="Bin 14" start="14:0" size="4" type="uint"/>
1155  </struct>
1156
1157  <struct name="IOGPU Compute" size="384" os="darwin">
1158    <field name="Deflake 1" start="20:0" size="64" type="address"/>
1159    <field name="Terminate of encoder" start="22:0" size="64" type="address"/>
1160    <field name="Deflake 2" start="26:0" size="64" type="address"/>
1161    <field name="Deflake 3" start="28:0" size="64" type="address"/>
1162    <field name="Deflake 4" start="30:0" size="64" type="address"/>
1163    <field name="Deflake 5" start="32:0" size="64" type="address"/>
1164    <field name="Unk 34" start="34:0" size="32" type="hex"/>
1165    <field name="Unk address" start="36:0" size="64" type="address"/>
1166    <field name="Unk 40" start="40:0" size="32" type="hex"/>
1167    <field name="Encoder ID" start="41:0" size="32" type="hex"/>
1168    <field name="Unk 44" start="44:0" size="32" type="hex"/>
1169    <field name="Context switch program" start="48:0" size="32" type="address"/>
1170
1171    <!-- An enum that's purely macOS defined UAPI. Doesn't matter for us.
1172    More info at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062#note_1754715 -->
1173    <field name="Context switch block size" start="56:0" size="4" type="hex"/>
1174    <field name="Spilling unk 1" start="57:3" size="1" type="bool"/>
1175    <!-- Depends on grid size, as well as other factors. TODO: Decode. -->
1176    <field name="Number of context switch buffers" start="58:0" size="32" type="uint"/>
1177    <field name="Spill Buffer Histogram" start="60:0" size="480" type="Spill Buffer Histogram"/>
1178    <!-- Lina's guess at the meaning -->
1179    <field name="Enable context switching" start="75:16" size="1" type="bool"/>
1180    <field name="Unk 94" start="94:0" size="32" type="hex"/>
1181    <field name="Unk 95" start="95:0" size="32" type="hex"/>
1182  </struct>
1183
1184  <struct name="IOGPU Graphics" size="1920" os="darwin">
1185    <!-- if either deflake address is null, rendering gets flaky for high
1186         geometry counts -->
1187    <field name="Deflake 1" start="22:0" size="64" type="address"/>
1188    <field name="Deflake 2" start="24:0" size="64" type="address"/>
1189    <field name="Unk 54" start="38:0" size="32" type="hex"/>
1190    <field name="Unk 55" start="39:0" size="32" type="hex"/>
1191    <field name="Unk 56" start="40:0" size="32" type="hex"/>
1192    <field name="Deflake 3" start="94:0" size="64" type="address"/>
1193    <field name="Unk 112" start="96:0" size="32" type="hex"/>
1194    <field name="Unk 114" start="98:0" size="32" type="hex"/>
1195    <field name="Memoryless render targets used" start="100:0" size="1" type="bool"/>
1196    <field name="OpenGL depth clipping" start="100:24" size="1" type="bool"/>
1197    <field name="Unk 118" start="102:0" size="32" type="hex"/>
1198    <field name="Unk 119" start="103:0" size="32" type="hex"/>
1199    <field name="Unk 120" start="104:0" size="32" type="hex"/>
1200
1201    <field name="Clear pipeline bind" start="146:0" size="32" type="hex"/>
1202    <field name="Clear pipeline unk" start="148:0" size="4" type="hex"/>
1203    <field name="Clear pipeline" start="148:4" size="28" type="address" modifier="shr(4)"/>
1204    <field name="Store pipeline bind" start="154:0" size="32" type="hex"/>
1205    <field name="Store pipeline unk" start="156:0" size="4" type="hex"/>
1206    <field name="Store pipeline" start="156:4" size="28" type="address" modifier="shr(4)"/>
1207    <field name="Scissor array" start="158:0" size="64" type="address"/>
1208    <field name="Depth bias array" start="160:0" size="64" type="address"/>
1209    <field name="ZLS control" start="164:0" size="32" type="ZLS Control"/>
1210    <field name="Depth width" start="170:0" size="15" type="uint" modifier="minus(1)"/>
1211    <field name="Depth height" start="170:15" size="15" type="uint" modifier="minus(1)"/>
1212    <field name="Depth buffer 1" start="172:7" size="33" type="address" modifier="shr(7)"/>
1213    <!-- Normally 0, 0x38001 with layered -->
1214    <field name="Depth unknown 1" start="176:0" size="32" type="hex"/>
1215    <field name="Depth acceleration buffer 1" start="178:7" size="33" type="address" modifier="shr(7)"/>
1216    <field name="Depth buffer 2" start="182:7" size="33" type="address" modifier="shr(7)"/>
1217    <field name="Depth acceleration buffer 2" start="188:7" size="33" type="address" modifier="shr(7)"/>
1218    <!-- Normally 0, 0x38001 with layered -->
1219    <field name="Depth unknown 2" start="186:0" size="32" type="hex"/>
1220    <field name="Stencil buffer 1" start="192:7" size="33" type="address" modifier="shr(7)"/>
1221    <!-- Normally 0, 0x10001 with layered -->
1222    <field name="Stencil unknown 1" start="196:0" size="32" type="hex"/>
1223    <field name="Stencil acceleration buffer 1" start="198:7" size="33" type="address" modifier="shr(7)"/>
1224    <field name="Stencil buffer 2" start="202:7" size="33" type="address" modifier="shr(7)"/>
1225    <!-- Normally 0, 0x10001 with layered -->
1226    <field name="Stencil unknown 2" start="206:0" size="32" type="hex"/>
1227    <field name="Stencil acceleration buffer 2" start="208:7" size="33" type="address" modifier="shr(7)"/>
1228    <!-- Proportional to tile width * tile height * sample count -->
1229    <field name="Unk 212" start="212:0" size="32" type="hex"/>
1230    <field name="Unk 214" start="214:0" size="16" type="hex"/>
1231    <field name="Z16 Unorm attachment 1" start="214:18" size="1" type="bool"/>
1232    <field name="Width 1" start="216:0" size="32" type="uint"/>
1233    <field name="Height 1" start="217:0" size="32" type="uint"/>
1234    <field name="Pointer" start="218:0" size="64" type="address"/>
1235
1236    <!-- 0x40 with frag spilling -->
1237    <field name="Spilling unk 1" start="226:0" size="32" type="hex"/>
1238    <field name="Spill Buffer Histogram" start="238:0" size="480" type="Spill Buffer Histogram"/>
1239
1240    <!-- Encoded like the depth attachment -->
1241    <field name="Depth clear value" start="276:0" size="32" type="hex"/>
1242    <field name="Stencil clear value" start="277:0" size="8" type="uint"/>
1243    <field name="Unk 277" start="277:8" size="8" type="hex"/>
1244    <field name="Set when reloading Z or S 1" start="279:8" size="1" type="bool"/>
1245    <field name="Set when frag shader spills" start="279:24" size="1" type="bool"/>
1246    <field name="Set when reloading Z or S 2" start="280:24" size="1" type="bool"/>
1247    <field name="Z16 Unorm attachment 2" start="281:8" size="1" type="bool"/>
1248    <field name="Unk 282" start="282:0" size="32" type="hex"/>
1249    <field name="Unk 283" start="283:0" size="32" type="hex"/>
1250    <field name="Unk 284" start="284:0" size="32" type="hex"/>
1251    <field name="Visibility result buffer" start="286:0" size="64" type="address"/>
1252    <field name="Partial reload pipeline bind" start="296:0" size="32" type="hex"/>
1253    <field name="Partial reload pipeline unk" start="298:0" size="4" type="hex"/>
1254    <field name="Partial reload pipeline" start="298:4" size="28" type="address" modifier="shr(4)"/>
1255    <field name="Partial store pipeline bind" start="304:0" size="32" type="hex"/>
1256    <field name="Partial store pipeline unk" start="306:0" size="4" type="hex"/>
1257    <field name="Partial store pipeline" start="306:4" size="28" type="address" modifier="shr(4)"/>
1258
1259    <!-- New in 12.x -->
1260    <field name="Depth buffer 3" start="340:0" size="64" type="address"/>
1261    <field name="Depth acceleration buffer 3" start="342:0" size="64" type="address"/>
1262    <field name="Stencil buffer 3" start="344:0" size="64" type="address"/>
1263    <field name="Stencil acceleration buffer 3" start="346:0" size="64" type="address"/>
1264    <!-- maybe only set when doing a depth clear? -->
1265    <!-- 0x1000000 bit set with memoryless render targets? -->
1266    <field name="Unk 352" start="352:0" size="32" type="hex"/>
1267    <field name="Unk 360" start="360:0" size="32" type="hex"/>
1268    <field name="Encoder ID" start="362:0" size="32" type="hex"/>
1269    <!-- top bit maybe only set with a depth clear? -->
1270    <field name="Unk 365" start="365:0" size="64" type="hex"/>
1271    <field name="Unknown buffer" start="370:0" size="64" type="address"/>
1272    <field name="Width 2" start="382:0" size="32" type="uint"/>
1273    <field name="Height 2" start="383:0" size="32" type="uint"/>
1274    <field name="Sample count" start="384:0" size="32" type="uint"/>
1275
1276    <!-- Divided by 16 and rounded -->
1277    <field name="Sample 0 X" start="385:0" size="5" type="uint"/>
1278    <field name="Sample 0 Y" start="386:0" size="5" type="uint"/>
1279    <field name="Sample 1 X" start="387:0" size="5" type="uint"/>
1280    <field name="Sample 1 Y" start="388:0" size="5" type="uint"/>
1281    <field name="Sample 2 X" start="389:0" size="5" type="uint"/>
1282    <field name="Sample 2 Y" start="390:0" size="5" type="uint"/>
1283    <field name="Sample 3 X" start="391:0" size="5" type="uint"/>
1284    <field name="Sample 3 Y" start="392:0" size="5" type="uint"/>
1285
1286    <!-- if tile size 32x32: max(tib allocation, 8) rounded to POT
1287         if tile size 32x16: that, halved
1288         -->
1289    <field name="Unk 49:0" start="401:0" size="32" type="uint"/>
1290    <field name="Tile width" start="402:0" size="32" type="uint"/>
1291    <field name="Tile height" start="403:0" size="32" type="uint"/>
1292    <!-- Number of framebuffer layers when rendering to a layered framebuffer (1
1293        otherwise). This affects tiling calculations. It also affects how many
1294    times the background program and end-of-tile programs are executed. The
1295    layer index is available in sr2. -->
1296    <field name="Framebuffer layers" start="404:0" size="32" type="uint"/>
1297    <field name="Unk 56:0" start="408:0" size="32" type="uint"/>
1298    <field name="Unk 70:0" start="410:0" size="32" type="uint"/>
1299  </struct>
1300
1301  <struct name="IOGPU Attachment Count" size="16" os="darwin">
1302    <field name="Count" start="3:0" size="32" type="uint"/>
1303  </struct>
1304
1305</genxml>
1306