fix(agc): prepare the push-less pixel variant only without fixed push slots #9563
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9563"
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 EagleBearerYS on 2026-10-22T02:28:18Z.
What
Registration prepares every pixel shader twice: once for its push slot, and once more with no push constants, for pipelines that leave the pixel stage no push room. With fixed push slots (graphics pipeline libraries), every graphics ABI gives the pixel stage its own
PipelinePushSlotBytesslot (StagePushOffset, and the room the ABI resolution computes). So no draw asks for the second variant. It is compiled, cached and kept for nothing, and it doubles the pixel work at registration.This is fable-void's 22e072b3d6 from his fork (
wip/new-gpu-path), with his authorship:8ab3fa05c8(fable-void):DriverDetail::RegistrationRequestslists the requests registration prepares. The push-less pixel variant is among them only for a target without fixed push slots; the partial-workgroup compute variant stays. His conflict withmain's ShaderRegistry was resolved tomain'sInvocationFor/CaptureInvocation, float-mode helpers, library prebuild switch and undrawn-plan release.7d177f1671(counter): withAPS5_PROFILE_DRAWset, the[draw] driver phasesline ends withpush-less pixel variants left out at registration N (cumulative). Without the profile it costs one test of astatic const bool.If a draw ever did ask for the variant, it would be prepared at the draw, as any variant registration didn't predict is (#2917).
fable-void's evidence, from his commit: a title that registers about 3,100 pixel shaders kept 8,840 variants with 3.7 GiB of SPIR-V. Its second pixel variants were about 1.3 GiB of that, and 97 % byte-identical to the first (counted over its shader disk cache).
Overlap: checked with
git merge-treeagainst every open PR touching these files, onmaindf2569d2c5. One conflicts:PrepareRegisteredand keeps the old variant block after it. The two compose: #9508's prebuild code stays, andRegistrationRequestsreplaces the variant block. Neither waits for the other, agreed in #9508's thread (reply): if #9508 merges first, this PR rebases, and if this one does, the resolved merge goes on a fork branch for #9508 to take (note).Tested
agc_driver_prepared_shadersgainsRegistrationVariants: one pixel request with fixed push slots, two without, and two compute requests.RegistrationRequests, somain's code can't build it. The red tree is this PR with only the!request.target.fixedPushSlotscondition removed.maincf2c667060. That's 1812/1818, with the same 6 failures asmain(IPv6 and socket-buffer tests on that machine), and^agc×3 with only the two fill tests that flake onmaintoo.mainagainst this PR (CONTRIBUTING's AGC rule), on one GitHub Linux runner (run). Both runs usedVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V, withVK_LOADER_DEBUG=layerto show the layer loading. The device was llvmpipe (LLVM 20.1.2) on Mesa 25.2.8, Ubuntu 24.04.5, Khronos validation layers 1.3.275.agc_driver_prepared_shaders, which registers this PR's pixel variants on the real device, andagc_driver_graphics.main's tree ran them once and this PR's three times.VK_LAYER_KHRONOS_validation3 times onmainand 9 with this PR, and neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS.VUID-VkDeviceCreateInfo-pNext-pNext, for a device-creation structure newer than that layer version. This PR adds noVUID-message.b3ef558f50,mainb7d1d47a5fmerged in (clean; the PR's own diff is unchanged), on GitHub's runners (run):agc_driver_prepared_shadersandagc_driver_graphicspass 10 of 10 on Linux, none skipped. On Windows they build and pass, and one of the two skips without a Vulkan device.mainagainst this head, on the Linux runner: the loader insertedVK_LAYER_KHRONOS_validation3 times onmainand 30 with this PR, and neither log haswas not found. Both logs report onlyVUID-VkDeviceCreateInfo-pNext-pNext, so this PR adds noVUID-message.guest_raise_in_system_callfailed in the first attempt with this head, and the rerun of that job passed both suites. The libc and libkernel suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.check_conventions.pypasses, with no comment lines added.APS5_PROFILE_DRAW=1; no fatal error. Every[draw] driver phasesline reportspush-less pixel variants left out at registration 0andlibrary prebuilds refused at registration 0 (cumulative), so this title doesn't reach the case. The unit test above is this PR's evidence; no title we run shows the counter yet.b3ef558f50merged ontomaind4cb89300fagainst thatmain, built in the same tree, all 1,125^agc_tests underVK_LAYER_KHRONOS_validationwithANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1. Both sides: 1,117 pass, 0 fail, 8 skip, the same skips, and the same 18VUID-lines per test, allVUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605fromagc_driver_prepared_exportsandagc_driver_srgb8_color_target, whichmainhas too (#11990). Every device test selected the RTX 4070. No title was run.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)RegistrationVariantsruns before the test opens a device. The rest ofagc_driver_prepared_shadersran on Mesa llvmpipe (LLVM 20.1.2), Ubuntu 24.04, GitHub's Linux runner. The validation comparison ran on Mesa llvmpipe (LLVM 20.1.2, Mesa 25.2.8), Ubuntu 24.04.5, GitHub's Linux runner. GitHub's Windows runner has no Vulkan device. NVIDIA GeForce RTX 4070 Laptop GPU (616.92), Windows 11, in JulesB40's run of allagc_tests againstmain.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:01:12Z.
Early review feedback while this remains a draft: the focused request-list test covers fixed-push pixel, non-fixed-push pixel and partial-workgroup compute cases, and the reported red/green result is useful. Before marking it ready, please coordinate the shared
ShaderRegistry.cppwork with #9508’s author and record an agreed integration order; addDepends onif one must land first. The PR describes how the changes compose, but I could not find a direct agreement on this PR yet. Also, because this changes AGC driver code, the repository requires a focused main/change Vulkan validation-layer run on the same machine and GPU, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, layer-loaded confirmation and VUID comparison. The CPU-only request-list test is valuable but does not provide that report. I did not run tests locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:19:48Z.
Review: APPROVED
RegistrationRequestspreserves the partial-workgroup compute variant and emits the push-less pixel variant only when the target lacks fixed push slots.PrepareRegisteredprepares the first request, retains library prebuild behavior, then prepares only the remaining requests. The regression checks one pixel request for fixed slots, two with the expected push sizes without fixed slots, and both compute variants. I found no correctness issue in the changed logic. The PR reports Linux/Windows red/green runs with 10 green repeats and a focused same-runner Khronos validation comparison; the layer was confirmed loaded and no new VUIDs appeared. Hosted eligibility, intake, labels, report and conventions pass; product Linux/Windows and relinker jobs are skipped. I could not run a local build because the filesystem is full, so I rely on the reported CI runs rather than claiming local test execution. Current-basediff --checkand conventions pass.check_main_sync.pyreports 2 ahead / 116 behind (94fbb8ceamerge base), cleanly mergeable; please refresh from currentmainbefore merge. #9508 is not in this branch's ancestry, but its author has agreed #9563 and #9564 can merge in either order; preserve the prebuild changes in #9508 and letRegistrationRequestsreplace the push-less variant block when composing them. The automated overlap report is partial because older PRs conflict withmain; no competing implementation of this request-filtering change was found. Approval is for this reviewed head only.I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:26:31Z.
Review: CHANGES_REQUESTED
The registration filter still appears correct: fixed-push targets retain only the pushed pixel request, non-fixed targets retain both, and both compute variants remain. The PR reports Linux/Windows red-green runs with 10 focused repeats plus the required same-runner validation-layer comparison; no new VUID was reported. Hosted policy checks pass, while full product and relinker jobs are skipped. I did not run a local GPU build.
Against current upstream/main
329efe1bfdaff116c57cdf62718026ee4f5521ae, the branch is 2 ahead / 161 behind (merge base94fbb8cea80af91db62ab6ee7e4da23341675c40). Current merge-tree is clean,git diff --checkpasses, and current-base conventions pass. Please refresh to current main and rerunagc_driver_prepared_shadersplus the focused Vulkan validation comparison before merge; the branch rule requires an up-to-date base.#9508 is still open at
9f5e875b95d6a5bbee580b03b36ed7773fd80aa0. A current pairwise merge-tree conflicts inShaderRegistry.cpp; the description records the agreed no-wait composition, preserving #9508’s library prebuild and this PR’sRegistrationRequestsfilter. Keep that composition and the agreed merge flexibility in the next integration check. I found no duplicate implementation of the push-less request filtering.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.