From 4fc439abe2c0fe0bf565e6bd090a9db198c5a519 Mon Sep 17 00:00:00 2001 From: Aleksander Date: Sat, 14 Feb 2026 10:18:41 +0100 Subject: [PATCH] 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. --- uidev/src/vulkan.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uidev/src/vulkan.rs b/uidev/src/vulkan.rs index 1d446db..c4c7976 100644 --- a/uidev/src/vulkan.rs +++ b/uidev/src/vulkan.rs @@ -2,8 +2,8 @@ use anyhow::Context; use std::sync::{Arc, OnceLock}; use vulkano::{ device::{ - physical::{PhysicalDevice, PhysicalDeviceType}, Device, DeviceCreateInfo, DeviceExtensions, DeviceFeatures, Queue, QueueCreateInfo, QueueFlags, + physical::{PhysicalDevice, PhysicalDeviceType}, }, instance::{Instance, InstanceCreateInfo}, swapchain::ColorSpace, @@ -96,8 +96,8 @@ pub fn init_window( let (format, color_space) = physical_device .surface_formats(&surface, vulkano::swapchain::SurfaceInfo::default())? .into_iter() - .next() - .context("Could not read surface formats for PhysicalDevice")?; + .find(|(format, _)| !format.components().iter().any(|b| *b > 8)) + .context("Could not read or no suitable surface formats for PhysicalDevice")?; let (device, queues) = Device::new( physical_device,