Skip to content

sapp: add HDR support and runtime pixel format switching API#1449

Draft
squk wants to merge 1 commit into
floooh:masterfrom
squk:swapchain_pixelformats
Draft

sapp: add HDR support and runtime pixel format switching API#1449
squk wants to merge 1 commit into
floooh:masterfrom
squk:swapchain_pixelformats

Conversation

@squk

@squk squk commented Feb 25, 2026

Copy link
Copy Markdown

At first I implemented basic HDR support through a bool flag on sapp_desc in REMINDER_TO_INSERT_PR_LINK. Then I saw your comment in #1370 stating sRGB support should be implemented first so I decided to just have the API use that type and handle the Metal HDR flag in the platform specific impl.

In addition to the field on sapp_desc, I decided to add an API for switching the swapchain format at runtime, since most games/applications provide this option without needing to restart the application to see its effects(which also allows the user to confirm its working on their hardware configuration before persisting to the apps on-disk settings, potentially breaking the app at next start).

Draft since it's only working on Mac currently.

@floooh

floooh commented Feb 26, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR, but I'd like to tackle that myself in an update which generally adds more config options for the swapchain and does a general cleanup round for 'display parameters' in sapp_desc (like getting rid of some things that didn't work out - like swapInterval, this should instead be something like targetFrameRate).

I'll keep the PR open, but won't merge it (I'll most like use it for 'inspiration' though).

I haven't thought much yet about being able to reconfigure the swapchain after initialization, but that's definitely needed for games that want to avoid the "restart the game for setting changes to take effect", so I'm very much in favour - but I would keep these things in separate updates.

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

Projects

Status: Parked

Development

Successfully merging this pull request may close these issues.

2 participants