freedreno/a6xx: Add multiview registers
[mesa.git] / src / freedreno / registers / adreno / a6xx.xml
index 8c5d61c548751209f088a307109e89adebfc2121..7327ba6db8a58593dd02001c8755022c872b8bbd 100644 (file)
@@ -1921,7 +1921,14 @@ to upconvert to 32b float internally?
                <bitfield name="POLY_OFFSET" pos="11" type="boolean"/>
                <bitfield name="UNK12" pos="12"/>
                <bitfield name="MSAA_ENABLE" pos="13" type="boolean"/>
-               <bitfield name="UNK15" low="15" high="22"/>
+               <bitfield name="UNK15" low="15" high="16"/>
+               <!--
+               This is set by the blob when multiview is enabled, but doesn't seem
+               to do anything.
+               -->
+               <bitfield name="UNK17" pos="17" type="boolean"/>
+               <bitfield name="MULTIVIEW_ENABLE" pos="18" type="boolean"/>
+               <bitfield name="UNK19" low="19" high="22"/>
        </reg32>
        <reg32 offset="0x8091" name="GRAS_SU_POINT_MINMAX">
                <bitfield name="MIN" low="0" high="15" type="ufixed" radix="4"/>
@@ -2731,7 +2738,13 @@ to upconvert to 32b float internally?
                <bitfield name="STRIDE_IN_VPC" low="0" high="7" type="uint"/>
                <bitfield name="POSITIONLOC" low="8" high="15" type="uint"/>
                <bitfield name="PSIZELOC" low="16" high="23" type="uint"/>
-               <bitfield name="UNK24" low="24" high="27"/>
+               <bitfield name="EXTRAPOS" low="24" high="27" type="uint">
+                       <doc>
+                               The number of extra copies of POSITION, i.e.
+                               number of views minus one when multi-position
+                               output is enabled, otherwise 0.
+                       </doc>
+               </bitfield>
        </bitset>
        <reg32 offset="0x9301" name="VPC_VS_PACK" type="a6xx_vpc_xs_pack"/>
        <reg32 offset="0x9302" name="VPC_GS_PACK" type="a6xx_vpc_xs_pack"/>
@@ -2742,7 +2755,18 @@ to upconvert to 32b float internally?
                <!-- for fixed-function (i.e. no GS) gl_PrimitiveID in FS -->
                <bitfield name="PRIMIDLOC" low="8" high="15" type="uint"/>
                <bitfield name="VARYING" pos="16" type="boolean"/>
-               <bitfield name="UNKLOC" low="24" high="31" type="uint"/>
+               <bitfield name="VIEWIDLOC" low="24" high="31" type="uint">
+                       <doc>
+                               This VPC location will be overwritten with
+                               ViewID when multiview is enabled. It's used when
+                               fragment shaders read ViewID. It's only
+                               strictly required for multi-position output,
+                               where the same VS invocation is used for all the
+                               views at once, but it can be used when multi-pos
+                               output is disabled too, to avoid having to pass
+                               ViewID through the VS.
+                       </doc>
+               </bitfield>
        </reg32>
 
        <reg32 offset="0x9305" name="VPC_SO_BUF_CNTL">
@@ -2877,10 +2901,24 @@ to upconvert to 32b float internally?
                </doc>
                <bitfield name="STRIDE_IN_VPC" low="0" high="10" type="uint"/>
        </reg32>
-       <!-- something gs related: -->
-       <reg32 offset="0x9b07" name="PC_UNKNOWN_9B07" low="0" high="6"/>
 
-       <reg32 offset="0x9b08" name="PC_UNKNOWN_9B08" low="0" high="15"/>
+       <bitset name="a6xx_multiview_cntl" inline="yes">
+               <bitfield name="ENABLE" pos="0" type="boolean"/>
+               <bitfield name="DISABLEMULTIPOS" pos="1" type="boolean">
+                       <doc>
+                               Multi-position output lets the last geometry
+                               stage shader write multiple copies of
+                               gl_Position. If disabled then the VS is run once
+                               for each view, and ViewID is passed as a
+                               register to the VS.
+                       </doc>
+               </bitfield>
+               <bitfield name="VIEWS" low="2" high="6" type="uint"/>
+       </bitset>
+
+       <reg32 offset="0x9b07" name="PC_MULTIVIEW_CNTL" type="a6xx_multiview_cntl"/>
+       <!-- mask of enabled views, doesn't exist on A630 -->
+       <reg32 offset="0x9b08" name="PC_MULTIVIEW_MASK" type="hex" low="0" high="15"/>
        <!-- 0x9b09-0x9bff invalid -->
        <reg32 offset="0x9c00" name="PC_2D_EVENT_CMD">
                <!-- special register (but note first 8 bits can be written/read) -->
@@ -2924,6 +2962,8 @@ to upconvert to 32b float internally?
                <bitfield name="REGID4VTX" low="0" high="7" type="a3xx_regid"/>
                <bitfield name="REGID4INST" low="8" high="15" type="a3xx_regid"/>
                <bitfield name="REGID4PRIMID" low="16" high="23" type="a3xx_regid"/>
+               <!-- only used for VS in non-multi-position-output case -->
+               <bitfield name="REGID4VIEWID" low="24" high="31" type="a3xx_regid"/>
        </reg32>
        <reg32 offset="0xa002" name="VFD_CONTROL_2">
                <bitfield name="REGID_HSPATCHID" low="0" high="7" type="a3xx_regid"/>
@@ -2952,8 +2992,7 @@ to upconvert to 32b float internally?
                <bitfield name="BINNING_PASS" pos="0" type="boolean"/>
        </reg32>
 
-       <!-- always 0x0 ? -->
-       <reg32 offset="0xa008" name="VFD_UNKNOWN_A008"/>
+       <reg32 offset="0xa008" name="VFD_MULTIVIEW_CNTL" type="a6xx_multiview_cntl"/>
        <reg32 offset="0xa009" name="VFD_ADD_OFFSET">
                <!-- add VFD_INDEX_OFFSET to REGID4VTX -->
                <bitfield name="VERTEX" pos="0" type="boolean"/>