fix(shader): match half-wave reductions in vertex programs #2450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2450"
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 oneandonlydean on 2026-10-09T21:27:58Z.
What
emitEntryProloguesets a program's entry EXEC to:!gl_HelperInvocationin a pixel program;truein vertex, local and tessellation programs.#1268's half-wave reduction matcher (
EntryLaneWalk) proves keys are the identity outside the entry EXEC, but it only knew the pixel form. Every wave64 vertex program that scans keys selected under its EXEC and reads lane 63 therefore threw on a 32-lane host subgroup:EntryLaneWalknow also accepts a ballot oftrueas within the entry EXEC for those stages. Every invocation is live at their entry, and a later ballot oftrueholds only invocations that are still active.These keep their existing forms:
truethere includes helper invocations;The emitted reduction is #1268's.
Touches
core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp.The level in the test below needs this and "fix(shader): read lane 63 of a wave64 v_max_f32/v_min_f32 half-wave scan" together; the two are independent and either can go in first.
Tested
maina8b032b236: ctest 495/495.tools/check_conventions.pypasses.agc_shader_memory,verifyHalfWaveReduction:mainit throws the line above withstage=1.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 repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T22:46:54Z.
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
c8c90995, merged ontomain09a3462ein one build with #2473, which currentmainneeds to build on Windows, and 3 other new PRs.agc_shader_memoryandagc_shader_bindless.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-09T22:50:16Z.
Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at
c8c90995:/tmp/anyps5_build) with zero warnings/errors.python3 tools/check_conventions.py --base origin/main --head HEAD-> PASS (0 errors).SpirvAluEmitterMath.cpp. Extends reduction recognition from compute/fragment to vertex pipelines.LGTM!