uidev: fix color formats
Current implementation picks up the first available color format, which could be HDR (A2R10G10B10_UNORM_PACK32 in my case), but we don't have any color profiles. Stick back to SDR-only instead.
This commit is contained in:
@@ -2,8 +2,8 @@ use anyhow::Context;
|
|||||||
use std::sync::{Arc, OnceLock};
|
use std::sync::{Arc, OnceLock};
|
||||||
use vulkano::{
|
use vulkano::{
|
||||||
device::{
|
device::{
|
||||||
physical::{PhysicalDevice, PhysicalDeviceType},
|
|
||||||
Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, Queue, QueueCreateInfo, QueueFlags,
|
Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, Queue, QueueCreateInfo, QueueFlags,
|
||||||
|
physical::{PhysicalDevice, PhysicalDeviceType},
|
||||||
},
|
},
|
||||||
instance::{Instance, InstanceCreateInfo},
|
instance::{Instance, InstanceCreateInfo},
|
||||||
swapchain::ColorSpace,
|
swapchain::ColorSpace,
|
||||||
@@ -96,8 +96,8 @@ pub fn init_window(
|
|||||||
let (format, color_space) = physical_device
|
let (format, color_space) = physical_device
|
||||||
.surface_formats(&surface, vulkano::swapchain::SurfaceInfo::default())?
|
.surface_formats(&surface, vulkano::swapchain::SurfaceInfo::default())?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.next()
|
.find(|(format, _)| !format.components().iter().any(|b| *b > 8))
|
||||||
.context("Could not read surface formats for PhysicalDevice")?;
|
.context("Could not read or no suitable surface formats for PhysicalDevice")?;
|
||||||
|
|
||||||
let (device, queues) = Device::new(
|
let (device, queues) = Device::new(
|
||||||
physical_device,
|
physical_device,
|
||||||
|
|||||||
Reference in New Issue
Block a user