Repository navigation
perf(agc): prove sampled depth surfaces in the fast resource proof - #1430
Conversation
|
This now conflicts with main in |
1af4eeb to
965f018
Compare
|
Rebased onto The conflict was in ctest ( |
965f018 to
33bcbf0
Compare
|
Rebased on main 29e533a (head 33bcbf0). The depth fast path now only covers plain 2D depth lookups (2D dimension, base array 0), so it composes with #1368's slice refresh: array and layered views take the full walk through
|
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
The test's The exception then unwinds through The full ctest passes apart from one unrelated failure from #2359 (520 of 521). 🤖 Addressed by Claude Code |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the fix and the numbers. One blocker:
depthSurfaceProofTestssetsbinding.binding = 0(tests/Recorder.cpp:2630). On currentmainbinding 0 isBinding::Buffers, and sampled images start atRuntimeAbi::FirstImageBinding, soHeapCapacitythrowsShader runtime ABI: binding is not a typed heap(RuntimeAbi.hpp:73). @popcoder565 hit exactly this on Windows with this head. Please useShaderRecompiler::RuntimeAbi::FirstImageBinding(astests/Graphics.cppdoes) and re-check that the test still fails onmainfor the intended reason (no record), not on this exception.agc_driver_recorder_testsisn't registered in ctest, so CI never runs the new test and didn't catch the above. Please register the suite (or move the test to a registered target) so it is covered.
The change itself in ShaderResources.cpp / DepthSurface.cpp looks fine.
33bcbf0 to
f1e4838
Compare
|
@popcoder565 thanks, that was right. The rebase onto a29ef59 (f1e4838) binds the test's sampled image at AI-assisted: yes |
Array and layered depth views go back to the full walk, so a lookup that refreshes array slices is not skipped by the fast proof.
f1e4838 to
a8c4f86
Compare
adriadam10
left a comment
There was a problem hiding this comment.
Rebased onto current main (the only conflict was in tests/Recorder.cpp).
mainnow enablesnullDescriptoron the recorder suite's device and exposesDevice::NullDescriptors(), so I dropped the duplicate robustness block;depthSurfaceProofTestschecksdevice.NullDescriptors()and setscontext.nullDescriptors = trueon its context copy, like the neighbouring test.agc_driver_recorder_testson RADV:depthSurfaceProofTestspasses (fast 1, full 0). With the four non-test files reverted tomainit fails withleft the fast proof for the full walk on use 2/no record 1. The suite still stops later at(s) results pending when their memory left the watch, as onmainwithout this test.- ctest for libSceAgcDriver: 332/332.
- Not covered by CI: the suite isn't registered in ctest and PR CI doesn't build.
Merging once CI is green.
|
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.
|
What
This is the fix from #1132. Sets that sample a depth surface now pass the fast resource proof instead of taking the full walk on every reuse.
cachedTexturereturnedDepthSurfaceTexture's object before callinglogLookup, so the element had no lookup record andfastRevalidatefailed withno recordevery time. The walk then succeeded, because the depth surface hands out the same object each time. The only cost was one full walk per dispatch.ValidatedSurfacecarries the flag.fastRevalidateandfastRevalidateEachprove a depth element with the newDepthSurfaceHolds(context, address, texture): the newest surface at that address still hands out that object, which is what the walk'sDepthSurfaceTexturelookup would return. The memory, key and pending checks are skipped for that element.depth surface, covers a surface that no longer hands the object out.New test:
depthSurfaceProofTestsintests/Recorder.cpp(agc_driver_recorder_tests, a separate commit). It registers a D32 depth surface on a real device, builds a compute set whose only binding samples it, and requiresRevalidateto take the fast path on the second and third use. The test needs a real device with the driver'sContext, which the mock harness intests/Graphics.cppdoesn't have, so it sits with the other cache tests in the recorder suite. It builds onmainunchanged and fails there on behaviour:With
APS5_PROFILE_DRAW=1, the[rescache]line onmainshows the reason:On this branch it passes, and the same line reads:
The idea for a dedicated test came from @emirplus in #1199, which implements the same change. Thanks to them, and to @oneandonlydean for spelling out what the test has to show.
Demon's Souls (PPSA01341 v1.07), PS Studios movie, per 10 s:
The frame rate did not change: queue 0's wait for the GPU mutex took up the time saved.
#425 and #454 change the same lookup (per-use depth copies, retired surfaces). If one of them lands first, a depth record has to skip per-use copies and
DepthSurfaceHoldshas to treat a retired surface as not holding. I'll rebase onto whichever lands.Closes #1132.
Tested
Linux 7.2 (Nobara 44), GCC 16.2, RTX 5070 Ti, driver 595.91.07.
agc_driver_recorder_tests(run directly; it isn't registered with ctest): fails onmainwith the message above and passes here. If you want it under ctest, I can register the suite here or in a follow-up.maina29ef59. Since the typed descriptor heaps landed, a sampled image has to sit in an image heap and the heaps neednullDescriptor, so the test binds atRuntimeAbi::FirstImageBindingand the recorder suite's device now enablesVK_EXT_robustness2nullDescriptorwhen the GPU has it, as the driver's own device does (the test reports "not tested" without it). The new test passes. The suite then stops later at "guest allocation ... is still pinned", the same as on unmodifiedmain.ctest -R agc_ -j1on a29ef59: 321 of 322. The one failure,agc_driver_dcc_keys_first_write, also fails onmain.ctest -R "agc_driver|guest_agc_driver": 164 of 164 pass.agc_driver_lds_atomics64andagc_driver_scalar_sop1are excluded; they fail on unmodifiedmainon this GPU too.APS5_WRITE_WATCH_IMPORTS=watch. On currentmain, this NVIDIA driver refuses the new dma-buf import probe (vkAllocateMemory-2), and after that every allocation on the device fails, so most GPU tests fail on unmodifiedmainwithout the variable. The recorder suite also stops at its own dma-buf probe test for the same reason, so the new test runs before that point. fix(agc): turn off dma-buf import on the NVIDIA proprietary driver #1380 and fix(agc): keep dma-buf import off the NVIDIA proprietary driver #1329 turn that probe off on NVIDIA's proprietary driver.Checklist
main; no other open PR implements the same functions (fix(agc): record depth surface lookups and fast-prove held surfaces #1199 does; see above)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository