Repository navigation
fix(agc): sample a depth surface's stencil plane through an R8_UNORM view - #5781
Conversation
|
RIDE 4 (PPSA01599, UE4) stops at this on current On With this PR's commit on The other two runs stopped at 117 and 140 s with Linux (Arch, kernel 7.2.9), RX 9070 XT (RADV, Mesa 26.2.4), GCC Release; a local pad-script commit replays timed presses (input only). AI-assisted: yes (Claude Code) |
|
007 First Light (PPSA11386) stops at frame 186 with this PR's error, on
With 2901df2 cherry-picked onto that stack (by then also carrying local shader-table and clip-distance commits), 007 gets past frame 186 with no stencil-plane error, through the menu and Resume, and into the level load, where it stops at frame 1188 with an unrelated error:
Linux (CachyOS, kernel 7.2.10), RTX 3080 (NVIDIA 615.78.08), GCC 16.2.1, Release. AI-assisted: yes (Claude Code) |
|
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.
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.
|
…view Vulkan cannot view a stencil aspect as UNORM, so an 8-bit UNORM view of a stencil plane threw. Copy the stencil aspect through a buffer into an R8_UNORM image of the surface's extent and sample that. The copy is kept on the surface and refreshed when the surface was written since, or while it is the bound depth target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked the R8_UNORM stencil-plane copy against current
|
2901df2 to
47f7118
Compare
What
A title can sample the stencil plane of a depth surface through an 8-bit UNORM texture (guest format 1,
R8_UNORM). Vulkan cannot view a stencil aspect as UNORM, soDepthSurface::Sampledthrew for it; onlyR8_UINTviews of the stencil plane were supported.This adds that case for a full-size, single-level, single-slice view (the same shape the existing
R8_UINTpath accepts):vkCmdCopyImageToBuffer), then from the buffer into anR8_UNORMimage of the surface's extent (vkCmdCopyBufferToImage). Stencil bytes stay unchanged, so the shader readss / 255, as on the console.writtenchanged), or when the surface is the depth target currently bound for drawing. A copy taken while the surface is bound is not reused after it is unbound, as for the existing depth plane copies (slice == drawnDepth ? 0 : written). A second sample with no write in between reuses it.Removed error, from Stellar Blade (PPSA13197 v01.141), during the first gameplay area:
Overlap check
No open or merged PR samples the stencil plane as UNORM. Searched open PRs and PRs merged since 2026-10-01 for stencil,
R8_UNORM,DepthSurface,Sampled:Sampledbut still expectR8_UINTfor the stencil plane. feat(agc): retain and refresh sampled depth array storage #1368 changes the same function, so whichever lands second needs a small rebase.planeSurfacereturns, and a surface rebound after taking another pairing's planes bumpswritten, so the copy is refreshed.R8_UNORMfor stencil storage, not sampling.Tested
TestStencilUnormViewintests/DepthSurfaceReuse.cpp(part ofagc_driver_graphics_tests). It checks that:R8_UINTview still samples without a copy;R8_UNORMview samples anR8_UNORMimage filled from the stencil aspect of the depth image;sampling the stencil plane of depth surface 0x74000000 (320x180, vk format 130) as a 320x180 texture of guest format 1 (vk 9) ... is not implemented). With it,agc_driver_graphicspasses.ctest(Release, all tests): 1140 of 1145 passed, 11 skipped. The 5 failures also fail onmainon this machine without this change:agc_driver_division_output_modifiers,agc_driver_division_result_modifiers,agc_driver_f64_conversionsandagc_driver_f64_transcendentalcrash inside the AMD Vulkan driver, andagc_driver_layered_volume_vertex_no_gplfails (checked 3 times with and 3 times without this change).tools/check_conventions.py --base origin/main: all checks passedR8_UNORMview of the stencil plane was created 3 times with no driver failure, and the run reached the first combat tutorial prompt (about 60k log lines, against about 57k before).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code