diff options
author | Connor Abbott <[email protected]> | 2020-07-13 12:51:43 +0200 |
---|---|---|
committer | Connor Abbott <[email protected]> | 2020-07-14 10:23:58 +0200 |
commit | a16136796ff6e7dc31f3daa7c39762a787fbf169 (patch) | |
tree | 12a34a5dc9a0c4be8580aa45d491ec4769447d57 | |
parent | e1fa740c4c1412458b56732a222c86bef3bd6b31 (diff) |
freedreno/a6xx: Add some documentation for shared consts
I'm not convinced we'll actually want to use this, and there may be
another enable bit in SP_UNKNOWN_AB00, but it's nice to at least write
this down in case we want to try using it in the future.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5877>
-rw-r--r-- | src/freedreno/registers/a6xx.xml | 24 | ||||
-rw-r--r-- | src/freedreno/vulkan/tu_cmd_buffer.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.c | 2 |
3 files changed, 24 insertions, 4 deletions
diff --git a/src/freedreno/registers/a6xx.xml b/src/freedreno/registers/a6xx.xml index f821832ba06..96415c17f6d 100644 --- a/src/freedreno/registers/a6xx.xml +++ b/src/freedreno/registers/a6xx.xml @@ -3426,6 +3426,7 @@ to upconvert to 32b float internally? <bitfield name="CS_IBO" pos="6" type="boolean"/> <bitfield name="GFX_IBO" pos="7" type="boolean"/> + <!-- Note: these only do something when HLSQ_SHARED_CONSTS is set to 1 --> <bitfield name="CS_SHARED_CONST" pos="19" type="boolean"/> <bitfield name="GFX_SHARED_CONST" pos="8" type="boolean"/> @@ -3436,8 +3437,27 @@ to upconvert to 32b float internally? <reg32 offset="0xbb10" name="HLSQ_FS_CNTL" type="a6xx_hlsq_xs_cntl"/> - <!-- always 0x0 ? --> - <reg32 offset="0xbb11" name="HLSQ_UNKNOWN_BB11"/> + <reg32 offset="0xbb11" name="HLSQ_SHARED_CONSTS"> + <doc> + Shared constants are intended to be used for Vulkan push + constants. When enabled, 8 vec4's are reserved in the FS + const pool and 16 in the geometry const pool although + only 8 are actually used (why?) and they are mapped to + c504-c511 in each stage. Both VS and FS shared consts + are written using ST6_CONSTANTS/SB6_IBO, so that both + the geometry and FS shared consts can be written at once + by using CP_LOAD_STATE6 rather than + CP_LOAD_STATE6_FRAG/CP_LOAD_STATE6_GEOM. In addition + DST_OFF and NUM_UNIT are in units of dwords instead of + vec4's. + + There is also a separate shared constant pool for CS, + which is loaded through CP_LOAD_STATE6_FRAG with + ST6_UBO/ST6_IBO. However the only real difference for CS + is the dword units. + </doc> + <bitfield name="ENABLE" pos="0" type="boolean"/> + </reg32> <!-- mirror of SP_BINDLESS_BASE --> <array offset="0xbb20" name="HLSQ_BINDLESS_BASE" stride="2" length="5"> diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index d1145bfb13e..8fe404b5e5c 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -751,7 +751,7 @@ tu6_init_hw(struct tu_cmd_buffer *cmd, struct tu_cs *cs) tu_cs_emit_write_reg(cs, REG_A6XX_SP_UNKNOWN_AE03, 0x00000410); tu_cs_emit_write_reg(cs, REG_A6XX_SP_IBO_COUNT, 0); tu_cs_emit_write_reg(cs, REG_A6XX_SP_UNKNOWN_B182, 0); - tu_cs_emit_write_reg(cs, REG_A6XX_HLSQ_UNKNOWN_BB11, 0); + tu_cs_emit_write_reg(cs, REG_A6XX_HLSQ_SHARED_CONSTS, 0); tu_cs_emit_write_reg(cs, REG_A6XX_UCHE_UNKNOWN_0E12, 0x3200000); tu_cs_emit_write_reg(cs, REG_A6XX_UCHE_CLIENT_PF, 4); tu_cs_emit_write_reg(cs, REG_A6XX_RB_UNKNOWN_8E01, 0x0); diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c index 4740f60ab45..cf224178ca8 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c @@ -1162,7 +1162,7 @@ fd6_emit_restore(struct fd_batch *batch, struct fd_ringbuffer *ring) WRITE(REG_A6XX_SP_UNKNOWN_AE03, 0x1430); WRITE(REG_A6XX_SP_IBO_COUNT, 0); WRITE(REG_A6XX_SP_UNKNOWN_B182, 0); - WRITE(REG_A6XX_HLSQ_UNKNOWN_BB11, 0); + WRITE(REG_A6XX_HLSQ_SHARED_CONSTS, 0); WRITE(REG_A6XX_UCHE_UNKNOWN_0E12, 0x3200000); WRITE(REG_A6XX_UCHE_CLIENT_PF, 4); WRITE(REG_A6XX_RB_UNKNOWN_8E01, 0x1); |