fix(shader): record BDA faults in hull programs instead of refusing them #4222
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4222"
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 Celegans12 on 2026-10-12T01:45:14Z.
What
Stacked on #4201; please review the last commit only.
A hull (tessellation-control) program with a BDA read fails to compile with "BDA fault termination requires a barrier-safe tessellation-control execution protocol". The refusal dates from the first BDA commit and is now redundant:
BdaInvocationsMayStopalready switches any program that containss_barrierto the non-stopping fault protocol, and a hull's only barriers come from guests_barrier(EmitBarrier); the LDS-lock barrier runs before any guest code and wave-LDS barriers are compute-only.s_barrierkeeps every invocation to its barriers; a hull without one may stop a faulting invocation, since no barrier can be stranded.BdaContractsasserted the refusal and now accepts a hull withs_barrier.PPSA26344's terrain hull 0x80002fc700 has no
s_barrierand reads guest memory through BDA. With this change, its replayed request recompiles completely (388,903 SPIR-V words) onceGE_CNTL.BREAK_WAVE_AT_EOIis set in the request; the title clears that bit, which #4201 refuses and #4450 handles.Tested
Based on
mainf265cd55plus #4172 and #4201. Windows 11 (MinGW-w64 GCC 15.2.0) and Linux: configure -DBUILD_TESTING=ON, targeted test builds, ctest.agc_driver_tessellation,agc_shader_memory,agc_driver_graphics,agc_tessellation_factor_ringandagc_driver_bda_devicepass (5/5)main: the same 5 tests pass (5/5)log_macros, which fails onmaintoo; Linux (upstream's job in WSL) merged withmain5a81f608: 1089/1091,agc_driver_bc_block_copyandagc_driver_depth_compare_copyfail on thatmainas wellagc_driver_tessellationgains two hulls that scale their output by a float read through BDA, with and withouts_barrier: both render correctly, and an unmapped read reportsBDA access failed ... stage=7. Both this andagc_driver_bda_devicefail on #4201's head with the refusal. The unmapped-read draws are skipped on llvmpipe, which segfaults on them although the loads are guarded byif (physical != 0)and removing just those guarded loads stops the crash; the mapped-read draws run there.Not tested: console behaviour.
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)Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T13:18:31Z.
Rebase handoff — this PR is the 5th link of the hull/tessellation chain (it contains #4172 and #4201 underneath its own commit), so I stacked the rebase on the already-rebased chain:
rebase/4114→ … →rebase/4201→ this. Authorship unchanged; applied cleanly.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesTo pick it up (whole chain):
Head is
d321aca7b. Worth listing Depends on: #4114, #4163, #4172, #4201 in the description so the chain merges in order.Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-14T01:56:42Z.
Quick note: I restacked this on the new #4172 and #4201 heads. The only conflict was the order of the test calls in
Tessellation.cpp; this commit's own diff is unchanged. On this head,agc_driver_tessellation,agc_shader_memory,agc_driver_graphics,agc_tessellation_factor_ringandagc_driver_bda_devicepass on Windows (NVIDIA) and on Linux (llvmpipe, merged withmain).