mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
ail: Add unit tests for miptree layouts
The equations for calculating miptree offsets are complicated, nonobvious, and full of subtle footguns. Worse, the driver doesn't control the offsets -- it must simply agree with the offsets implicitly calculated in the hardware. The CTS doesn't adequately exercise all the corner cases. Make sure we have unit tests that do. The tests themselves are generated by instrumenting agxdecode to scan GPU memory after uploading test patterns in a variety of layout with a Metal application. Thank you to Asahi Lina and Dougall Johnson for the reverse-engineering that led to this. The tests selected here are a subset of those used for the reverse-engineering. The full set may be found in Lina's tilecalc repo: https://github.com/asahilina/tilecalc Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18167>
This commit is contained in:
parent
1f89e67883
commit
65c00ba7cb
2 changed files with 1320 additions and 0 deletions
|
|
@ -31,3 +31,22 @@ libasahi_layout = static_library(
|
|||
gnu_symbol_visibility : 'hidden',
|
||||
build_by_default : false,
|
||||
)
|
||||
|
||||
if with_tests
|
||||
test(
|
||||
'asahi_layout_tests',
|
||||
executable(
|
||||
'asahi_layout_tests',
|
||||
files(
|
||||
'tests/test-layout.cpp',
|
||||
),
|
||||
c_args : [c_msvc_compat_args, no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_include, inc_src],
|
||||
dependencies: [idep_gtest, idep_mesautil],
|
||||
link_with : [libasahi_layout],
|
||||
),
|
||||
suite : ['asahi'],
|
||||
protocol : gtest_test_protocol,
|
||||
)
|
||||
endif
|
||||
|
|
|
|||
1301
src/asahi/layout/tests/test-layout.cpp
Normal file
1301
src/asahi/layout/tests/test-layout.cpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue