diff --git a/wgpu-hal/src/vulkan/conv.rs b/wgpu-hal/src/vulkan/conv.rs index ba1428ded5..e52409043a 100644 --- a/wgpu-hal/src/vulkan/conv.rs +++ b/wgpu-hal/src/vulkan/conv.rs @@ -149,16 +149,22 @@ pub fn map_vk_surface_formats(sf: vk::SurfaceFormatKHR) -> Option Tf::Bgra8Unorm, - F::B8G8R8A8_SRGB => Tf::Bgra8UnormSrgb, - F::R8G8B8A8_SNORM => Tf::Rgba8Snorm, - F::R8G8B8A8_UNORM => Tf::Rgba8Unorm, - F::R8G8B8A8_SRGB => Tf::Rgba8UnormSrgb, - F::R16G16B16A16_SFLOAT => Tf::Rgba16Float, - F::R16G16B16A16_SNORM => Tf::Rgba16Snorm, - F::R16G16B16A16_UNORM => Tf::Rgba16Unorm, - F::A2B10G10R10_UNORM_PACK32 => Tf::Rgb10a2Unorm, + Some(match sf.color_space { + vk::ColorSpaceKHR::SRGB_NONLINEAR => match sf.format { + F::B8G8R8A8_UNORM => Tf::Bgra8Unorm, + F::B8G8R8A8_SRGB => Tf::Bgra8UnormSrgb, + F::R8G8B8A8_SNORM => Tf::Rgba8Snorm, + F::R8G8B8A8_UNORM => Tf::Rgba8Unorm, + F::R8G8B8A8_SRGB => Tf::Rgba8UnormSrgb, + _ => 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, }) }