From cf1cb9064299aa0320ee43891deda90d56754b51 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Mon, 15 Sep 2025 08:36:07 +0200 Subject: [PATCH] fix(wayland/dmabuf): only suggest formats that have srgb variants, fixes blender and vkcube, in the future it might be better to do such a conversion in a shader for more formats Signed-off-by: Schmarni --- src/wayland/dmabuf/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/dmabuf/mod.rs b/src/wayland/dmabuf/mod.rs index ba2c9a6..df4151a 100644 --- a/src/wayland/dmabuf/mod.rs +++ b/src/wayland/dmabuf/mod.rs @@ -6,7 +6,10 @@ use std::sync::LazyLock; use super::{util::ClientExt, vulkano_data::VULKANO_CONTEXT}; use crate::core::registry::Registry; -use bevy_dmabuf::{format_mapping::drm_fourcc_to_vk_format, wgpu_init::vulkan_to_wgpu}; +use bevy_dmabuf::{ + format_mapping::{drm_fourcc_to_vk_format, vk_format_to_srgb}, + wgpu_init::vulkan_to_wgpu, +}; use buffer_params::BufferParams; use drm_fourcc::DrmFourcc; use feedback::DmabufFeedback; @@ -28,6 +31,7 @@ pub static DMABUF_FORMATS: LazyLock> = LazyLock::new(|| { .copied() .filter_map(|f| Some((f, drm_fourcc_to_vk_format(f)?))) .filter(|(_, vk_format)| vulkan_to_wgpu(*vk_format).is_some()) + .filter(|(_, vk_format)| vk_format_to_srgb(*vk_format).is_some()) .filter_map(|(f, vk_format)| { Some(( f,