Skip to content

feat(videoout): apply the output gamma from sceVideoOutAdjustColor - #4040

Open
ee6aba54 wants to merge 1 commit into
boykopovar:mainfrom
ee6aba54:feat/videoout-output-gamma
Open

ee6aba54 wants to merge 1 commit into
boykopovar:mainfrom
ee6aba54:feat/videoout-output-gamma

Conversation

@ee6aba54

@ee6aba54 ee6aba54 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

sceVideoOutAdjustColor stored the gamma of the color settings, but presentation ignored it. PPSA18391 (engine: Clickteam Fusion) sets a gamma of 2.0 and looks washed out without it.

VideoOut now passes the gamma to the driver (AgcDriverSetOutputGamma_nid_postfix). When it is not 1, presentation copies the finished swapchain image into an RGBA8 storage image, applies out = in ^ gamma to the color channels in a compute pass (OutputGamma.comp) and copies the result back. Swapchain images are created as transfer sources when the surface allows it. Frame dumps (APS5_DUMP_FRAMES) apply the same gamma, so they match the presented image. The console's transfer curve and value range are unverified on hardware; the TechnicalDebt entry for sceVideoOutAdjustColor says so.

Tested

  • Ubuntu 24.04, Linux 7.0, GCC 13.3, Release, rebased onto 18c438b10. agc_driver_graphics gains outputGammaTests: gamma 1 leaves the image unchanged, gamma 2 maps 128 to 64, 51 to 10 and 204 to 163 and keeps alpha. agc_driver_graphics and the video_out tests pass on the rebased branch; the full ctest run (992 tests) was on the previous base 5efd09afc.
  • PPSA18391: with gamma 2.0 applied, the title screen matches a recording from the console; checked by hand on an earlier base.
  • Windows not built or tested.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

@ee6aba54
ee6aba54 force-pushed the feat/videoout-output-gamma branch from 29dbbf0 to 191ac23 Compare October 11, 2026 22:26
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@ee6aba54
ee6aba54 force-pushed the feat/videoout-output-gamma branch from 191ac23 to cf1d324 Compare October 12, 2026 10:09
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@ee6aba54
ee6aba54 force-pushed the feat/videoout-output-gamma branch from cf1d324 to 4b0d722 Compare October 12, 2026 21:18
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 12, 2026
@fogydes

fogydes commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Status check against current main 1e20650e84 (head 366c6e4148):

  1. Stale + conflicting: 8,496 commits behind base dacd78525e; git merge-tree conflicts in core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp, core/libs/prx/libSceVideoOut/src/Output.cpp and docs/dev/debt/libSceVideoOut.md. VulkanDevice.cpp in particular has heavy churn upstream since the base. [verified]
  2. The work is not yet duplicated upstream: main's sceVideoOutAdjustColor still carries "Output gamma is accepted but not yet applied to presentation" (Output.cpp:337). So rebase, no redesign — substance sits on top of a much moved presentation path. [verified on main]
  3. Small barrier nit in the new PresentationGamma.cpp: the first work-image transition is imageBarrier(work, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_ACCESS_TRANSFER_READ_BIT, VK_ACCESS_TRANSFER_WRITE_BIT) — a srcAccessMask set on a wait from VK_IMAGE_LAYOUT_UNDEFINED is formally meaningless (vulkan spec: src access must be 0 for an UNDEFINED→x strict acquire); harmless in practice, but it will surface as a VUID with validation layers on. [verified from the branch source]
  4. LUT arithmetic pow(v/255, gamma)*255 spot-checked (128→64, 51→10, 204→163 at gamma 2.0). [verified arithmetically] Hardware/console match stays [author-reported].

The AGC/VideoOut test rule (same tests on main + branch with validation, compared by GPU) applies when rebasing.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ee6aba54 This PR now conflicts with main in core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp, core/libs/prx/libSceVideoOut/src/Output.cpp, docs/dev/debt/libSceVideoOut.md. Main’s PresentationPass and host-HDR integration replaced the presentation path that this PR extends with PresentationGamma. Could you reconcile output-gamma behavior with the current presentation and HDR path?

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@ee6aba54 a last check before we close this. Output gamma is still not applied on main (Output.cpp notes it is accepted but not yet used), so the feature is still wanted. But the presentation path this PR extends has since been replaced by PresentationPass and the host HDR integration, as asked on 25 Oct, and the open review points (validating the gamma read in AdjustColor, the presentation regression, measured curve evidence) are still open.

If you'd like to continue, please say so here within 7 days and rebuild it on PresentationPass. Otherwise we'll close it then and keep the gap noted for a fresh PR. Thanks for the work so far.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants