gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.63k stars 925 forks source link

10-bit color support on Linux (No HDR) #5600

Open valaphee opened 6 months ago

valaphee commented 6 months ago

Is your feature request related to a problem? Please describe. When selecting 10-bit color in X11, no surface format is found. As Vulkan only lists A2R10G10B10_UNORM_PACK32 SRGB_NONLINEAR as supported surface format which is not mapped in map_vk_surface_formats

On OpenGL it finds no configuration, as ALPHA_SIZE is 2 and not 8.

Describe the solution you'd like For Vulkan, map the texture formats independent of the color space. And pass the color space through in a different way.

For OpenGL allow ALPHA_SIZE of 2.

Describe alternatives you've considered No support for other color formats, which drivers support.

Additional context The problem with the current method of mapping texture formats, in combination with color space is that the format is not correlated to the color space, which results in color space issues.

Might be worth improving this in general for Vulkan. See https://github.com/gfx-rs/wgpu/issues/4842

valaphee commented 6 months ago

There is also the problem that F::A2R10G10B10_UNORM_PACK32 => Tf::Rgb10a2Unorm, F::A2B10G10R10_UNORM_PACK32 => Tf::Rgb10a2Unorm, maps to the same

Where it would be better to have Bgr10a2Unorm and Rgb10a2Unorm