]> git.nega.tv - josh/narcissus/commitdiff
shark: Add RGP trigger
authorJoshua Simmons <josh@nega.tv>
Sat, 25 Oct 2025 17:45:35 +0000 (19:45 +0200)
committerJoshua Simmons <josh@nega.tv>
Sat, 25 Oct 2025 17:45:41 +0000 (19:45 +0200)
title/shark/src/main.rs

index 8632d5c9ec74c07c72056a32f0344202dfe47665..f5e497445af0acf90bdb7203818113a8e54e683e 100644 (file)
@@ -28,6 +28,8 @@ pub fn main() {
         unsafe { std::env::set_var("RUST_BACKTRACE", "1") }
     }
 
+    let rgp_trigger_path = std::env::var("MESA_VK_TRACE_TRIGGER").ok();
+
     let renderdoc = rdoc::RenderdocApi1_5_0::load();
 
     // Default to wayland because otherwise HiDPI is totally borked.
@@ -148,6 +150,13 @@ pub fn main() {
                                 continue 'poll_events;
                             }
 
+                            if let Some(trigger_file) = &rgp_trigger_path
+                                && down
+                                && key == Key::F12
+                            {
+                                std::fs::File::create(trigger_file).unwrap();
+                            }
+
                             let action = match key {
                                 Key::Left | Key::A => Some(Action::Left),
                                 Key::Right | Key::D => Some(Action::Right),