blob: 0b07f3a6ae185499f71d963c83e84f7573d38881 [file] [log] [blame]
<?xml version="1.0" ?>
<genxml>
<enum name="Channel">
<value name="R" value="0"/>
<value name="G" value="1"/>
<value name="B" value="2"/>
<value name="A" value="3"/>
<value name="1" value="4"/>
<value name="0" value="5"/>
</enum>
<enum name="ZS Func">
<value name="Never" value="0"/>
<value name="Less" value="1"/>
<value name="Equal" value="2"/>
<value name="Lequal" value="3"/>
<value name="Greater" value="4"/>
<value name="Not Equal" value="5"/>
<value name="Gequal" value="6"/>
<value name="Always" value="7"/>
</enum>
<enum name="Compare func">
<value name="Lequal" value="0"/>
<value name="Gequal" value="1"/>
<value name="Less" value="2"/>
<value name="Greater" value="3"/>
<value name="Equal" value="4"/>
<value name="Not Equal" value="5"/>
<value name="Always" value="6"/>
<value name="Never" value="7"/>
</enum>
<enum name="Stencil Op">
<value name="Keep" value="0"/>
<value name="Zero" value="1"/>
<value name="Replace" value="2"/>
<value name="Incr Sat" value="3"/>
<value name="Decr Sat" value="4"/>
<value name="Invert" value="5"/>
<value name="Incr Wrap" value="6"/>
<value name="Decr Wrap" value="7"/>
</enum>
<enum name="Visibility Mode">
<value name="None" value="0"/>
<value name="Counting" value="2"/>
<value name="Boolean" value="3"/>
</enum>
<enum name="Polygon Mode">
<value name="Fill" value="0"/>
<value name="Line" value="1"/>
<value name="Point" value="2"/>
</enum>
<enum name="Primitive">
<value name="Points" value="0"/>
<value name="Lines" value="1"/>
<value name="Line strip" value="3"/>
<value name="Line loop" value="5"/>
<value name="Triangles" value="6"/>
<value name="Triangle strip" value="9"/>
<value name="Triangle fan" value="10"/>
<value name="Quads" value="14"/> <!-- guess, confirm with piglit later XXX -->
<value name="Quad strip" value="15"/> <!-- guess, confirm with piglit later XXX -->
</enum>
<enum name="Object Type">
<value name="Triangle" value="0"/>
<value name="Line" value="1"/>
<value name="Point sprite UV=10" value="2"/>
<value name="Point sprite UV=01" value="4"/>
</enum>
<enum name="Layout">
<value name="Linear" value="0"/>
<!-- Default layout if no other layout is set -->
<value name="Null" value="1"/>
<!-- Morton order -->
<value name="Twiddled" value="2"/>
<!-- With a metadata buffer -->
<value name="Compressed" value="3"/>
</enum>
<enum name="Channels">
<value name="R8" value="0x00"/>
<value name="R16" value="0x09"/>
<value name="R8G8" value="0x0A"/>
<value name="R5G6B5" value="0x0B"/>
<value name="R4G4B4A4" value="0x0C"/>
<value name="A1R5G5B5" value="0x0D"/>
<value name="R5G5B5A1" value="0x0E"/>
<value name="R32" value="0x21"/>
<value name="R16G16" value="0x23"/>
<value name="R11G11B10" value="0x25"/>
<value name="R10G10B10A2" value="0x26"/>
<value name="R9G9B9E5" value="0x27"/>
<value name="R8G8B8A8" value="0x28"/>
<value name="R32G32" value="0x31"/>
<value name="R16G16B16A16" value="0x32"/>
<value name="R32G32B32A32" value="0x38"/>
<value name="GBGR 422" value="0x40"/> <!-- Subsampled, swizzle BRG1 -->
<value name="BGRG 422" value="0x41"/> <!-- Subsampled, swizzle BRG1 -->
<!-- Compressed -->
<value name="PVRTC 2bpp" value="0x50"/>
<value name="PVRTC 4bpp" value="0x51"/>
<value name="ETC2 RGB8" value="0x58"/>
<value name="ETC2 RGBA8" value="0x59"/>
<value name="ETC2 RGB8A1" value="0x5A"/>
<value name="EAC R11" value="0x5B"/>
<value name="EAC RG11" value="0x5C"/>
<!-- For LDR use with UNORM/no-sRGB, for sRGB use with UNORM/sRGB, for HDR
use with FLOAT/no-sRGB -->
<value name="ASTC 4x4" value="0x60"/>
<value name="ASTC 5x4" value="0x61"/>
<value name="ASTC 5x5" value="0x62"/>
<value name="ASTC 6x5" value="0x63"/>
<value name="ASTC 6x6" value="0x64"/>
<value name="ASTC 8x5" value="0x65"/>
<value name="ASTC 8x6" value="0x66"/>
<value name="ASTC 8x8" value="0x67"/>
<value name="ASTC 10x5" value="0x68"/>
<value name="ASTC 10x6" value="0x69"/>
<value name="ASTC 10x8" value="0x6A"/>
<value name="ASTC 10x10" value="0x6B"/>
<value name="ASTC 12x10" value="0x6C"/>
<value name="ASTC 12x12" value="0x6D"/>
<value name="BC1" value="0x74"/>
<value name="BC2" value="0x75"/>
<value name="BC3" value="0x76"/>
<value name="BC4" value="0x77"/>
<value name="BC5" value="0x78"/>
<value name="BC6H" value="0x79"/>
<value name="BC6H Ufloat" value="0x7A"/>
<value name="BC7" value="0x7B"/>
</enum>
<enum name="Texture Type">
<value name="Unorm" value="0"/>
<value name="Snorm" value="1"/>
<value name="Uint" value="2"/>
<value name="Sint" value="3"/>
<value name="Float" value="4"/>
<value name="XR" value="5"/>
</enum>
<struct name="CF binding header" size="4">
<field name="Number of 32-bit slots" size="8" start="0:0" type="uint"/>
<field name="Number of coefficient registers" size="8" start="0:8" type="uint"/>
</struct>
<enum name="Shade model">
<value name="Flat vertex 0" value="0"/>
<value name="Flat vertex 2" value="2"/>
<value name="Gouraud" value="3"/>
</enum>
<struct name="CF binding" size="4">
<field name="Components" size="2" start="0" type="uint" modifier="minus(1)"/>
<field name="Shade model" size="2" start="2" type="Shade model"/>
<field name="Perspective" size="1" start="4" type="bool"/>
<field name="Fragcoord Z" size="1" start="5" type="bool"/>
<field name="Point sprite" size="1" start="6" type="bool"/>
<field name="Base slot" size="8" start="8" type="uint"/>
<field name="Base coefficient register" size="8" start="16" type="uint"/>
</struct>
<struct name="Render Target" size="24">
<field name="Unknown" size="4" start="0" type="hex" default="0x2"/>
<field name="Layout" size="2" start="4" type="Layout"/>
<field name="Channels" size="7" start="6" type="Channels"/>
<field name="Type" size="3" start="13" type="Texture Type"/>
<field name="Swizzle R" size="2" start="16" type="Channel"/>
<field name="Swizzle G" size="2" start="18" type="Channel"/>
<field name="Swizzle B" size="2" start="20" type="Channel"/>
<field name="Swizzle A" size="2" start="22" type="Channel"/>
<field name="Width" size="14" start="24" type="uint" modifier="minus(1)"/>
<field name="Height" size="14" start="38" type="uint" modifier="minus(1)"/>
<field name="Unk 52" size="1" start="52" type="bool"/>
<field name="Rotate 90" size="1" start="53" type="bool" default="false"/>
<field name="Flip vertical" size="1" start="54" type="bool" default="false"/>
<!-- not 1c0, tried setting . setting 0x20/0x10/0x8 breaks render. not
0x4/0x2. 0x1 distorts in a funny way, renders upside-down with jitter
around the edges (like it's doing a 2x2 tiling or something).
When enabling mipmapping, Metal sets 0x8 and sets stride to 0x100009 -->
<field name="Unk 55" size="9" start="55" type="hex" default="0x00"/>
<field name="Buffer" size="36" start="64" type="address" modifier="shr(4)"/>
<!-- N.b. sRGB is not specified here -->
<field name="Level" size="4" start="100" type="uint"/>
<!-- If layout is not linear -->
<field name="Levels" size="6" start="104" type="uint" modifier="minus(1)"/>
<field name="Unk tiled" size="1" start="124" type="bool"/>
<!-- If layout is linear. Off by 4? -->
<field name="Stride" size="24" start="104" type="hex"/>
<!-- If layout is compressed -->
<field name="Acceleration buffer" size="64" start="128" type="address"/>
</struct>
<enum name="Texture dimension">
<value name="1D" value="0"/>
<value name="1D Array" value="1"/>
<value name="2D" value="2"/>
<value name="2D Array" value="3"/>
<value name="2D Multisampled" value="4"/>
<value name="3D" value="5"/>
<value name="Cube" value="6"/>
<value name="Cube Array" value="7"/>
<value name="2D Array Multisampled" value="8"/>
</enum>
<enum name="Sample Count">
<value name="2" value="0"/>
<value name="4" value="1"/>
</enum>
<struct name="Texture" size="24">
<field name="Dimension" size="4" start="0" type="Texture dimension" default="2D"/>
<field name="Layout" size="2" start="4" type="Layout"/>
<field name="Channels" size="7" start="6" type="Channels"/>
<field name="Type" size="3" start="13" type="Texture Type"/>
<field name="Swizzle R" size="3" start="16" type="Channel" default="R"/>
<field name="Swizzle G" size="3" start="19" type="Channel" default="G"/>
<field name="Swizzle B" size="3" start="22" type="Channel" default="B"/>
<field name="Swizzle A" size="3" start="25" type="Channel" default="A"/>
<field name="Width" size="14" start="28" type="uint" modifier="minus(1)"/>
<field name="Height" size="14" start="42" type="uint" modifier="minus(1)"/>
<field name="First level" size="4" start="56" type="uint"/>
<field name="Last level" size="4" start="60" type="uint"/>
<field name="Samples" size="1" start="64" type="Sample Count"/>
<field name="Address" size="36" start="66" type="hex" modifier="shr(4)"/>
<!-- Unknown bit set by Metal when mipmapping. Might relate to a mechanism
to switch tile size (or disable tiling altogether?) at small mip levels to
reduce wasted memory due to padding. Causing test flakiness when set. -->
<field name="Unk mipmapped" size="1" start="102" type="bool"/>
<!-- This is set when no texture is bound, with layout 1 -->
<field name="Null" size="1" start="105" type="bool"/>
<field name="Compression" size="2" start="106" type="hex"/> <!-- 0 for uncompressed -->
<field name="sRGB" size="1" start="108" type="bool"/>
<field name="sRGB 2-channel" size="1" start="109" type="bool"/>
<field name="Stride" size="18" start="110" type="hex" modifier="shr(4)"/>
<!-- Note that 3D/arrays cannot be linear. -->
<field name="Depth" size="14" start="110" type="uint" modifier="minus(1)" default="1"/>
<field name="Unk tiled" size="1" start="126" type="bool"/>
</struct>
<enum name="Wrap">
<value name="Clamp to edge" value="0"/>
<value name="Repeat" value="1"/>
<value name="Mirrored repeat" value="2"/>
<value name="Clamp to border" value="3"/>
</enum>
<enum name="Mip filter">
<value name="None" value="0"/>
<value name="Nearest" value="1"/>
<value name="Linear" value="2"/>
</enum>
<enum name="Border colour">
<value name="Transparent black" value="0"/>
<value name="Opaque black" value="1"/>
<value name="Opaque white" value="2"/>
</enum>
<struct name="Sampler" size="8">
<field name="Minimum LOD" size="10" start="0" type="lod" default="0.0"/>
<field name="Maximum LOD" size="10" start="10" type="lod" default="INFINITY"/>
<field name="Magnify linear" size="1" start="23" type="bool"/>
<field name="Minify linear" size="1" start="25" type="bool"/>
<field name="Mip filter" size="2" start="27" type="Mip filter"/>
<field name="Wrap S" size="3" start="29" type="Wrap"/>
<field name="Wrap T" size="3" start="32" type="Wrap"/>
<field name="Wrap R" size="3" start="35" type="Wrap"/>
<field name="Pixel coordinates" size="1" start="38" type="bool"/>
<field name="Compare func" size="3" start="39" type="Compare func"/>
<field name="Unk 3" size="1" start="42" type="hex" default="1"/>
<field name="Border colour" size="2" start="55" type="Border colour"/>
</struct>
<!--- Pointed to from the command buffer -->
<struct name="Scissor" size="16">
<field name="Max X" size="16" start="0:0" type="uint"/>
<field name="Min X" size="16" start="0:16" type="uint"/>
<field name="Max Y" size="16" start="1:0" type="uint"/>
<field name="Min Y" size="16" start="1:16" type="uint"/>
<field name="Min Z" size="32" start="2:0" type="float"/>
<field name="Max Z" size="32" start="3:0" type="float"/>
</struct>
<!-- Note: this structure is not padded. It really is 12 bytes -->
<struct name="Depth bias" size="12">
<field name="Depth bias" size="32" start="0:0" type="float"/>
<field name="Slope scale" size="32" start="1:0" type="float"/>
<field name="Clamp" size="32" start="2:0" type="float"/>
</struct>
<!-- PPP state starts -->
<struct name="PPP Header" size="4">
<field name="Fragment control" size="1" start="0" type="bool"/>
<field name="Fragment control 2" size="1" start="1" type="bool"/>
<field name="Fragment front face" size="1" start="2" type="bool"/>
<field name="Fragment front face 2" size="1" start="3" type="bool"/>
<field name="Fragment front stencil" size="1" start="4" type="bool"/>
<field name="Fragment back face" size="1" start="5" type="bool"/>
<field name="Fragment back face 2" size="1" start="6" type="bool"/>
<field name="Fragment back stencil" size="1" start="7" type="bool"/>
<field name="Depth bias/scissor" size="1" start="8" type="bool"/>
<field name="Region clip" size="1" start="10" type="bool"/>
<field name="Viewport" size="1" start="11" type="bool"/>
<field name="W clamp" size="1" start="16" type="bool"/>
<field name="Output select" size="1" start="17" type="bool"/>
<field name="Varying word 0" size="1" start="18" type="bool"/>
<field name="Varying word 1" size="1" start="19" type="bool"/>
<field name="Cull" size="1" start="21" type="bool"/>
<field name="Cull 2" size="1" start="22" type="bool"/>
<field name="Fragment shader" size="1" start="23" type="bool"/>
<field name="Occlusion query" size="1" start="24" type="bool"/>
<field name="Occlusion query 2" size="1" start="25" type="bool"/>
<field name="Output unknown" size="1" start="26" type="bool"/>
<field name="Output size" size="1" start="27" type="bool"/>
<field name="Varying word 2" size="1" start="28" type="bool"/>
</struct>
<!-- Acts like a scissor at 32x32 tile boundaries, ignored unless clip tile is set -->
<struct name="Region clip" size="12">
<field name="Max X" size="9" start="0" type="uint" modifier="minus(1)"/>
<field name="Min X" size="9" start="16" type="uint"/>
<field name="Enable" size="1" start="31" type="bool"/>
<field name="Max Y" size="9" start="32" type="uint" modifier="minus(1)"/>
<field name="Min Y" size="9" start="48" type="uint"/>
</struct>
<!-- Used to convert clip space coordinates to NDC, does not clip -->
<struct name="Viewport" size="24">
<field name="Translate X" size="32" start="0:0" type="float"/>
<field name="Scale X" size="32" start="1:0" type="float"/>
<field name="Translate Y" size="32" start="2:0" type="float"/>
<field name="Scale Y" size="32" start="3:0" type="float"/>
<field name="Translate Z" size="32" start="4:0" type="float"/>
<field name="Scale Z" size="32" start="5:0" type="float"/>
</struct>
<struct name="Fragment face" size="4">
<field name="Stencil reference" size="8" start="0" type="hex"/>
<!-- line width is 4:4 fixed point with off-by-one applied -->
<field name="Line width" size="8" start="8" type="hex"/>
<field name="Polygon mode" size="2" start="18" type="Polygon Mode"/>
<field name="Disable depth write" size="1" start="21" type="bool"/>
<field name="Unk - visibility test internal" size="2" start="22" type="hex"/>
<field name="Depth function" size="3" start="24" type="ZS Func"/>
</struct>
<struct name="Fragment face 2" size="4">
<field name="Unknown" size="8" start="20" type="hex" default="0x7e"/>
<field name="Object type" size="4" start="28" type="Object Type"/>
</struct>
<struct name="Fragment stencil" size="4">
<field name="Write mask" size="8" start="0" type="hex"/>
<field name="Read mask" size="8" start="8" type="hex"/>
<field name="Depth pass" size="3" start="16" type="Stencil Op"/>
<field name="Depth fail" size="3" start="19" type="Stencil Op"/>
<field name="Stencil fail" size="3" start="22" type="Stencil Op"/>
<field name="Compare" size="3" start="25" type="ZS Func"/>
</struct>
<struct name="Fragment control" size="4">
<field name="Unk 1" size="1" start="9" type="hex" default="0x1"/>
<field name="Visibility mode" size="2" start="14" type="Visibility Mode"/>
<field name="Scissor enable" size="1" start="16" type="bool"/>
<field name="Depth bias enable" size="1" start="17" type="bool"/>
<field name="Stencil test enable" size="1" start="18" type="bool"/>
<field name="Two-sided stencil" size="1" start="19" type="bool"/>
<field name="Unk fill lines" size="1" start="26" type="hex" default="0x0"/> <!-- set when drawing LINES -->
</struct>
<struct name="Fragment control 2" size="4">
<field name="Unk 1" size="1" start="9" type="bool" default="true"/>
<!-- Or discards? -->
<field name="No colour output" size="1" start="21" type="bool"/>
<field name="Lines or points" size="1" start="26" type="bool"/>
<field name="Reads tilebuffer" size="1" start="29" type="bool"/>
<field name="Sample mask from shader" size="1" start="30" type="bool"/>
</struct>
<struct name="Fragment occlusion query" size="4">
<field name="Offset" size="18" start="14" type="uint"/>
</struct>
<struct name="Fragment occlusion query 2" size="4">
<field name="Unknown" size="17" start="0" type="hex"/>
</struct>
<struct name="W Clamp" size="4">
<field name="W Clamp" size="32" start="0" type="float"/>
</struct>
<struct name="Cull" size="4">
<field name="Cull front" size="1" start="0" type="bool"/>
<field name="Cull back" size="1" start="1" type="bool"/>
<field name="Unk GL 1" size="1" start="7" type="bool"/>
<field name="Unk GL 2" size="1" start="8" type="bool"/>
<field name="Depth clip" size="1" start="10" type="bool"/>
<field name="Depth clamp" size="1" start="11" type="bool"/>
<field name="Front face CCW" size="1" start="16" type="bool"/>
</struct>
<struct name="Cull 2" size="4">
<field name="Unknown 2" size="32" start="0" type="hex" default="0xa0"/>
</struct>
<struct name="Varying 0" size="4">
<field name="Count" size="32" start="0" type="uint"/>
</struct>
<struct name="Varying 1" size="4">
<!-- TODO -->
</struct>
<struct name="Varying 2" size="8">
<!-- TODO -->
</struct>
<struct name="Output Select" size="4">
<field name="Varyings" size="1" start="16" type="bool"/>
<field name="Point size" size="1" start="18" type="bool"/>
<field name="Frag coord Z" size="1" start="21" type="bool"/>
</struct>
<struct name="Output Unknown" size="4">
<!-- So far always zero -->
</struct>
<struct name="Output Size" size="4">
<field name="Count" size="32" start="0" type="uint"/>
</struct>
<!-- Indexes into the scissor and depth bias arrays -->
<struct name="Depth bias/Scissor" size="4">
<field name="Scissor" size="16" start="0" type="uint"/>
<field name="Depth bias" size="16" start="16" type="uint"/>
</struct>
<struct name="Fragment shader" size="16">
<field name="Unknown 0" size="1" start="0" type="hex" default="0"/>
<field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
<field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
<field name="Sampler state register count" size="3" start="9" type="uint" modifier="groups(4)"/>
<field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
<field name="CF binding count" size="7" start="16" type="uint"/>
<field name="Unknown 1:0" size="2" start="1:0" type="hex"/>
<field name="Pipeline" size="26" start="1:6" type="address" modifier="shr(6)"/>
<field name="CF bindings" size="30" start="2:2" type="address" modifier="shr(2)"/>
<!-- Seems to be set to small values depending on textures? and pushed
uniforms? Needs investigation -->
<field name="Unknown 3:0" start="3:0" size="4" type="hex"/>
</struct>
<!-- PPP state ends -->
<!-- USC state starts -->
<enum name="USC Control">
<value name="Preshader" value="0x38"/>
<value name="Fragment properties" value="0x58"/>
<value name="No preshader" value="0x88"/>
<value name="Shader" value="0x0d"/>
<value name="Uniform" value="0x1d"/>
<value name="Uniform high" value="0x3d"/>
<value name="Shared" value="0x4d"/>
<value name="Registers" value="0x8d"/>
<value name="Sampler" value="0x9d"/>
<value name="Texture" value="0xdd"/>
</enum>
<struct name="USC Uniform" size="8">
<field name="Tag" size="8" start="0:0" type="USC Control" default="Uniform"/>
<field name="Start (halfs)" size="8" start="0:8" type="uint"/>
<!-- Exact split is unknown. -->
<field name="Size (halfs)" size="7" start="0:20" type="uint"/>
<field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
</struct>
<struct name="USC Uniform High" size="8">
<field name="Tag" size="8" start="0:0" type="USC Control" default="Uniform High"/>
<field name="Start (halfs)" size="8" start="0:8" type="uint"/>
<!-- Exact split is unknown. -->
<field name="Size (halfs)" size="7" start="0:20" type="uint"/>
<field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
</struct>
<struct name="USC Texture" size="8">
<field name="Tag" size="8" start="0:0" type="USC Control" default="Texture"/>
<field name="Start" size="8" start="0:8" type="uint"/>
<!-- Exact split is unknown. Count is at least 5 bits. Less than 8 bits. -->
<field name="Count" size="7" start="0:20" type="uint"/>
<field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
</struct>
<struct name="USC Sampler" size="8">
<field name="Tag" size="8" start="0:0" type="USC Control" default="Sampler"/>
<field name="Start" size="8" start="0:8" type="uint"/>
<field name="Count" size="7" start="0:20" type="uint"/>
<!-- Exact split is unknown. -->
<field name="Buffer" size="36" start="0:27" type="address" modifier="shr(3)"/>
</struct>
<enum name="Shared layout">
<value name="Vertex/compute" value="0x24"/>
<value name="32x32" value="0x2f"/>
<value name="32x16" value="0x3f"/>
<value name="16x16" value="0x36"/>
</enum>
<struct name="USC Shared" size="4">
<field name="Tag" size="8" start="0" type="USC Control" default="Shared"/>
<field name="Uses shared memory" size="1" start="8" type="bool"/>
<field name="Shared layout" size="6" start="10" type="Shared layout"/>
<field name="Pixel stride in 8 bytes" size="4" start="20" type="uint"/>
<field name="Shared memory per threadgroup in 256 bytes" size="8" start="24" type="uint"/>
</struct>
<struct name="USC Shader" size="6">
<field name="Tag" size="8" start="0" type="USC Control" default="Shader"/>
<field name="Loads varyings" size="1" start="8" type="bool"/>
<field name="Unk 1" size="1" start="9" type="bool" default="0"/>
<field name="Unk 2" size="6" start="10" type="uint" default="3"/>
<field name="Code" size="32" start="16" type="address"/>
</struct>
<struct name="USC Registers" size="4">
<field name="Tag" size="8" start="0" type="USC Control" default="Registers"/>
<field name="Register count" size="5" start="8" type="uint" modifier="groups(8)"/>
<field name="Unk 1" size="1" start="13" type="bool" default="false"/>
<field name="Spill size" size="8" start="16" type="hex" default="0"/> <!-- TODO: determine relation, see docs/table.py -->
<field name="Unk 4" size="8" start="24" type="hex" default="0x1"/>
</struct>
<struct name="USC No Preshader" size="2">
<field name="Tag" size="8" start="0" type="USC Control" default="No preshader"/>
</struct>
<struct name="USC Preshader" size="8">
<field name="Tag" size="8" start="0" type="USC Control" default="Preshader"/>
<field name="Unk" size="24" start="8" type="hex" default="0xc08000"/>
<field name="Code" size="32" start="32" type="address"/>
</struct>
<struct name="USC Fragment Properties" size="4">
<field name="Tag" size="8" start="0" type="USC Control" default="Fragment properties"/>
<!-- Guess. Set if the shader does not write the sample mask (including by
discard_fragment) -->
<field name="Early-z testing" size="1" start="8" type="bool"/>
<field name="Unk 2" size="1" start="9" type="bool" default="true"/>
<field name="Unconditional discard 1" size="1" start="10" type="bool"/>
<field name="Unconditional discard 2" size="1" start="11" type="bool"/>
<field name="Unk 3" size="4" start="12" type="hex" default="0xf"/>
<field name="Unk 4" size="8" start="16" type="hex" default="0"/> <!-- TODO: determine relation, see docs/table.py -->
<field name="Unk 5" size="8" start="24" type="hex" default="0x01"/>
</struct>
<!-- USC commands end -->
<!-- VDM commands start. VDM commands are padded out to 8b alignment. -->
<enum name="VDM Block Type">
<value name="PPP State Update" value="0"/>
<value name="VDM State Update" value="2"/>
<value name="Index List" value="3"/>
<value name="Stream Link" value="4"/>
<value name="Stream terminate" value="6"/>
</enum>
<struct name="PPP State" size="8">
<field name="Pointer (hi)" size="8" start="0" type="hex"/>
<field name="Size (words)" size="8" start="8" type="uint"/>
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="PPP State Update"/>
<field name="Pointer (lo)" size="32" start="32" type="address"/>
</struct>
<enum name="Index size">
<value name="U8" value="0"/>
<value name="U16" value="1"/>
<value name="U32" value="2"/>
</enum>
<struct name="VDM State" size="4">
<field name="Restart index present" size="1" start="0" type="bool"/>
<field name="Vertex shader word 0 present" size="1" start="1" type="bool"/>
<field name="Vertex shader word 1 present" size="1" start="2" type="bool"/>
<field name="Vertex outputs present" size="1" start="3" type="bool"/>
<field name="Vertex unknown present" size="1" start="5" type="bool"/>
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="VDM State Update"/>
</struct>
<struct name="VDM State Restart Index" size="4">
<field name="Value" size="32" start="0" type="hex"/>
</struct>
<struct name="VDM State Vertex Shader Word 0" size="4">
<field name="Unknown 0" size="1" start="0" type="hex" default="0"/>
<field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
<field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
<field name="Sampler state register count" size="3" start="9" type="uint" modifier="groups(4)"/>
<field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
</struct>
<struct name="VDM State Vertex Shader Word 1" size="4">
<field name="Pipeline" size="32" start="0" type="address"/>
</struct>
<struct name="VDM State Vertex Outputs" size="4">
<field name="Output count 1" size="8" start="0" type="uint" default="0"/>
<field name="Output count 2" size="8" start="8" type="uint" default="0"/>
</struct>
<struct name="VDM State Vertex Unknown" size="4">
<field name="Unknown" start="0" size="1" type="bool"/>
</struct>
<!--- Command to issue a direct non-indexed draw -->
<struct name="Index List" size="4">
<field name="Index buffer hi" size="8" start="0" type="hex"/>
<field name="Primitive" size="8" start="8" type="Primitive"/>
<!-- Metal sets this bit for strips, probably wrong though -->
<field name="Restart enable" size="1" start="16" type="bool"/>
<field name="Index size" size="3" start="17" type="Index size"/>
<!-- XXX: Might be backwards, not sure how to check that -->
<field name="Index buffer present" size="1" start="20" type="bool"/>
<field name="Index buffer size present" size="1" start="21" type="bool"/>
<!-- XXX: Might be mixed up, not sure how to check that -->
<field name="Index count present" size="1" start="22" type="bool" default="true"/>
<field name="Instance count present" size="1" start="23" type="bool" default="true"/>
<field name="Start present" size="1" start="24" type="bool" default="true"/>
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="Index List"/>
</struct>
<struct name="Index List: Buffer lo" size="4">
<!-- Index buffer lsb -->
<field name="Buffer lo" size="32" start="0" type="hex"/>
</struct>
<struct name="Index List: Count" size="4">
<!-- Vertex count for non-indexed, index count for index count -->
<field name="Count" size="32" start="0" type="uint"/>
</struct>
<struct name="Index List: Instances" size="4">
<field name="Count" size="32" start="0" type="uint"/> <!-- must be nonzero -->
</struct>
<struct name="Index List: Start" size="4">
<!-- Base vertex for indexed draws -->
<field name="Start" size="32" start="0" type="uint"/>
</struct>
<struct name="Index List: Buffer size" size="4">
<field name="Size" size="32" start="0" type="uint" modifier="shr(2)"/>
</struct>
<!-- Conditional branching and function calls may be supported, see the
STREAM_LINK0 struct in mesa/src/imagination/csbgen/rogue_vdm.xml for a
probable dfinition -->
<struct name="VDM Stream Link" size="8">
<field name="Target hi" size="8" start="0" type="hex"/>
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="Stream Link"/>
<field name="Target lo" size="32" start="32" type="hex"/>
</struct>
<struct name="VDM Stream Terminate" size="8">
<field name="Block Type" size="3" start="29" type="VDM Block Type" default="Stream Terminate"/>
</struct>
<!-- VDM commands end -->
<!-- CDM commands start -->
<enum name="CDM Block Type">
<value name="Compute Kernel" value="0"/>
<value name="Stream Link" value="1"/>
<value name="Stream Terminate" value="2"/>
</enum>
<!--- Command to launch a direct compute kernel -->
<struct name="Launch" size="36">
<field name="Uniform register count" size="3" start="1" type="uint" modifier="groups(64)"/>
<field name="Texture state register count" size="5" start="4" type="uint" modifier="groups(8)"/>
<field name="Sampler state register count" size="3" start="9" type="uint" modifier="groups(4)"/>
<field name="Preshader register count" size="4" start="12" type="uint" modifier="groups(16)"/>
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Compute Kernel"/>
<field name="Pipeline" size="32" start="1:0" type="address"/>
<field name="Group count X" size="32" start="2:0" type="uint"/>
<field name="Group count Y" size="32" start="3:0" type="uint"/>
<field name="Group count Z" size="32" start="4:0" type="uint"/>
<field name="Local size X" size="32" start="5:0" type="uint"/>
<field name="Local size Y" size="32" start="6:0" type="uint"/>
<field name="Local size Z" size="32" start="7:0" type="uint"/>
<field name="Unk 2" size="32" start="8:0" type="hex" default="0x60000160"/>
</struct>
<struct name="CDM Stream Link" size="8">
<field name="Target hi" size="8" start="0" type="hex"/>
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Stream Link"/>
<field name="Target lo" size="32" start="32" type="hex"/>
</struct>
<struct name="CDM Stream Terminate" size="8">
<field name="Block Type" size="3" start="29" type="CDM Block Type" default="Stream Terminate"/>
</struct>
<!-- CDM commands end -->
<!--- The rest of this file is likely software defined by macOS kernel -->
<enum name="IOGPU Attachment Type">
<value name="Colour" value="0xE"/>
<value name="Depth" value="0x10"/>
<value name="Stencil" value="0x11"/>
<value name="Visibility" value="0x12"/>
</enum>
<struct name="IOGPU Attachment" size="24">
<field name="Unk 0" start="0:0" size="16" default="0x100" type="hex"/>
<field name="Address" start="0:16" size="48" type="address"/>
<field name="Type" start="2:16" size="16" type="IOGPU Attachment Type"/>
<field name="Size" start="3:9" size="32" type="uint"/>
<field name="Unk 3" start="4:16" size="4" type="hex" default="0xC"/>
<!-- Percent of total attachment space used for this attachment, expressed
in a decimal percentage [0, 100] <field name="Percent" start="5:16" -->
<field name="Percent" start="5:16" size="16" type="uint"/>
</struct>
<enum name="ZLS Format">
<value name="32F" value="0"/>
<value name="16" value="2"/>
</enum>
<struct name="ZLS Control" size="8">
<field name="Unknown 0" start="0" size="1" type="bool"/>
<field name="Unknown 1" start="1" size="1" type="bool"/>
<field name="Unknown 2" start="2" size="1" type="bool"/>
<field name="Unknown 3" start="3" size="1" type="bool"/>
<field name="Unknown 4" start="4" size="1" type="bool"/>
<field name="Unknown 5" start="5" size="1" type="bool"/>
<field name="Unknown 6" start="6" size="1" type="bool"/>
<field name="Unknown 7" start="7" size="1" type="bool"/>
<field name="S Load Enable" start="14" size="1" type="bool"/>
<field name="Z Load Enable" start="15" size="1" type="bool"/>
<field name="S Store Enable" start="18" size="1" type="bool"/>
<field name="Z Store Enable" start="19" size="1" type="bool"/>
<field name="Z Format" start="25" size="2" type="ZLS Format"/>
</struct>
<struct name="IOGPU Header" size="64">
<field name="Unk 0" start="0:0" size="32" default="0x10000" type="hex"/>
<field name="Total size" start="1:0" size="32" type="uint"/>
<!-- 0x7 in 11.x -->
<field name="Unk 2" start="2:0" size="32" default="0x4" type="hex"/>
<field name="Attachment length" start="9:0" size="32" type="uint"/>
<field name="Attachment offset" start="10:0" size="32" type="uint"/>
<field name="Unknown offset" start="11:0" size="32" type="uint"/>
<field name="Unk 4" start="12:0" size="32" default="0x30" type="hex"/>
<field name="Unk 5" start="13:0" size="32" default="0x01" type="hex"/>
<field name="Encoder" start="14:0" size="64" type="address"/>
</struct>
<struct name="Spill Buffer Histogram" size="60">
<field name="Bin 0" start="0:0" size="4" type="uint"/>
<field name="Bin 1" start="1:0" size="4" type="uint"/>
<field name="Bin 2" start="2:0" size="4" type="uint"/>
<field name="Bin 3" start="3:0" size="4" type="uint"/>
<field name="Bin 4" start="4:0" size="4" type="uint"/>
<field name="Bin 5" start="5:0" size="4" type="uint"/>
<field name="Bin 6" start="6:0" size="4" type="uint"/>
<field name="Bin 7" start="7:0" size="4" type="uint"/>
<field name="Bin 8" start="8:0" size="4" type="uint"/>
<field name="Bin 9" start="9:0" size="4" type="uint"/>
<field name="Bin 10" start="10:0" size="4" type="uint"/>
<field name="Bin 11" start="11:0" size="4" type="uint"/>
<field name="Bin 12" start="12:0" size="4" type="uint"/>
<field name="Bin 13" start="13:0" size="4" type="uint"/>
<field name="Bin 14" start="14:0" size="4" type="uint"/>
</struct>
<struct name="IOGPU Compute" size="384">
<field name="Deflake 1" start="20:0" size="64" type="address"/>
<field name="Terminate of encoder" start="22:0" size="64" type="address"/>
<field name="Deflake 2" start="26:0" size="64" type="address"/>
<field name="Deflake 3" start="28:0" size="64" type="address"/>
<field name="Deflake 4" start="30:0" size="64" type="address"/>
<field name="Deflake 5" start="32:0" size="64" type="address"/>
<field name="Unk 34" start="34:0" size="32" default="1" type="hex"/>
<field name="Unk address" start="36:0" size="64" type="address"/>
<field name="Unk 40" start="40:0" size="32" default="0x1c" type="hex"/>
<field name="Encoder ID" start="41:0" size="32" type="hex"/>
<field name="Unk 44" start="44:0" size="32" default="0xffffffff" type="hex"/>
<field name="Unk 48" start="48:0" size="32" default="0x40" type="hex"/>
<field name="Unk 56" start="56:0" size="32" default="6" type="hex"/>
<field name="Spilling unk 1" start="57:3" size="1" type="bool"/>
<field name="Unk 58" start="58:0" size="32" default="0x62" type="hex"/>
<field name="Spill Buffer Histogram" start="60:0" size="480" type="Spill Buffer Histogram"/>
<field name="Unk 75" start="75:0" size="32" default="0x10000" type="hex"/>
<field name="Unk 94" start="94:0" size="32" default="0xffffffff" type="hex"/>
<field name="Unk 95" start="95:0" size="32" default="0xffffffff" type="hex"/>
</struct>
<struct name="IOGPU Graphics" size="1920">
<!-- if either deflake address is null, rendering gets flaky for high
geometry counts -->
<field name="Deflake 1" start="22:0" size="64" type="address"/>
<field name="Deflake 2" start="24:0" size="64" type="address"/>
<field name="Unk 54" start="38:0" size="32" default="0x6b0003" type="hex"/>
<field name="Unk 55" start="39:0" size="32" default="0x3a0012" type="hex"/>
<field name="Unk 56" start="40:0" size="32" default="0x1" type="hex"/>
<field name="Deflake 3" start="94:0" size="64" type="address"/>
<field name="Unk 112" start="96:0" size="32" default="0x1" type="hex"/>
<field name="Unk 114" start="98:0" size="32" default="0x1c" type="hex"/>
<field name="OpenGL depth clipping" start="100:24" size="1" type="bool"/>
<field name="Unk 118" start="102:0" size="32" default="0xffffffff" type="hex"/>
<field name="Unk 119" start="103:0" size="32" default="0xffffffff" type="hex"/>
<field name="Unk 120" start="104:0" size="32" default="0xffffffff" type="hex"/>
<field name="Clear pipeline bind" start="146:0" size="32" type="hex"/>
<field name="Clear pipeline unk" start="148:0" size="4" default="4" type="hex"/>
<field name="Clear pipeline" start="148:4" size="28" type="address" modifier="shr(4)"/>
<field name="Store pipeline bind" start="154:0" size="32" type="hex"/>
<field name="Store pipeline unk" start="156:0" size="4" default="4" type="hex"/>
<field name="Store pipeline" start="156:4" size="28" type="address" modifier="shr(4)"/>
<field name="Scissor array" start="158:0" size="64" type="address"/>
<field name="Depth bias array" start="160:0" size="64" type="address"/>
<field name="ZLS control" start="164:0" size="32" type="ZLS Control"/>
<field name="Depth width" start="170:0" size="15" type="uint" default="1" modifier="minus(1)"/>
<field name="Depth height" start="170:15" size="15" type="uint" default="1" modifier="minus(1)"/>
<field name="Depth buffer 1" start="172:7" size="33" type="address" modifier="shr(7)"/>
<field name="Depth acceleration buffer 1" start="178:7" size="33" type="address" modifier="shr(7)"/>
<field name="Depth buffer 2" start="182:7" size="33" type="address" modifier="shr(7)"/>
<field name="Depth acceleration buffer 2" start="188:7" size="33" type="address" modifier="shr(7)"/>
<field name="Stencil buffer 1" start="192:7" size="33" type="address" modifier="shr(7)"/>
<field name="Stencil acceleration buffer 1" start="198:7" size="33" type="address" modifier="shr(7)"/>
<field name="Stencil buffer 2" start="202:7" size="33" type="address" modifier="shr(7)"/>
<field name="Stencil acceleration buffer 2" start="208:7" size="33" type="address" modifier="shr(7)"/>
<field name="Unk 212" start="212:0" size="32" default="0x4" type="hex"/>
<field name="Unk 214" start="214:0" size="16" default="0xc000" type="hex"/>
<field name="Z16 Unorm attachment 1" start="214:18" size="1" type="bool"/>
<field name="Width 1" start="216:0" size="32" type="uint"/>
<field name="Height 1" start="217:0" size="32" type="uint"/>
<field name="Pointer" start="218:0" size="64" type="address"/>
<!-- 0x40 with frag spilling -->
<field name="Spilling unk 1" start="226:0" size="32" type="hex"/>
<field name="Spill Buffer Histogram" start="238:0" size="480" type="Spill Buffer Histogram"/>
<!-- Encoded like the depth attachment -->
<field name="Depth clear value" start="276:0" size="32" type="hex"/>
<field name="Stencil clear value" start="277:0" size="8" type="uint"/>
<field name="Unk 277" start="277:8" size="8" type="hex" default="3"/>
<field name="Set when reloading Z or S 1" start="279:8" size="1" type="bool"/>
<field name="Set when frag shader spills" start="279:24" size="1" type="bool"/>
<field name="Set when reloading Z or S 2" start="280:24" size="1" type="bool"/>
<field name="Z16 Unorm attachment 2" start="281:8" size="1" type="bool"/>
<field name="Unk 282" start="282:0" size="32" type="hex" default="0xffffffff"/>
<field name="Unk 283" start="283:0" size="32" type="hex" default="0xffffffff"/>
<field name="Unk 284" start="284:0" size="32" type="hex" default="0xffffffff"/>
<field name="Visibility result buffer" start="286:0" size="64" type="address"/>
<field name="Partial reload pipeline bind" start="296:0" size="32" type="hex"/>
<field name="Partial reload pipeline unk" start="298:0" size="4" default="4" type="hex"/>
<field name="Partial reload pipeline" start="298:4" size="28" type="address" modifier="shr(4)"/>
<field name="Partial store pipeline bind" start="304:0" size="32" type="hex"/>
<field name="Partial store pipeline unk" start="306:0" size="4" default="4" type="hex"/>
<field name="Partial store pipeline" start="306:4" size="28" type="address" modifier="shr(4)"/>
<!-- New in 12.x -->
<field name="Depth buffer 3" start="340:0" size="64" type="address"/>
<field name="Depth acceleration buffer 3" start="342:0" size="64" type="address"/>
<field name="Stencil buffer 3" start="344:0" size="64" type="address"/>
<field name="Stencil acceleration buffer 3" start="346:0" size="64" type="address"/>
<!-- maybe only set when doing a depth clear? -->
<field name="Unk 352" start="352:0" size="32" default="0x1" type="hex"/>
<field name="Unk 360" start="360:0" size="32" default="0x1c" type="hex"/>
<field name="Encoder ID" start="362:0" size="32" type="hex"/>
<!-- top bit maybe only set with a depth clear? -->
<field name="Unk 365" start="365:0" size="64" default="0x1ffffffff" type="hex"/>
<field name="Unknown buffer" start="370:0" size="64" type="address"/>
<field name="Width 2" start="382:0" size="32" type="uint"/>
<field name="Height 2" start="383:0" size="32" type="uint"/>
<field name="Unk 384" start="384:0" size="32" default="1" type="uint"/>
<field name="Unk 385" start="385:0" size="32" default="8" type="uint"/>
<field name="Unk 386" start="386:0" size="32" default="8" type="uint"/>
<!-- if tile size 32x32: max(tib allocation, 8) rounded to POT
if tile size 32x16: that, halved
-->
<field name="Unk 49:0" start="401:0" size="32" default="8" type="uint"/>
<field name="Tile width" start="402:0" size="32" default="32" type="uint"/>
<field name="Tile height" start="403:0" size="32" default="32" type="uint"/>
<field name="Unk 52:0" start="404:0" size="32" default="1" type="uint"/>
<field name="Unk 56:0" start="408:0" size="32" default="0" type="uint"/>
<field name="Unk 70:0" start="410:0" size="32" default="1" type="uint"/>
</struct>
<struct name="IOGPU Attachment Count" size="16">
<field name="Count" start="3:0" size="32" type="uint"/>
</struct>
</genxml>