Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vk: Refactor swapchain format selection #1813

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

Wunkolo
Copy link
Contributor

@Wunkolo Wunkolo commented Jan 19, 2025

Use a series of stable-partitions to sort the list of available formats to find the best candidate surface-format/color-space that is a non-sRGB format being presented in an sRGB color-space. Vulkan mandates that all surface formats that have SRGB forms must also support a UNORM form.

This is basically just RGBA8/BGRA8 on all platforms still, but in a way that is still capable of falling back to secondary formats in a stable way in the case that the primary choice is not available. Mobile devices especially have a LOT of secondary HDR surface formats and other weird formats that can be used to present such as RGBA16 or RGBA565. With stable partitions, if we can't get our best option then there is always a "next best thing" to fall back on rather than relying on the driver-order.

Use a series of stable-partitions to sort the list of available formats
to find the best candidate surface-format/color-space that is a non-sRGB
format being presented in an sRGB color-space. Vulkan mandates that all
surface formats that have SRGB forms must also support a UNORM form.

This is basically just RGBA8/BGRA8 on all platforms still, but in a way
that is still capable of falling back to secondary formats in a stable
way in the case that the primary choice is not available.  Mobile
devices especially have a LOT of secondary HDR surface formats and other
weird formats that can be used to present such as RGBA16 or RGBA565.
With stable partitions, if we can't get our best option then there is
always a "next best thing" to fall back on rather than relying on the
driver-order.
@flyinghead flyinghead merged commit da9f030 into flyinghead:dev Jan 22, 2025
15 checks passed
@Wunkolo Wunkolo deleted the vk-swapchain-tweaks branch January 22, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants