AGC: ccleste (PPSA59322) on Intel Arc (Windows) stops on barycentric emulation after a mesh-path vertex program; a cold first run hits the title's 10 s GPU watchdog #5079
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 kq62 on 2026-10-13T10:57:38Z.
On Windows with an Intel Arc 140T, ccleste (PPSA59322) stops before its first frame in one of two ways, depending on whether the Vulkan pipeline cache is warm. This is the
ERROR_DEVICE_LOSTthat #4781 sets aside under "Separately".1. Cold pipeline cache: the title's GPU watchdog fires
Right after
Compute shader 0x201387f00 was not registered; preparing its artifact at dispatch, the title's own RADV logs this twice, thenVkResult is ERROR_DEVICE_LOST(vulkanexamplebase.cppline 838):On the next run, with the pipeline cache from the first run loaded (
[pipeline-cache] loaded 939.1 KiB), neither line appears. So the first-run stop looks like pipeline creation taking longer than the title's 10 s budget, as in #4399. I did not time the pipeline creation itself.2. Warm pipeline cache: no barycentric emulation route
With the cache warm, the title stops at presentation:
A temporary
fprintfbefore thatrequireinExecution/src/Driver/Draw/Draw.cpp(local only, not part of any PR) printed:path=1isShaderPath::Geometry, which with two programs puts the first program on the mesh path (Graphics/src/ShaderValidation.cpp). The generated geometry stage that emulates barycentrics is only built after a vertex shader, so this draw has no emulation route. Graphics shaders 0x201380000 and 0x201380900 are prepared just before the stop. On a device that exposes VK_KHR_fragment_shader_barycentric the emulation is not used, so this stop should be limited to devices without the extension.Setup
1eeb2c664, used so the pipeline cache can be saved on Intel (#4781). Onmaincac4e9688withANYPS5_NO_SHADER_CACHE=1, every run is a cold run and shows section 1, followed by the same barycentric stop.0x8086:0x7d51, driver32.0.101.899196861b81...), unpacked from its fake-signed SELF (ELF SHA-256e54c8a72...) and relinked with--windows --to-intelPossible approach
On the mesh path, the mesh shader has all three vertices of each primitive. It could write the primitive's three clip-space positions as per-primitive outputs, and the pixel shader could compute perspective-correct barycentrics from them and the fragment position. I have not checked whether this can match the hardware I/J values exactly.
I am working on a fix along these lines and will link a PR if it gets anywhere.
AI-assisted: yes (Claude).
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T11:16:07Z.
An AMD control for both stops: Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release,
main8bcd97cd5, ccleste 1.00 from the catalog, relinked with--windows.[shader-disk-cache] 0 hits, 8 misses, no pipeline cache file) it runs 60 s at ~100 FPS and draws the title screen. There is nohas not reached submissionline and no device loss. AMD's own driver shader cache was not cleared, though, and ccleste has run on this machine before. So this doesn't show how long a truly cold AMD compile takes.VK_KHR_fragment_shader_barycentric, so the emulation route is never used. That fits your reading that the stop is limited to devices without the extension.Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-13T11:38:04Z.
Without VK_KHR_fragment_shader_barycentric, a pixel shader that reads barycentrics after an NGG mesh program stops in Draw.cpp ("needs a vertex shader before it"). ccleste (PPSA59322) hits this: pixel shader 0x201380900 reads PERSP_CENTER I/J and two v_interp_mov P10/P20 parameters after mesh program 0x201380000.
The vertex path inserts a generated geometry stage. Vulkan does not allow one in a mesh pipeline, so the emulation has to be inside the mesh shader. The mesh program is compiled without its pixel shader (registration, PrepareGraphicsStages, draw capture), so it cannot know what to emit.
Proposal: an optional GraphicsCompileContext field carries the emulation layout (smooth/linear flags, per-vertex parameter source locations). The mesh shader then writes its clip position as a varying and the three clip positions per primitive; the pixel shader solves a 3x3 system for the barycentrics. Per-vertex parameters are staged in workgroup memory and written per primitive. The layout comes from the pixel shader's front-end program (no SPIR-V emission). The field is part of the shader cache key.
Not chosen: patching cached mesh SPIR-V afterwards (inserting into emitted code), and emitting every parameter per primitive (exceeds 128 output components on the Arc).
Cost: on devices without the extension, a mesh program feeding an emulating pixel shader is compiled twice (registration, then paired). With the extension the field is never set; nothing changes.
Verified so far: Intel Arc 140T limits fit ccleste, and a failing execution test (mesh draw with a barycentric-reading pixel shader) reproduces the missing route on the Arc. Not measured on PS5.
Is this direction acceptable?
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T13:01:22Z.
The proposed direction looks consistent with the current pipeline. On
main, barycentric emulation is attached to pixel compile results, andDraw.cppbuilds a generated geometry stage only for the vertex path; it explicitly rejects a mesh path. A mesh-specific layout carried into compilation is a reasonable route around that limitation.One cache detail needs to be part of the design:
CacheKeycurrently hashes the mesh configuration for mesh shaders, but not a fragment-derived barycentric layout. If the mesh SPIR-V starts emitting additional varyings based on the paired pixel shader, that layout must be included in the mesh shader's cache key (and serialized in captured requests if the new input crosses that boundary).For regression coverage, the existing failing mesh-plus-barycentric-pixel execution case is a useful base. It should verify reconstructed smooth and linear barycentrics and the per-vertex parameters actually consumed by the pixel shader, while also covering the host-extension path and preventing a cache hit from reusing a mesh module compiled for a different layout. The cold pipeline-watchdog report should remain a separate performance measurement.
Imported from boykopovar/AnyPS5. Originally posted by jackthereaper2006 on 2026-10-15T06:16:41Z.
Stop 2 reproduces on Linux with RADV on GCN 5, a device with neither
VK_KHR_fragment_shader_barycentricnorVK_EXT_mesh_shader. Here it happens on the cold run too, with no watchdog stop first.Setup: CachyOS, Linux 7.2.9, Ryzen 5 PRO 5650U iGPU,
AMD Radeon Graphics (RADV RENOIR)0x1638, Mesa 26.2.4, subgroup 64. GCC 16.2.1, Release,maind92a8dad3without extra PRs. ccleste 1.00 from darkxex/PS5_Celeste;PPSA59322.zipsha25696861b81c1fbaac818080d1bf958b575e6b44d2c258684e1931f2940cee2fb43.eboot.bin(SELF) andsce_module/libc.prx(fSELF) were unwrapped to ELF before relinking, and the title'slibc.prxwas converted as a guest module. Run withSDL_AUDIODRIVER=dummyandAPS5_NO_PAD_INPUT=1.MESA_SHADER_CACHE_DISABLE=trueBoth runs log the same sequence:
The program and pixel shader are at the same offsets as in @kq62's comment (
+0x0and+0x900); only the load address differs. Nohas not reached submissionline appears and there is no device loss, so stop 1 does not occur here.As I read
State.cppand the NGG entry indocs/dev/debt/libSceAgcDriver.md, this program is routed to the mesh path because it is an unregisteredPRIMGEN_ENprogram that uses LDS ors_barrier. This device has nomeshShader, so emulating barycentrics inside the mesh shader would not be enough here: the draw also needs a route that does not use mesh shaders. I have not tested that past this check. The device does exposeVK_AMD_shader_explicit_vertex_parameter, which AnyPS5 does not use today.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-15T07:02:04Z.
Thanks for the controls and the review.
@MarcZX100: agreed on all three points. The layout goes into the mesh cache key and into captured requests, and the tests will cover smooth and linear barycentrics, the per-vertex parameters the pixel shader reads, the unchanged path on devices with the extension, and a mesh module compiled for one layout not being reused for another. The cold watchdog stays a separate measurement.
@jackthereaper2006: thanks, that narrows the scope. The planned fix lives inside the mesh shader, so it only covers devices that have
meshShaderbut lackVK_KHR_fragment_shader_barycentric, such as the Arc. On devices without mesh shaders this draw still needs a route that doesn't use mesh shaders. That is out of scope for this fix, and the draw will keep throwing there with a clear message.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T20:04:25Z.
Scale data for stop 2 on another device without
VK_KHR_fragment_shader_barycentric: an Intel Arrow Lake iGPU on Mesa 26.1 ANV (Ubuntu VM),main44df21632, release build, 40 s runs of the catalog homebrew. 11 of 68 apps stop there, 0–2 s in, witha pixel shader that reads barycentrics without VK_KHR_fragment_shader_barycentric needs a vertex shader before it:ccleste (PPSA59322), Ruffle (PPSA68091), RommPS (PPSA76677), VLC (PPSA85300), PSXS5 (PPSA97510), SwanStationPS5 (PPSA98510), ProsperoAI (PPSA99004), Mortalfin (PPSA99141), Dusklight (PPSA99305), Mario 64 (PPSA99310), Porpoise (PPSA99764).
On the RTX 4070 Ti here, which has both extensions, none of these 11 stop on that check. @kq62, when your change is up I can run these 11 on this Intel VM before and after.
Correction (10-16): this device does expose
VK_EXT_mesh_shader(maxMeshOutputMemorySize32768); I had that wrong. Before/after results with #6941 are on #6941.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by overlordxrz-source on 2026-10-15T23:18:07Z.
Another device for stop 2: Mesa lavapipe (llvmpipe, LLVM 21.1.8), Linux x86_64 under Xvfb,
mainb7cedd900, 120 s runs of the catalog homebrew. lavapipe has noVK_KHR_fragment_shader_barycentric. 10 of 86 titles stop ona pixel shader that reads barycentrics without VK_KHR_fragment_shader_barycentric needs a vertex shader before it:ccleste (PPSA59322), RommPS (PPSA76677), PSXS5 (PPSA97510), SwanStationPS5 (PPSA98510), Mortalfin (PPSA99141), PSSwanStation (PPSA99248), Mario 64 (PPSA99310), Ship of Harkinian Vulkan (PPSA99320), Wind Waker HD (PPSA99641), Porpoise (PPSA99764).
In every log, the failing draw's program and pixel shader are first prepared at use, with no
Rect-list draw ... preparing it at drawline for that pair. That matches the mesh-path reading (path=1) rather than a rect-list draw. As a cross-check, I compiled the UI kit's SPIR-V from ccleste's eboot.bin with host RADV/ACO (Mesa 25.0.7, navi21 null device). The vertex shader comes out as an NGG program with LDS ands_barrier(culling), which is the caseVertexWorkgroupRequiredsends to the mesh path.I can rerun these 10 on lavapipe before and after your change, once the PR is up.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T18:59:22Z.
Thanks, this is very useful scale data.
@milescoviello: as far as I can tell, that VM exposes no
VK_EXT_mesh_shader, like jackthereaper2006's GCN 5. The planned fix lives inside the mesh shader, so on that device those 11 apps would still stop, only with a clearer message. A before/after run there would still confirm that nothing else changes.@overlordxrz-source: thanks for the cross-check against the mesh path. Does lavapipe expose
VK_EXT_mesh_shaderon your setup? If it does, it has exactly the combination the fix targets (mesh shaders without the barycentric extension), so a before/after run of those 10 would be the most useful test. I'll ping you both when the PR is up.AI-assisted: yes (Claude).
Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T19:14:31Z.
Correction on lavapipe: it does expose
VK_EXT_mesh_shader, but commit1d6968225records that mesh pipeline draws die with an LLVM error on Mesa 25.2.8 / LLVM 20.1.2, which is why the mesh execution test skips on llvmpipe. So with the fix, lavapipe titles may move from this clean error to that LLVM crash. @overlordxrz-source, a before/after run on your LLVM 21.1.8 would show whether that crash still happens.Imported from boykopovar/AnyPS5. Originally posted by kq62 on 2026-10-16T20:35:26Z.
The fix is up in #6941. @milescoviello @overlordxrz-source, a before/after run of your lists would help, especially on devices that expose
VK_EXT_mesh_shader. On devices without mesh shaders the draw should still stop, now with a message naming both missing features.