Repository navigation
feat(agc): depth bounds test and depth bias - #376
Conversation
|
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. |
DB_DEPTH_CONTROL's DEPTH_BOUNDS_ENABLE now runs the Vulkan depth bounds test with DB_DEPTH_BOUNDS_MIN/MAX, and PA_SU_SC_MODE_CNTL's POLY_OFFSET_FRONT/BACK_ENABLE enable depth bias from PA_SU_POLY_OFFSET_FRONT/BACK_SCALE/OFFSET and _CLAMP. Both are dynamic state, so draws that differ only in their values share a pipeline. The hardware slope scale is in 1/16 units. Depth bias with units other than the depth format's (PA_SU_POLY_OFFSET_DB_FMT_CNTL), or that differs between front and back faces that are both drawn, is refused. The registers join the draw key. Depth-conditional color writes are still refused. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ge_unrestricted Clamping them changed the result where the stored depth is exactly 0 or 1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3b63acd to
057bcb1
Compare
|
Agreed, thanks. Pushed: bounds outside [0, 1] are now refused when |
|
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.
|
Takes the 13 gate-batch PRs that merged upstream (boykopovar#319 boykopovar#329 boykopovar#330 boykopovar#331 boykopovar#325 boykopovar#435 boykopovar#471 boykopovar#294 boykopovar#376 boykopovar#404 boykopovar#394 boykopovar#401 boykopovar#446) in place of astrobot's local versions, as integ/gate-batch cab0eab had them: boykopovar#294 and boykopovar#376 in astrobot's depth model (DepthTarget, state.depth), boykopovar#394 with the thick mip tails, boykopovar#401 over astrobot's slab pool, boykopovar#471 keeping the settled single-lane path. Also takes the rest of main since a818bee (boykopovar#532 boykopovar#340 boykopovar#486 boykopovar#484 boykopovar#316 boykopovar#243 boykopovar#334 boykopovar#434 boykopovar#437 boykopovar#470 boykopovar#373 boykopovar#452 boykopovar#455 and our upstreamed PRs, where astrobot keeps its later revisions and env switches). Resolution notes: relinker converter/matcher/tests are upstream's (boykopovar#432 decoder covers VEX RIP-relative followers); RecompileResult gains boykopovar#316's hostSubgroupSize (set from request.target.subgroupSize); shader disk cache format 9; boykopovar#452's scissor message; upstream's later live-stack and memory-copy decode tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mgp3oZvembQziVNE2xARQK
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 fix(agc): depth fast clears through the HTILE metadata #374; whichever lands second takes both ranges)🤖 Generated with Claude Code