tu: Fix border color with compute shaders
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 16 Mar 2020 14:23:44 +0000 (15:23 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 17 Mar 2020 09:40:26 +0000 (09:40 +0000)
I wasn't able to find any CTS tests that used compute shaders with
samplers and set a border color, so I hacked one of the tests included
with amber:

https://gist.github.com/cwabbott0/e72f0ed8259b84ed6bf3920c68fefee6

The register was found via looking at dumps of the Vulkan blob, and
setting it fixes this test.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4204>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4204>

src/freedreno/registers/a6xx.xml
src/freedreno/vulkan/tu_cmd_buffer.c

index 94dfb36e9c0c5a7248a8ecad5d77c1e0cc0a2894..04f632ebea0dcbcb99f351f275c131d78bde8229 100644 (file)
@@ -3049,6 +3049,12 @@ to upconvert to 32b float internally?
        <!-- always 0x3f ? -->
        <reg32 offset="0xae0f" name="SP_UNKNOWN_AE0F"/>
 
+       <!--
+       The downstream kernel calls the debug cluster of registers
+       "a6xx_sp_ps_tp_cluster" but this actually specifies the border
+       color base for compute shaders.
+       -->
+       <reg64 offset="0xb180" name="SP_PS_TP_BORDER_COLOR_BASE_ADDR" type="address"/>
        <!-- always 0x0 ? -->
        <reg32 offset="0xb182" name="SP_UNKNOWN_B182"/>
        <reg32 offset="0xb183" name="SP_UNKNOWN_B183"/>
index d78356dbec88e279d0b4bd1a84e093381cb0fcf6..515ef81595041262e08526d578312c8da2a83c68 100644 (file)
@@ -1165,6 +1165,8 @@ tu6_init_hw(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
 
    tu_cs_emit_regs(cs,
                    A6XX_SP_TP_BORDER_COLOR_BASE_ADDR(.bo = &cmd->device->border_color));
+   tu_cs_emit_regs(cs,
+                   A6XX_SP_PS_TP_BORDER_COLOR_BASE_ADDR(.bo = &cmd->device->border_color));
 
    tu_cs_sanity_check(cs);
 }