feat(agc): depth bounds test and depth bias #376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/376"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-02T16:15:48Z.
What
DB_DEPTH_CONTROL'sDEPTH_BOUNDS_ENABLEruns the Vulkan depth bounds test withDB_DEPTH_BOUNDS_MIN/MAX(0x008/0x009). Without a depth surface it is still refused. Bounds outside [0, 1] are refused unlessVK_EXT_depth_range_unrestrictedis available, because clamping them would change the result at a stored depth of exactly 0 or 1.PA_SU_SC_MODE_CNTL'sPOLY_OFFSET_FRONT/BACK_ENABLEenable Vulkan depth bias:PA_SU_POLY_OFFSET_FRONT/BACK_OFFSET;_SCALE/ 16 (the hardware scale is in 1/16 units);PA_SU_POLY_OFFSET_CLAMP.PA_SU_POLY_OFFSET_DB_FMT_CNTLunits differ from the depth format's. A context that never writes the register is taken to use the format's units;DB_DEPTH_CONTROLbits 30/31).depthBoundsanddepthBiasClampare enabled when the device has them.GTA V draws its deferred light volumes with the depth bounds test, and its shadow maps with depth bias. Both had been refused, so the scene got no point or spot lights and no shadows.
Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
main.ctest: all tests pass. New cases cover the decode of bounds and bias, and out-of-range bounds being refused withoutVK_EXT_depth_range_unrestrictedand accepted with it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryDrawKeyRegistersline as #374; whichever lands second takes both ranges)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-03T06:28:26Z.
One exactness note: without VK_EXT_depth_range_unrestricted, out-of-range depth bounds are clamped to [0, 1]. That changes the result where the stored depth is exactly 0 or 1. For example, with DB_DEPTH_BOUNDS_MIN above 1 the hardware rejects every pixel, but after the clamp a pixel at depth 1 passes. Refusing bounds outside [0, 1] when the extension is missing would keep it exact; that's what my integration branch does.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-03T08:43:10Z.
Agreed, thanks. Pushed: bounds outside [0, 1] are now refused when
VK_EXT_depth_range_unrestrictedis missing instead of clamped, with a test, and the branch is rebased ontomain.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-03T11:40:30Z.
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.
main)core/libs/prx/libSceAgcDriver/Graphics/src/State.cppL705-707