From: Josh Simmons Date: Sat, 11 May 2024 10:15:17 +0000 (+0200) Subject: shark: Disable Wayland when RenderDoc is detected X-Git-Url: https://git.nega.tv//gitweb.cgi?a=commitdiff_plain;h=28675e67b7f36d568db8d7f93e6b24b60aef81d8;p=josh%2Fnarcissus shark: Disable Wayland when RenderDoc is detected --- diff --git a/Cargo.lock b/Cargo.lock index f710141..e4fb89e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,6 +183,7 @@ dependencies = [ "narcissus-gpu", "narcissus-image", "narcissus-maths", + "renderdoc-sys", "shark-shaders", ] diff --git a/title/shark/Cargo.toml b/title/shark/Cargo.toml index 8b6d1aa..635da7d 100644 --- a/title/shark/Cargo.toml +++ b/title/shark/Cargo.toml @@ -6,6 +6,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] + +renderdoc-sys = { path = "../../external/renderdoc-sys" } + narcissus-app = { path = "../../engine/narcissus-app" } narcissus-core = { path = "../../engine/narcissus-core" } narcissus-font = { path = "../../engine/narcissus-font" } diff --git a/title/shark/src/main.rs b/title/shark/src/main.rs index 6186724..c9d0c85 100644 --- a/title/shark/src/main.rs +++ b/title/shark/src/main.rs @@ -1,5 +1,7 @@ use std::fmt::Write; +use renderdoc_sys as rdoc; + use crate::{ fonts::{FontFamily, Fonts}, pipelines::{BasicPipeline, TextPipeline}, @@ -443,8 +445,11 @@ pub fn main() { std::env::set_var("RUST_BACKTRACE", "1") } + let renderdoc = rdoc::RenderdocApi1_5_0::load(); + // Default to wayland because otherwise HiDPI is totally borked. - if std::env::var("SDL_VIDEODRIVER").is_err() { + // Unless renderdoc is attached, in which case wayland would break capture. + if renderdoc.is_none() && std::env::var("SDL_VIDEODRIVER").is_err() { std::env::set_var("SDL_VIDEODRIVER", "wayland") }