feat(agc): present BT.2100 PQ display buffers on an SDR output #5696
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5696"
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 gjonn on 2026-10-14T07:10:33Z.
What
Presents display buffers in the 10-bit BT.2100 PQ pixel formats
0x8100070422000000(red in the low bits) and0x8100070400000000(blue in the low bits) instead of throwingVideoOut: unsupported display pixel formatatsceVideoOutRegisterBuffers2.The format values come from open references: SharpProspero names both (
Rgb10A2Bt2100Pq,Bgr10A2Bt2100Pq) and KytyPS5 maps the first (VIDEO_OUT_PIXEL_FORMAT_R10_G10_B10_A2_BT2100_PQ). PPSA01317 registers the first itself. Main's output is SDR, so the texels are converted to 8-bit sRGB when presented:sceSystemServiceGetHdrToneMapLuminancereports. On main that is always 100 nits, which is now one shared constant (ToneMapLuminance.hpp), so the shoulder reduces to a clip at 100 nits. The follow-up HDR output PR makes the white level follow the luminance reported to the title.Every display path main has converts them:
DecodeDisplayBufferon the CPU.GpuColorTransfer::Detile, as a new mode ofColorTransfer.comp.PresentationPass.frag(#5311's resident present without the 4K convert chain).ResidentPresentPathreturns Convert for these formats, so a PQ image is never blitted.DisplayBufferClearPixel.The two shaders share
Graphics/shaders/PqToSdr.glslthroughGL_GOOGLE_include_directive. Other format values with PQ or BT.2020 bits (8-bit, float, linear transfer) still throw. The technical debt entry records the open references, and that the tone map is ours: how a console shows such a buffer on an SDR display is unknown.Overlap:
ColorTransfer.compand the descriptor setup inGpuColorTransfer.cppfor the half-float table. This PR adds binding 3 next to it. The changes touch neighbouring lines but different functions.Tested
Windows 11 (10.0.26220), MinGW-w64 GCC 15.2.0, Release,
BUILD_TESTING=ON, this branch onmaind8888df9b.linear_display_buffer(CPU):agc_display_buffer_dcc(CPU): fast-clear codes 0000 and 1111, and register clears in both orders.agc_resident_present(Vulkan): GPU detile of random tiled PQ texels from guest memory against the CPU conversion, within one level, at 100, 1000 and 150 nits.agc_driver_presentation_pass(Vulkan): resident PQ images in A2B10G10R10 and A2R10G10B10, both orders, at 100 and 1000 nits, against the CPU conversion:agc_driver_bda_deviceandguest_system_servicepass unchanged.mainthese tests fail:DisplayBufferSizethrows for both formats, andDisplayTexelFormat(0x8100070422000000)returns the blue-low format.agc_resident_present. A wrong knee or a hard-coded white level in the fragment shader failsagc_driver_presentation_passat 1000 nits.tools/check_conventions.py --base origin/mainpasses.mainran the title on Windows from a local tree, with the HDR output of the follow-up PR. This branch was not run in the title, and the SDR conversion has not been compared with the title's frames.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T07:16:27Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/include/GpuColorTransfer.hppL38core/libs/prx/libSceAgcDriver/Graphics/shaders/ColorTransfer.compL6core/libs/prx/libSceAgcDriver/Graphics/src/GpuColorTransfer.cppL5-6, L55-65Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T10:42:45Z.
Checked on the PR merged onto main:
agc_display_buffer_dcc,agc_resident_present,agc_driver_presentation_passandlinear_display_bufferpass, the new tests don't build without the change, the CPU, compute and fragment paths agree within the stated tolerances, and the debt entry records that the tone map is ours. Resident PQ images always go through the presentation pass, so theDetileImagepath never sees them. Merging once the full Windows build is green.