From 0cf29bf0ce4e06ec384c680017b90d546630d8da Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Fri, 17 Jan 2025 09:22:12 +0100 Subject: [PATCH] freedreno/a7xx: fix fd_lrzfc_layout Various vkd3d-proton tests run via Turnip exposed an issue with the a7xx-specific instantiation of the fd_lrzfc_layout struct used to allocate memory for LRZ fast-clear operations. The correct layout is quite bigger in size, and the duplicated FC buffers are positioned at the beginning and the end of it. Smaller part of the area in the middle is used for metadata, but it already seems to be used more extensively than how we currently understand it. Fixes in vkd3d-proton on tu/a750: test_clear_depth_stencil_view test_copy_texture test_early_depth_stencil_tests Signed-off-by: Zan Dobersek Reviewed-by: Danylo Piliaiev Part-of: --- src/freedreno/ci/freedreno-a750-vkd3d-fails.txt | 3 --- src/freedreno/common/freedreno_lrz.h | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/freedreno/ci/freedreno-a750-vkd3d-fails.txt b/src/freedreno/ci/freedreno-a750-vkd3d-fails.txt index 4008517fcb6..8ddb94bfbcf 100644 --- a/src/freedreno/ci/freedreno-a750-vkd3d-fails.txt +++ b/src/freedreno/ci/freedreno-a750-vkd3d-fails.txt @@ -1,6 +1,3 @@ -test_clear_depth_stencil_view,Fail -test_copy_texture,Fail -test_early_depth_stencil_tests,Fail test_index_buffer_edge_case_stream_output,Fail test_multisample_resolve_strongly_typed,Fail test_primitive_restart_list_topology_stream_output,Fail diff --git a/src/freedreno/common/freedreno_lrz.h b/src/freedreno/common/freedreno_lrz.h index 14ba94dcf25..a266e78a84c 100644 --- a/src/freedreno/common/freedreno_lrz.h +++ b/src/freedreno/common/freedreno_lrz.h @@ -78,11 +78,12 @@ struct PACKED fd_lrzfc_layout { union { struct { enum fd_lrz_gpu_dir dir_track; - uint8_t _pad_; + uint8_t _padding0; uint32_t gras_lrz_depth_view; }; uint8_t metadata[512]; }; + uint8_t _padding1[1536]; union { struct { uint8_t fc2_a[FC_SIZE]; @@ -92,4 +93,8 @@ struct PACKED fd_lrzfc_layout { }; }; +static_assert(sizeof(fd_lrzfc_layout) == 0x1800); +static_assert(offsetof(fd_lrzfc_layout, fc1) == 0x0); +static_assert(offsetof(fd_lrzfc_layout, fc2) == 0x1000); + #endif