Module: Mesa Branch: main Commit: 6c186021640928496392401dea83a2cb71e17997 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c186021640928496392401dea83a2cb71e17997
Author: Danylo Piliaiev <[email protected]> Date: Thu Mar 24 15:37:56 2022 +0200 turnip: Add "unaligned_store" debug option to better test gmem stores Unaligned store is incredibly rare in CTS, we have to force it to actually test it. Signed-off-by: Danylo Piliaiev <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15532> --- src/freedreno/vulkan/tu_clear_blit.c | 4 ++++ src/freedreno/vulkan/tu_device.c | 1 + src/freedreno/vulkan/tu_private.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/freedreno/vulkan/tu_clear_blit.c b/src/freedreno/vulkan/tu_clear_blit.c index 111a3b09f84..a96be2613e2 100644 --- a/src/freedreno/vulkan/tu_clear_blit.c +++ b/src/freedreno/vulkan/tu_clear_blit.c @@ -2947,6 +2947,10 @@ tu_store_gmem_attachment(struct tu_cmd_buffer *cmd, (x2 % phys_dev->info->gmem_align_w && x2 != iview->view.width) || y1 % phys_dev->info->gmem_align_h || (y2 % phys_dev->info->gmem_align_h && need_y2_align); + /* Unaligned store is incredibly rare in CTS, we have to force it to test. */ + if (unlikely(cmd->device->physical_device->instance->debug_flags & TU_DEBUG_UNALIGNED_STORE)) + unaligned = true; + /* D32_SFLOAT_S8_UINT is quite special format: it has two planes, * one for depth and other for stencil. When resolving a MSAA * D32_SFLOAT_S8_UINT to S8_UINT, we need to take that into account. diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 26b30d9da7d..f0cc72de141 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -337,6 +337,7 @@ static const struct debug_control tu_debug_options[] = { { "syncdraw", TU_DEBUG_SYNCDRAW }, { "dontcare_as_load", TU_DEBUG_DONT_CARE_AS_LOAD }, { "rast_order", TU_DEBUG_RAST_ORDER }, + { "unaligned_store", TU_DEBUG_UNALIGNED_STORE }, { NULL, 0 } }; diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index facf8acdfcd..dfbcfd09fbd 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -267,6 +267,7 @@ enum tu_debug_flags TU_DEBUG_DONT_CARE_AS_LOAD = 1 << 12, TU_DEBUG_GMEM = 1 << 13, TU_DEBUG_RAST_ORDER = 1 << 14, + TU_DEBUG_UNALIGNED_STORE = 1 << 15, }; struct tu_instance
