freedreno/a6xx: Define the register fields for polygon fill mode.
authorEric Anholt <eric@anholt.net>
Wed, 10 Jun 2020 19:59:38 +0000 (12:59 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 25 Jun 2020 20:46:28 +0000 (13:46 -0700)
Produced by comparing the traces of:
dEQP-VK.rasterization.culling.front_triangles
dEQP-VK.rasterization.culling.front_triangles_point
dEQP-VK.rasterization.culling.front_triangles_line

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5650>

src/freedreno/registers/a6xx.xml
src/freedreno/vulkan/tu_cmd_buffer.c
src/gallium/drivers/freedreno/a6xx/fd6_emit.c

index 32c280370b5a416cbe2945e40ff0c45c8ceb1cb5..32a5c0778557ceeb2c6f783c647f8613c45d4d30 100644 (file)
@@ -159,6 +159,12 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
 </enum>
 
 <!-- probably same as a5xx -->
+<enum name="a6xx_polygon_mode">
+       <value name="POLYMODE6_POINTS" value="1"/>
+       <value name="POLYMODE6_LINES" value="2"/>
+       <value name="POLYMODE6_TRIANGLES" value="3"/>
+</enum>
+
 <enum name="a6xx_depth_format">
        <value name="DEPTH6_NONE" value="0"/>
        <value name="DEPTH6_16" value="1"/>
@@ -2530,7 +2536,9 @@ to upconvert to 32b float internally?
 
        <reg32 offset="0x9106" name="VPC_UNKNOWN_9106"/>
        <reg32 offset="0x9107" name="VPC_UNKNOWN_9107"/>
-       <reg32 offset="0x9108" name="VPC_UNKNOWN_9108"/>
+       <reg32 offset="0x9108" name="VPC_POLYGON_MODE">
+               <bitfield name="MODE" low="0" high="1" type="a6xx_polygon_mode"/>
+       </reg32>
 
        <array offset="0x9200" name="VPC_VARYING_INTERP" stride="1" length="8">
                <reg32 offset="0x0" name="MODE"/>
@@ -2690,7 +2698,10 @@ to upconvert to 32b float internally?
        </reg32>
 
        <reg32 offset="0x9980" name="PC_UNKNOWN_9980"/>
-       <reg32 offset="0x9981" name="PC_UNKNOWN_9981"/>
+
+       <reg32 offset="0x9981" name="PC_POLYGON_MODE">
+               <bitfield name="MODE" low="0" high="1" type="a6xx_polygon_mode"/>
+       </reg32>
 
        <reg32 offset="0x9990" name="PC_UNKNOWN_9990"/>
 
index e59cabb9756aed9ffa3b9aa27b6667ad03d65ffb..7371f9489cadc73eaf087926439a4dfd1aa399ae 100644 (file)
@@ -968,9 +968,9 @@ tu6_init_hw(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
    tu_cs_emit_write_reg(cs, REG_A6XX_VPC_UNKNOWN_9210, 0);
    tu_cs_emit_write_reg(cs, REG_A6XX_VPC_UNKNOWN_9211, 0);
    tu_cs_emit_write_reg(cs, REG_A6XX_VPC_UNKNOWN_9602, 0);
-   tu_cs_emit_write_reg(cs, REG_A6XX_PC_UNKNOWN_9981, 0x3);
+   tu_cs_emit_write_reg(cs, REG_A6XX_PC_POLYGON_MODE, POLYMODE6_TRIANGLES);
    tu_cs_emit_write_reg(cs, REG_A6XX_PC_UNKNOWN_9E72, 0);
-   tu_cs_emit_write_reg(cs, REG_A6XX_VPC_UNKNOWN_9108, 0x3);
+   tu_cs_emit_write_reg(cs, REG_A6XX_VPC_POLYGON_MODE, POLYMODE6_TRIANGLES);
    tu_cs_emit_write_reg(cs, REG_A6XX_SP_TP_UNKNOWN_B309, 0x000000a2);
    tu_cs_emit_write_reg(cs, REG_A6XX_HLSQ_CONTROL_5_REG, 0xfc);
 
index a55bb053e04009949471c65889927f37cf3ec4cb..78000296625b589995ca9eb43126a2ebd6f997d6 100644 (file)
@@ -1194,9 +1194,9 @@ fd6_emit_restore(struct fd_batch *batch, struct fd_ringbuffer *ring)
        WRITE(REG_A6XX_VPC_UNKNOWN_9210, 0);
        WRITE(REG_A6XX_VPC_UNKNOWN_9211, 0);
        WRITE(REG_A6XX_VPC_UNKNOWN_9602, 0);
-       WRITE(REG_A6XX_PC_UNKNOWN_9981, 0x3);
+       WRITE(REG_A6XX_PC_POLYGON_MODE, POLYMODE6_TRIANGLES);
        WRITE(REG_A6XX_PC_UNKNOWN_9E72, 0);
-       WRITE(REG_A6XX_VPC_UNKNOWN_9108, 0x3);
+       WRITE(REG_A6XX_VPC_POLYGON_MODE, POLYMODE6_TRIANGLES);
        WRITE(REG_A6XX_SP_TP_SAMPLE_CONFIG, 0);
        /* NOTE blob seems to (mostly?) use 0xb2 for SP_TP_UNKNOWN_B309
         * but this seems to kill texture gather offsets.