feat(agc): present 16-bit float display buffers #3134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3134"
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 SleglJan on 2026-10-10T22:51:32Z.
What
Presents display buffers in pixel formats
0xC001000622000000and0xC001000600000000, R16G16B16A16 and B16G16R16A16 float as KytyPS5 maps them and SharpProspero names them (Rgba16Float,Bgra16Float). PPSA11386 (007 First Light) registers 3840x2160 tiled buffers of the first (tiling 0, no DCC) and stops onVideoOut: unsupported display pixel format 0xc001000622000000.TextureSwizzleEquations.hppapplied to full coordinates, as AMD addrlib applies it (PAL addrlib,ComputeSurfaceAddrFromCoordMacroTiled) andTextureDetile.compdoes; 128x64 texels per 64 KiB block.ColorTargetLayoutapplies the equations to in-block coordinates, which differs for 8-byte texels in every odd 64-row block row (address bit 11 takes y bit 6), and for 16-byte texels also in every odd 64-column block column (address bit 10 takes x bit 6); recorded in TechnicalDebt, not changed here.0x06, as in its 10-bit formats without sRGB transfer; its sRGB formats have0x00, its 10-bit PQ formats0x04and its float BT.2100 PQ formats0x07). Neither the layout nor the transfer is verified against console frames; HDR output is not modelled.GpuColorTransfer::Detile), the resident image path (DetileImageof an R16G16B16A16_SFLOAT image,ResidentPresent::Convert, never a blit) and the CPU decode handle both formats. DCC metadata on a float buffer, and writing float texels back to the guest, throw.DisplayBufferOffsetis added for the layout tests.This is 007's next stop on
mainnow that #2946 (SharePlay) is merged: row 4 of #2523.Overlap: no open pull request changes DisplayBuffer, DisplayFormat, GpuColorTransfer, HalfFloatScanout or the display buffer tests.
Tested
BUILD_TESTING=ONandANYPS5_ENABLE_SPIRV_TOOLS=ON, this branch onmaina883f22f:cteston the RTX 3080: of 717 tests, 712 pass. Fourvideo_out_flip_*tests (lifetime, reopen, controls, overlay) skip, because SDL's offscreen video driver has no Vulkan.agc_driver_dcc_keys_first_writefails, which is #2767.linear_display_bufferandagc_driver_bda_devicepass 3 repeats on each GPU, forced withVK_DRIVER_FILES.tools/check_conventions.py --base upstream/main,tools/check_test_registration.pyandgit diff --checkpass.linear_display_buffer(CPU): the decode of hand-computed half values in both channel orders, sizes, and offsets of every texel of a 300x200 buffer against the equation table on full coordinates for 4- and 8-byte texels. Also the rejection of DCC and of an unknown float variant, the format decisions, and all 65,536 half bit patterns against an independentfloor(255 * sRGB(v) + 0.5)reference.agc_driver_bda_device(ColorTransferTests, Vulkan): random halves, including NaN, infinities, denormals and negative zero, in both channel orders through guest-memory detile and throughDetileImageof an R16G16B16A16_SFLOAT image, against a reference built from the equation table and the shared tables.ResidentPresent.cppruns only in the fullagc_driver_recorder_testsexecutable. ctest runs that executable only in its--*-onlymodes. Run by hand on each GPU, it printsresident present format and conversion tests passed. The executable then fails a later test: on NVIDIA a guest allocation is still pinned after 60 s, on RADV storage-image results are still pending. The same executable built frommaina883f22ffails the same way on both.linear_display_buffer: dropping the y-bit-6 term of the CPU layout, a 128-row instead of 64-row block height, a linear instead of sRGB threshold table, swapped red and blue, and skipping the DCC check;agc_driver_bda_device: dropping the y-bit-6 term of the shader layout, and removing the shader's NaN/negative guard.maina883f22fit stops after 0.6 s onVideoOut: unsupported display pixel format 0xc001000622000000(SIGABRT).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)🤖 Generated with Claude Code
https://claude.ai/code/session_01Fnrk5Dazjb2tLooVSpdRQq
Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-10T23:24:10Z.
Review: COMMENTED
This is the acceptance bar answered in full: a named title (PPSA11386, 007 First Light), the exact line it stops on (
unsupported display pixel format 0xc001000622000000), the buffer geometry and the tiling. That is what makes a display-format change landable without an argument.Two external references, and they are not of equal weight. SharpProspero is an independent implementation, so its names for these two formats are real corroboration. KytyPS5 is the weaker one to lean on: it shares lineage and house style with this project, so a mapping taken from it may agree with us for reasons that are not independent. Worth noting that the recorded evidence for that lineage is shared decoder style rather than format tables, so it is a caution here rather than a demonstration.
The details worth keeping are the ones a reader would otherwise get wrong: eight bytes per texel, and the fact that the two identifiers differ in one field while naming different channel orders — exactly the pair that gets collapsed into a single enum by mistake. Carrying the presented-frame transfer in a shader is the right place for it, since it keeps the work on the device that already holds the data; and the CPU decode path stays for the resident and reference cases, so the two share the threshold tables rather than one replacing the other.
One question about scope. The description registers the first format and stops on it; is the second exercised by a title yet, or is it included because it is the same code path — and either way, does the test pin both identifiers rather than only the one that was seen?
Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-10T23:33:13Z.
@Dextroid17 thanks for the review.
Is the second format used by a title? None that I've seen. 007's
0xC001000622000000is the only format I've observed, and it's the one the title stops on. Nothing I've logged shows0xC001000600000000.0xC001000600000000is included because SharpProspero (Bgra16Float) and KytyPS5 (bgra16) define it as the same eight-byte layout with red and blue swapped. In this change the two differ only inDisplayRedLow, which picks the channel order for the decode and for the shader.Do the tests pin both identifiers? Yes.
linear_display_buffer(HalfFloatDisplay) sets each identifier on a buffer and checks the format decision, the Vulkan texel format, eight bytes per texel, the red-low flag, and the decode of hand-computed halves in its channel order.agc_driver_bda_deviceruns the GPU detile in both channel orders.On the references, agreed: SharpProspero is the independent source for the names. The tiled layout is an assumption that doesn't rest on either project: addrlib's 8-byte SW_64KB_R_X equation, which
TextureDetile.compalready applies to R_X textures. It isn't verified against console frames.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T01:35:09Z.
Windows run, since the PR has no Windows results yet: Windows 11, WinLibs GCC 15.2.0 r7, Release, merged onto
maind31b57a4in one build with #3039, #3134, #3175 and #3194, on an RTX 5060 Laptop and the Arrow Lake iGPU (ANYPS5_GPU=Intel).linear_display_bufferandagc_driver_bda_device(which buildsColorTransferTests.cpp) pass on both GPUs.agc_driver_recorder_testsfor theResidentPresent.cppchange: "Recorder read tracking and label tests passed" on both.Across all
agc_*tests in that build, the only new failure on either GPU isagc_driver_flat_store, which comes from #3175 alone (reported there). The Intel failures besides it are the known ones from #2114 and #3207.AI-assisted (Claude Code); I ran this on my machine.