mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
hal/vulkan: Accurately map all formats except fp16 to use the non-linear sRGB color space (#8226)
This commit is contained in:
parent
8cb94db802
commit
ea80c7dbc3
@ -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).
|
||||
|
||||
@ -161,7 +161,8 @@ impl super::PrivateCapabilities {
|
||||
pub fn map_vk_surface_formats(sf: vk::SurfaceFormatKHR) -> Option<wgt::TextureFormat> {
|
||||
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<wgt::TextureFo
|
||||
F::R8G8B8A8_SNORM => 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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user