wgpu: Apply Nvidia driver workaround regardless of cctk feature

This commit is contained in:
Ian Douglas Scott 2026-07-06 19:07:11 -07:00 • committed by Ian Douglas Scott
parent 371dd94a2a
commit 5671e49c9b
6 changed files with 8 additions and 18 deletions

5
Cargo.lock generated
View file

@ -1294,7 +1294,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-client-toolkit" name = "cosmic-client-toolkit"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/pop-os/cosmic-protocols?rev=a7d2d7a#a7d2d7a6188425f699eaddf7a025617ce56068ae" source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"cosmic-protocols", "cosmic-protocols",
@ -1307,7 +1307,7 @@ dependencies = [
[[package]] [[package]]
name = "cosmic-protocols" name = "cosmic-protocols"
version = "0.2.0" version = "0.2.0"
source = "git+https://github.com/pop-os/cosmic-protocols?rev=a7d2d7a#a7d2d7a6188425f699eaddf7a025617ce56068ae" source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f"
dependencies = [ dependencies = [
"bitflags 2.11.0", "bitflags 2.11.0",
"wayland-backend", "wayland-backend",
@ -3195,6 +3195,7 @@ dependencies = [
"resvg", "resvg",
"rustc-hash 2.1.2", "rustc-hash 2.1.2",
"rustix 0.38.44", "rustix 0.38.44",
"smithay-client-toolkit 0.20.0",
"thiserror 2.0.18", "thiserror 2.0.18",
"tiny-xlib", "tiny-xlib",
"wayland-backend", "wayland-backend",

View file

@ -308,6 +308,7 @@ winit = { git = "https://github.com/pop-os/winit.git", tag = "cosmic-0.14" }
winit-core = { git = "https://github.com/pop-os/winit.git", tag = "cosmic-0.14" } winit-core = { git = "https://github.com/pop-os/winit.git", tag = "cosmic-0.14" }
cursor-icon = "1.1.0" cursor-icon = "1.1.0"
sctk = { package = "smithay-client-toolkit", version = "0.20.0" }
[workspace.lints.rust] [workspace.lints.rust]
rust_2018_idioms = { level = "deny", priority = -1 } rust_2018_idioms = { level = "deny", priority = -1 }

View file

@ -65,3 +65,4 @@ x11rb = { version = "0.13.1", features = [
"dri3", "dri3",
"randr", "randr",
] } ] }
sctk.workspace = true

View file

@ -2,7 +2,6 @@
pub mod compositor; pub mod compositor;
#[cfg(all( #[cfg(all(
unix, unix,
feature = "cctk",
not(target_os = "macos"), not(target_os = "macos"),
not(target_os = "redox") not(target_os = "redox")
))] ))]

View file

@ -11,7 +11,6 @@ use crate::{Engine, Renderer};
#[cfg(all( #[cfg(all(
unix, unix,
feature = "cctk",
not(target_os = "macos"), not(target_os = "macos"),
not(target_os = "redox") not(target_os = "redox")
))] ))]
@ -67,7 +66,6 @@ impl Compositor {
) -> Result<Self, Error> { ) -> Result<Self, Error> {
#[cfg(all( #[cfg(all(
unix, unix,
feature = "cctk",
not(target_os = "macos"), not(target_os = "macos"),
not(target_os = "redox") not(target_os = "redox")
))] ))]
@ -76,16 +74,6 @@ impl Compositor {
.or_else(|| get_x11_device_ids(window)) .or_else(|| get_x11_device_ids(window))
}); });
#[cfg(all(
unix,
not(feature = "cctk"),
not(target_os = "macos"),
not(target_os = "redox")
))]
let ids = compatible_window
.as_ref()
.and_then(|window| get_x11_device_ids(window));
// HACK: // HACK:
// 1. If we specifically didn't select an nvidia gpu // 1. If we specifically didn't select an nvidia gpu
// 2. and the user didn't specifically request an nvidia gpu // 2. and the user didn't specifically request an nvidia gpu

View file

@ -1,5 +1,5 @@
use crate::graphics::compositor::Window; use crate::graphics::compositor::Window;
use cctk::sctk::{ use sctk::{
dmabuf::{DmabufFeedback, DmabufHandler, DmabufState}, dmabuf::{DmabufFeedback, DmabufHandler, DmabufState},
registry::{ProvidesRegistryState, RegistryState}, registry::{ProvidesRegistryState, RegistryState},
registry_handlers, registry_handlers,
@ -111,5 +111,5 @@ pub fn get_wayland_device_ids<W: Window>(window: &W) -> Option<(u16, u16)> {
} }
} }
cctk::sctk::delegate_dmabuf!(AppData); sctk::delegate_dmabuf!(AppData);
cctk::sctk::delegate_registry!(AppData); sctk::delegate_registry!(AppData);