perf(agc): use a packed device-local LUT for half-float scanout #5581
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5581"
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 KROU4 on 2026-10-14T00:15:12Z.
Draft status and title evidence
This remains a draft. The available real-title run does not demonstrate a
half-float title gain: PS5 DOOM v1.1.1 uses an RGBA8_SRGB tiled scanout. Three
clean 240-present traces completed at 1920x1080 on the RTX 3060 Ti, but that
workload exercises the unchanged 8-bit path. A title/scene using half-float
scanout is still required to satisfy the repository's performance-evidence
requirement. The compute benchmark below is supporting kernel evidence only;
it is not an FPS or end-to-end frame-time claim.
Upstream records tiled RGBA16F scanout for PPSA11386 in
AGC technical debt,
but its bring-up stops before
stable presented frames. The public homebrew candidates inspected did not
provide an original, working half-float scanout workload.
What
Replace four eight-step binary searches per half-float pixel in
ColorTransfer.compwith one packed LUT lookup per channel. The 63,492-bytetable is generated from the existing thresholds and uploaded once into
device-local memory. RGB/alpha rounding, negative values, infinities, NaNs,
channel order, the 8-bit path, and the CPU reference retain their existing
results.
Add exhaustive coverage of all 65,536 half patterns in each RGBA channel, both
red/blue orders, and both guest-memory and image-copy paths. Existing random
cases and assertions remain. Five files change; no dependency or
vendor-specific branch is added.
RTX 3060 Ti compute benchmark
On an RTX 3060 Ti, the full shader's median compute-stage GPU interval was:
Eight scenarios used 31 alternating pairs after warm-up (496 timestamp
samples). Readback and exhaustive per-channel comparisons passed. Both tables
were device-local. Timestamps exclude initialization, uploads, CPU work, waits,
and readback. The 4K baseline tails were variable: p95 was 3.636192 ms for
positive half data and 2.282512 ms for tiled positive half data, so the table
uses the predeclared median. The 8-bit controls were 0.050048 -> 0.050048 ms at
1080p and 0.193216 -> 0.192608 ms at 4K.
The measured prototype SPIR-V SHA-256 is
CEC55C0624653E42117E549715EF75472D59DE5D2E0046E31BBC296557252DF1.The build-generated production SPIR-V is byte-identical to the measured file.
The benchmark was recorded at change
725224be9f1d83786e3749e4c135031d32dce127on main
77b9f7270c25518d26052671311f43497328fdc7; the measured shader source isunchanged at the prepared revision.
The trade-off is one initialization update/fence wait per transfer object and a
64 KiB device-local pool slot. A new device-local pool size class can reserve a
minimum 2 MiB slab. The LUT is recorded with
vkCmdUpdateBuffer; compile-timechecks enforce its 64 KiB and four-byte size limits. This avoids a temporary host
staging buffer and its retained host-visible slab; command-buffer storage for
the update still has a driver-managed cost. Synchronization follows the
existing private
CommandBatchinitialization pattern and uses atransfer-write to compute-read barrier.
Tested
The latest full run passed on a combined integration tree, not on the
GPU-only PR. Tested tree
9e65300c03a3ac4137c6b8f3550aa97dd6c063ddis mainee9037d85154d0c840517c46c61087a736fe0641plus this GPU change1e187fb4d33791939b422b9c458760903ade8b16and the separatelegacy CRT log-stream fix.
That seven-file relinker patch stays outside this five-file GPU diff.
The original
windows_import_modulesfailure reproduces on clean maince5c8395333fbd4bfacdc35065f886333162caa5: MSVCRT stdout is absent from the GUIlog. The separate patch repairs missing FILE state and shares the original
native file handle/position, preserving inherited streams. Original and added
mixed UCRT/MSVCRT cases pass, including Unicode paths, changed CWD, exact
message counts and preservation of the native startup prefix. No assertion or
timeout was weakened. Independent source review found no remaining issue.
Windows 11 build 26200, Ryzen 5 5600, RTX 3060 Ti 8 GiB, NVIDIA 617.14,
Vulkan 1.4.351, WinLibs GCC 15.2 UCRT, Release.
agc_driver_stencil_ref_export(missing VK_EXT_shader_stencil_export);guest_video_out_wqhd_detection_no_vulkan(intentional missing-Vulkan-ICD fixture).agc_driver_graphics, including exhaustive half-float checks, passed in 7.75 s.conventions_function_bodiespassed in 51.04 s; no timeout was changed.88649c3a93abe685b715042ea4ed5b1597c4e0e6on mainfeddf7f4c654112663b7576c8a1bc3b87657396d: 1114 passed, 2 expected skips, 1 failed out of 1117. That original failed result remains in its attachment.BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ON,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_GPU=NVIDIA GeForce RTX 3060 Ti, andANYPS5_VIDEO_OUT_TEST_DRIVER=windows.vkCmdUpdateBufferupload change is covered by this full integration run; earlier kernel timestamps exclude initialization.The standalone GPU PR still requires resolution of the upstream Windows
failure. The passing combined run does not replace the GPU-only result or
demonstrate a half-float title gain. The PR remains a draft. The relinker fix
is published as a separate fork branch; it is not merged upstream, and no
additional upstream PR was opened over the first-contributor limit.
Evidence attachments
Reproducible benchmark, shader sources and all 496 samples
Full-suite results, clean-main failure reproduction and nine title traces
Combined full-suite JUnit, clean-main failure, regression checks and separate relinker patch
Checklist
The title-performance requirement remains open as described above: a real
half-float title/scene before/after profile is still required. This draft
does not claim that the kernel benchmark satisfies that requirement.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:35:37Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
1e187fb4d33791939b422b9c458760903ade8b16using the prepared diff andrepo_read.py. No commands or tests were run. I read all five changed files listed as reviewed in the manifest; none were excluded.Results
Findings
Blocking
None.
Non-blocking
Not verified
To get this to a good state
Nothing is required. Optional: provide a real half-float title or scene profile and a passing full-suite result on the GPU-only PR revision.
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.