diff --git a/CHANGELOG.md b/CHANGELOG.md index 784161662..fe4afa757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -222,6 +222,10 @@ By @cwfitzgerald in [#8162](https://github.com/gfx-rs/wgpu/pull/8162). - Fixed unwrap failed in context creation for some Android devices. By @uael in [#8024](https://github.com/gfx-rs/wgpu/pull/8024). +##### Vulkan + +- Fixed wrong color format+space being reported versus what is hardcoded in `create_swapchain()`. By @MarijnS95 in [#8226](https://github.com/gfx-rs/wgpu/pull/8226). + #### naga - [wgsl-in] Allow a trailing comma in `@blend_src(…)` attributes. By @ErichDonGubler in [#8137](https://github.com/gfx-rs/wgpu/pull/8137). diff --git a/wgpu-hal/src/vulkan/conv.rs b/wgpu-hal/src/vulkan/conv.rs index e6bcb20ca..97044233e 100644 --- a/wgpu-hal/src/vulkan/conv.rs +++ b/wgpu-hal/src/vulkan/conv.rs @@ -161,7 +161,8 @@ impl super::PrivateCapabilities { pub fn map_vk_surface_formats(sf: vk::SurfaceFormatKHR) -> Option { use ash::vk::Format as F; use wgt::TextureFormat as Tf; - // List we care about pulled from https://vulkan.gpuinfo.org/listsurfaceformats.php + // List we care about pulled from https://vulkan.gpuinfo.org/listsurfaceformats.php. + // Device::create_swapchain() hardcodes linear scRGB for fp16, non-linear sRGB otherwise. Some(match sf.color_space { vk::ColorSpaceKHR::SRGB_NONLINEAR => match sf.format { F::B8G8R8A8_UNORM => Tf::Bgra8Unorm, @@ -169,13 +170,13 @@ pub fn map_vk_surface_formats(sf: vk::SurfaceFormatKHR) -> Option Tf::Rgba8Snorm, F::R8G8B8A8_UNORM => Tf::Rgba8Unorm, F::R8G8B8A8_SRGB => Tf::Rgba8UnormSrgb, + F::R16G16B16A16_SNORM => Tf::Rgba16Snorm, + F::R16G16B16A16_UNORM => Tf::Rgba16Unorm, + F::A2B10G10R10_UNORM_PACK32 => Tf::Rgb10a2Unorm, _ => return None, }, vk::ColorSpaceKHR::EXTENDED_SRGB_LINEAR_EXT => match sf.format { F::R16G16B16A16_SFLOAT => Tf::Rgba16Float, - F::R16G16B16A16_SNORM => Tf::Rgba16Snorm, - F::R16G16B16A16_UNORM => Tf::Rgba16Unorm, - F::A2B10G10R10_UNORM_PACK32 => Tf::Rgb10a2Unorm, _ => return None, }, _ => return None,