Skip to content

feat(agc): publish a written native multisample D32 depth surface to its guest planes on access - #9950

Open
ebarr24 wants to merge 1 commit into
boykopovar:mainfrom
ebarr24:ws/sample-preserving-guest-publication-of-n
Open

ebarr24 wants to merge 1 commit into
boykopovar:mainfrom
ebarr24:ws/sample-preserving-guest-publication-of-n

Conversation

@ebarr24

@ebarr24 ebarr24 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What

A guest read, DMA copy source or texture, storage, index or vertex read over a native multisample depth surface that a draw had written threw sample-preserving guest publication of native multisample depth is not implemented (Sonic Superstars PPSA06888 #5382, Monster Hunter Wilds PPSA24191 #7972, Onimusha PPSA27836 #6570). The access now completes the pending fast clear and recorder work, reads the samples back in the guest layer, row, column, fragment order with the merged multisample readback, retiles them into the Z_X plane with the descriptor pipe-bank XOR through MultisampleTextureLayout, and rewrites every HTILE word to the expanded clear word (Mesa radv_get_htile_initial_value: 0xfffc000f without stencil, ZMask 0xf with the full Z range otherwise) before retiring the surface like an unwritten one. Written D16 surfaces, surfaces the device stores in another format and surfaces it cannot sample still throw with their own messages. The console HTILE after a DB decompress and its compressed plane bytes are not measured.

Tested

Windows 11, MinGW-w64 GCC 15.2, Release build with tests. agc_driver_native_multisample_depth passes with this change; the new test fails on main.

Validation layer (vulkan-sdk-1.4.363.0), on main fcd4558 and on this change, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_ADD_LAYER_PATH set to the layer, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1: ctest -V -R "agc_driver_native_multisample_depth$". Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS; the change adds no VUID- errors (0 with the change, 0 on main).

ctest -V log, main

The ***Failed result and the failure line at its end are the new regression test failing on main, as intended; they are not an unrelated baseline failure.

rr\ps5-emulation\work\s2\.wsbuild -R agc_driver_native_multisample_depth$ -V --timeout 120
UpdateCTestConfiguration  from :C:/Users/ebarr/ps5-emulation/work/s2/.wsbuild/DartConfiguration.tcl
Test project C:/Users/ebarr/ps5-emulation/work/s2/.wsbuild
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 792
    Start 792: agc_driver_native_multisample_depth

792: Test command: C:\Users\ebarr\ps5-emulation\work\s2\.wsbuild\tests\agc_driver_native_multisample_depth_tests.exe
792: Working Directory: C:/Users/ebarr/ps5-emulation/work/s2
792: Environment variables: 
792:  ANYPS5_NO_SHADER_CACHE=1
792:  APS5_NO_PIPELINE_JOURNAL=1
792: Environment variable modifications: 
792:  PATH=path_list_prepend:C:/Users/ebarr/ps5-emulation/work/s2/.wsbuild/core/libs/libs/unpatched
792: Test timeout computed to be: 30
792: [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
792: [src\HostCpu.cpp:193 operator()] host CPU AMD Ryzen 7 3700X 8-Core Processor: has SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, LZCNT, BMI1, BMI2, MOVBE, CMPXCHG16B, LAHF/SAHF, AVX, AVX2, FMA, F16C, AES, PCLMULQDQ, RDRAND, RDSEED, ADX, SHA, CLFLUSHOPT, CLWB, RDPID, XSAVEOPT, XSAVEC, SSE4A, PREFETCHW, CLZERO, OS AVX state (XCR0); lacks none
792: 
792: Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 driver=2585198592
792: [src\VulkanDevice.cpp:1016 VulkanDevice] VulkanDevice constructor window=0000000000000000
792: [src\VulkanDevice.cpp:1025 VulkanDevice] Vulkan loader loaded library=00007ffb48fe0000
792: [src\VulkanDevice.cpp:1063 VulkanDevice] Vulkan instance created instance=0000016057696e80
792: [src\VulkanDevice.cpp:1074 VulkanDevice] Physical device count=1
792: [src\VulkanDevice.cpp:1107 VulkanDevice] Physical device candidate=000001605770e270 name=NVIDIA GeForce RTX 3080 api=0x40415f type=2
792: [src\VulkanDevice.cpp:1154 VulkanDevice] Physical device selected physical=000001605770e270 queueFamily=0
792: [src\VulkanDevice.cpp:1168 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 0 size=10053.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 1 size=16339.5 MiB flags=0x0
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 2 size=214.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 0 heap=1 flags=0x0
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 1 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 2 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 3 heap=1 flags=0x6
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=0000016000ad00d0 queue=00000160003841d0 family=0
792: [write-watch] host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking
792: Native depth feedback refused through the draw resource path; a depth-tested surface retired on guest read
792: [src\VulkanDevice.cpp:1016 VulkanDevice] VulkanDevice constructor window=0000000000000000
792: [src\VulkanDevice.cpp:1025 VulkanDevice] Vulkan loader loaded library=00007ffb48fe0000
792: [src\VulkanDevice.cpp:1063 VulkanDevice] Vulkan instance created instance=0000016057696e80
792: [src\VulkanDevice.cpp:1074 VulkanDevice] Physical device count=1
792: [src\VulkanDevice.cpp:1107 VulkanDevice] Physical device candidate=00000160577fd030 name=NVIDIA GeForce RTX 3080 api=0x40415f type=2
792: [src\VulkanDevice.cpp:1154 VulkanDevice] Physical device selected physical=00000160577fd030 queueFamily=0
792: [src\VulkanDevice.cpp:1168 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 0 size=10053.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 1 size=16339.5 MiB flags=0x0
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 2 size=214.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 0 heap=1 flags=0x0
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 1 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 2 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 3 heap=1 flags=0x6
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=0000016002f100d0 queue=00000160003832d0 family=0
792: [write-watch] host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking
792: AGC graphics: sample-preserving guest publication of native multisample depth is not implemented
1/1 Test #792: agc_driver_native_multisample_depth ...***Failed    0.77 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.88 sec

The following tests FAILED:
	792 - agc_driver_native_multisample_depth (Failed)
Errors while running CTest
Output from these tests are in: C:/Users/ebarr/ps5-emulation/work/s2/.wsbuild/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
ctest -V log, this change
ulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=000001fa27de00d0 queue=000001fa252578d0 family=0
792: Native depth publication samples=4 extent=5x3 depthOnly=0 xor=0x0: samples, HTILE and padding checked
792: [src\VulkanDevice.cpp:1016 VulkanDevice] VulkanDevice constructor window=0000000000000000
792: [src\VulkanDevice.cpp:1025 VulkanDevice] Vulkan loader loaded library=00007ffb48fe0000
792: [src\VulkanDevice.cpp:1063 VulkanDevice] Vulkan instance created instance=000001fa657f98f0
792: [src\VulkanDevice.cpp:1074 VulkanDevice] Physical device count=1
792: [src\VulkanDevice.cpp:1107 VulkanDevice] Physical device candidate=000001fa657cae40 name=NVIDIA GeForce RTX 3080 api=0x40415f type=2
792: [src\VulkanDevice.cpp:1154 VulkanDevice] Physical device selected physical=000001fa657cae40 queueFamily=0
792: [src\VulkanDevice.cpp:1168 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 0 size=10053.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 1 size=16339.5 MiB flags=0x0
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 2 size=214.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 0 heap=1 flags=0x0
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 1 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 2 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 3 heap=1 flags=0x6
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=000001fa27de00d0 queue=000001fa252582d0 family=0
792: Native depth publication samples=4 extent=70x67 depthOnly=1 xor=0x8c00: samples, HTILE and padding checked
792: [src\VulkanDevice.cpp:1016 VulkanDevice] VulkanDevice constructor window=0000000000000000
792: [src\VulkanDevice.cpp:1025 VulkanDevice] Vulkan loader loaded library=00007ffb48fe0000
792: [src\VulkanDevice.cpp:1063 VulkanDevice] Vulkan instance created instance=000001fa657f98f0
792: [src\VulkanDevice.cpp:1074 VulkanDevice] Physical device count=1
792: [src\VulkanDevice.cpp:1107 VulkanDevice] Physical device candidate=000001fa6580f6f0 name=NVIDIA GeForce RTX 3080 api=0x40415f type=2
792: [src\VulkanDevice.cpp:1154 VulkanDevice] Physical device selected physical=000001fa6580f6f0 queueFamily=0
792: [src\VulkanDevice.cpp:1168 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 0 size=10053.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 1 size=16339.5 MiB flags=0x0
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 2 size=214.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 0 heap=1 flags=0x0
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 1 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 2 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 3 heap=1 flags=0x6
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=000001fa27de00d0 queue=000001fa252587d0 family=0
792: Native depth publication samples=8 extent=5x3 depthOnly=0 xor=0x0: samples, HTILE and padding checked
792: [src\VulkanDevice.cpp:1016 VulkanDevice] VulkanDevice constructor window=0000000000000000
792: [src\VulkanDevice.cpp:1025 VulkanDevice] Vulkan loader loaded library=00007ffb48fe0000
792: [src\VulkanDevice.cpp:1063 VulkanDevice] Vulkan instance created instance=000001fa657f98f0
792: [src\VulkanDevice.cpp:1074 VulkanDevice] Physical device count=1
792: [src\VulkanDevice.cpp:1107 VulkanDevice] Physical device candidate=000001fa657cb830 name=NVIDIA GeForce RTX 3080 api=0x40415f type=2
792: [src\VulkanDevice.cpp:1154 VulkanDevice] Physical device selected physical=000001fa657cb830 queueFamily=0
792: [src\VulkanDevice.cpp:1168 VulkanDevice] Selected GPU name=NVIDIA GeForce RTX 3080 vendor=0x10de device=0x2206 subgroup=32
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 0 size=10053.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 1 size=16339.5 MiB flags=0x0
792: [src\VulkanDevice.cpp:1170 VulkanDevice] Memory heap 2 size=214.0 MiB flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 0 heap=1 flags=0x0
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 1 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 2 heap=0 flags=0x1
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 3 heap=1 flags=0x6
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 4 heap=1 flags=0xe
792: [src\VulkanDevice.cpp:1171 VulkanDevice] Memory type 5 heap=2 flags=0x7
792: [src\VulkanDevice.cpp:1244 VulkanDevice] Shader clock driver=4 narrowSubgroupClock=0
792: [gpu] largest sample location grids (vkGetPhysicalDeviceMultisamplePropertiesEXT): 1 samples 4x4, 2 samples 2x4, 4 samples 2x2, 8 samples 1x2; maxSampleLocationGridSize for every count 1x1
792: [src\VulkanDevice.cpp:1636 VulkanDevice] Vulkan features tessellationAvailable=1 mesh=1 depthClip=1 depthRangeUnrestricted=1 pipelineLibrary=1
792: [src\VulkanDevice.cpp:1904 VulkanDevice] Wave32 programs run on subgroups of 32: compute 1, mesh 1
792: [src\VulkanDevice.cpp:2015 VulkanDevice] Vulkan device ready device=000001fa27de00d0 queue=000001fa252564d0 family=0
792: Native depth publication samples=8 extent=70x67 depthOnly=1 xor=0x8c00: samples, HTILE and padding checked
792: Native depth format=124 samples=2 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=2 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=2 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=2 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=2: binds over the owner's HTILE left its words alone
792: Native depth format=124 samples=2: guest access retired the unwritten surface and refused the written one
792: Native depth format=124 samples=4 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=4 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=4 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=4 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=4: binds over the owner's HTILE left its words alone
792: Native depth format=124 samples=4: guest access retired the unwritten surface and refused the written one
792: Native depth format=124 samples=8 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=8 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=8 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=8 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=124 samples=8: binds over the owner's HTILE left its words alone
792: Native depth format=124 samples=8: guest access retired the unwritten surface and refused the written one
792: Native depth format=126 samples=2 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=2 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=2 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=2 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=2: binds over the owner's HTILE left its words alone
792: Native depth format=126 samples=2: guest access retired the unwritten surface and refused the written one
792: Native depth format=126 samples=4 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=4 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=4 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=4 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=4: binds over the owner's HTILE left its words alone
792: Native depth format=126 samples=4: guest access retired the unwritten surface and refused the written one
792: Native depth format=126 samples=8 clear=0 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=8 clear=0 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=8 clear=1 iterate256=1: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=8 clear=1 iterate256=0: imported, rasterized twice, sampled and refused conflicts
792: Native depth format=126 samples=8: binds over the owner's HTILE left its words alone
792: Native depth format=126 samples=8: guest access retired the unwritten surface and refused the written one
792: Native depth eligibility, guest writes, queued writes, metadata transitions and held views checked
792: Native multisampled depth cases checked=24 unavailable=0
1/1 Test #792: agc_driver_native_multisample_depth ...   Passed    1.80 sec

The following tests passed:
	agc_driver_native_multisample_depth

100% tests passed out of 1

Total Test time (real) =   1.91 sec

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA24191 Monster Hunter Wilds (PPSA24191) #7972, PPSA06888 SONIC SUPERSTARS (PPSA06888) #5382
  • GPUs tested: NVIDIA GeForce RTX 3080, driver 32.0.16.1692; Microsoft Windows 11 Pro; Khronos validation layer on main and this change, no new VUIDs
  • AI-assisted: yes

🤖 Generated with Claude Code

…its guest planes on access

A guest read, DMA copy source or texture, storage, index or vertex read over a native multisample depth surface that a draw had written threw sample-preserving guest publication of native multisample depth is not implemented (Sonic Superstars PPSA06888 boykopovar#5382, Monster Hunter Wilds PPSA24191 boykopovar#7972, Onimusha PPSA27836 boykopovar#6570). The access now completes the pending fast clear and recorder work, reads the samples back in the guest layer, row, column, fragment order with the merged multisample readback, retiles them into the Z_X plane with the descriptor pipe-bank XOR through MultisampleTextureLayout, and rewrites every HTILE word to the expanded clear word (Mesa radv_get_htile_initial_value: 0xfffc000f without stencil, ZMask 0xf with the full Z range otherwise) before retiring the surface like an unwritten one. Written D16 surfaces, surfaces the device stores in another format and surfaces it cannot sample still throw with their own messages. The console HTILE after a DB decompress and its compressed plane bytes are not measured.
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 22, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete implementation, retirement flow, regression tests and debt update. Publication waits for recorder work, reads D32 samples with the descriptor layout/XOR, preserves untouched guest padding, expands HTILE metadata, then retires the guarded surface. The added cases cover 2/4/8 samples, non-aligned extents, depth-only metadata, XOR, sample values, padding and clear transitions. The author reports the focused Vulkan test passing on Windows/NVIDIA and a paired validation-layer run with zero VUIDs on both the test branch and baseline. I checked the seven commits from that baseline (fcd4558) to current main (895f47f); none changes the implementation, tests or layout files reviewed here. Hosted policy checks pass; product build jobs are skipped by repository policy. I found no blocking defect.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 10368 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L1306
PR 10375 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L1306

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6186 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 docs/dev/debt/libSceAgcDriver.md
PR 6300 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6498 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6959 docs/dev/debt/libSceAgcDriver.md
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7307 docs/dev/debt/libSceAgcDriver.md
PR 7449 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7618 docs/dev/debt/libSceAgcDriver.md
PR 7642 docs/dev/debt/libSceAgcDriver.md
PR 7705 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7844 docs/dev/debt/libSceAgcDriver.md
PR 7893 docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8223 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8319 docs/dev/debt/libSceAgcDriver.md
PR 8365 docs/dev/debt/libSceAgcDriver.md
PR 8419 docs/dev/debt/libSceAgcDriver.md
PR 8426 docs/dev/debt/libSceAgcDriver.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8658 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 9020 docs/dev/debt/libSceAgcDriver.md
PR 9186 docs/dev/debt/libSceAgcDriver.md
PR 9335 docs/dev/debt/libSceAgcDriver.md
PR 9348 docs/dev/debt/libSceAgcDriver.md
PR 9356 docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9393 docs/dev/debt/libSceAgcDriver.md
PR 9431 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9508 docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9673 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9675 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9676 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9700 docs/dev/debt/libSceAgcDriver.md
PR 9748 docs/dev/debt/libSceAgcDriver.md
PR 9842 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9892 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9898 docs/dev/debt/libSceAgcDriver.md
PR 9904 docs/dev/debt/libSceAgcDriver.md
PR 9905 docs/dev/debt/libSceAgcDriver.md
PR 9906 docs/dev/debt/libSceAgcDriver.md
PR 9941 docs/dev/debt/libSceAgcDriver.md
PR 10049 docs/dev/debt/libSceAgcDriver.md
PR 10064 docs/dev/debt/libSceAgcDriver.md
PR 10193 docs/dev/debt/libSceAgcDriver.md
PR 10194 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 10359 docs/dev/debt/libSceAgcDriver.md

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the publication path and regression coverage. The access path syncs pending recorder work, reads the native multisample image into a linear staging buffer, retiles samples using the guest Z_X layout and pipe-bank XOR, expands the HTILE words, writes guest memory, then retires the resident surface. The implementation explicitly keeps D16, host-format conversion, and unsampleable devices unsupported. The test checks 2x/4x/8x D32 publication, both HTILE shapes, a nonzero pipe-bank XOR, every sample location, and untouched padding; the author reports zero validation-layer VUIDs on both main and the change. The required policy/conventions/intake/labels/report checks pass; hosted product jobs are skipped. I could not run the GPU test here because this environment has no /dev/dri device. The overlap with #9533/#9717 is distinct D32S8 import/stencil sampling work; if either merges first, please rebase and preserve those changes alongside this D32 guest-publication path. Approved at head 875fa29.

@klosixgaming-arch

Copy link
Copy Markdown
Contributor

Hardware & Environment

  • OS: Windows 11 Version 24H2 (OS Build 26100.3194)
  • CPU: AMD Ryzen 9 9950X3D (16 Cores, 32 Threads)
  • GPU: NVIDIA GeForce RTX 5090 32 GB (Driver: 617.42)
  • Toolchain: MinGW-w64 GCC 15.2.0, Ninja 1.13.0, CMake 3.31.6

Test Methodology & Verification

  1. Security Audit:

    • Examined all additions across core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp, core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp, and docs/dev/debt/libSceAgcDriver.md.
    • Confirmed safe Vulkan compute/copy dispatch, bounded memory copies, proper resource management, and no external networking or obfuscated payloads.
  2. Negative Baseline Verification:

    • Reverting DepthSurface.cpp to origin/main while running the new test suite confirmed the expected baseline failure:
      791: AGC graphics: sample-preserving guest publication of native multisample depth is not implemented
      1/1 Test #791: agc_driver_native_multisample_depth ...***Failed    0.98 sec
      
  3. Positive Test Results:

    • Rebuilding with the PR patch in place and executing the test suite:
      • agc_driver_native_multisample_depth: PASSED (2.76s)
      • agc_driver_graphics: PASSED (8.39s)
    • Publication of sample-preserving native multisampled D32 depth properly completes pending fast clear work, unbinds/merges multisample layers in guest sample order, applies descriptor pipe-bank XOR retiling into the Z_X plane, and initializes HTILE words with the expanded initial clear word.
  4. Conventions:

    • Running python tools/check_conventions.py --base origin/main returned 0 errors (1 non-blocking warning regarding technical debt line length in docs/dev/debt/libSceAgcDriver.md:30 at 2196 chars).

LGTM!

AI-assisted: yes. Written with AI assistance and reviewed by me.

@EagleBearerYS

Copy link
Copy Markdown
Contributor

@ebarr24 a merge-order note from #9533, ours, which #9717 and #9742 stack on. Both PRs edit Graphics/src/DepthSurface.cpp and the "Native multisampled depth sampling" entry in docs/dev/debt/libSceAgcDriver.md, so they conflict, in text only:

They compose: keep both includes and merge the two sentences. We'd propose that this PR goes first, and #9533 rebases over it and lists it under Depends on. If you'd rather go second, say so.

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First run on Apple silicon. It goes from red to green with both drivers I tried.

Setup: Apple M2 Max (32 GB), macOS 27.2, x86_64 build under Rosetta, Release, BUILD_TESTING=ON. Method: #8658 (feat/macos-port) @ 4e0468722f plus this PR's diff from its merge base (head 875fa29033), not main, since main does not build on macOS yet. Two drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), and MoltenVK main with SPIRV-Cross #2704. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -R 'native_multisample_depth|native_depth' -j1 --timeout 30 -V.

MoltenVK 1.4.2 MoltenVK main + #2704
this PR's test changes only 1 of 5 pass. agc_driver_native_multisample_depth fails with sample-preserving guest publication of native multisample depth is not implemented; _clears, _clear_refusals and _retirement fail because they expect the new refusal messages same
this PR 5 of 5 pass 5 of 5 pass

With this PR, the new publication case checks samples, HTILE and padding for 2 and 4 samples, at 5x3 (depthOnly=0) and 70x67 (depthOnly=1, xor=0x8c00).

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVK main + SPIRV-Cross #2704), macOS 27.2.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@BKlaasWerkman

Copy link
Copy Markdown

Windows run on NVIDIA and Intel. Head 875fa29 was merged into main 15e71db (clean merge) and compared with that main on the same machine.

Setup: Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release. Environment: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (1.4.363), ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. The run covers the 1,250 tests that tools/select_tests.py selects for this diff.

GPU this PR main
NVIDIA GeForce RTX 3060 Ti (617.42) 1243 passed, 4 skipped, 3 failed the same
Intel Arc Graphics (Meteor Lake, 101.9150) 1221 passed, 26 skipped, 3 failed 1222 passed, 2 failed

AI-assisted: yes (Claude Code)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants