From 4a3d56749e028c5aae65ca0826813b1e6de785fd Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 30 Jul 2025 16:04:59 -0700 Subject: [PATCH] Remove debugging code, commented code --- Cargo.lock | 25 ----------------- crates/gpui/Cargo.toml | 2 -- .../gpui/src/platform/windows/direct_write.rs | 27 ------------------- .../src/platform/windows/directx_renderer.rs | 3 --- 4 files changed, 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0ca736fb6..25196fc349 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5727,9 +5727,6 @@ name = "float-cmp" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" -dependencies = [ - "num-traits", -] [[package]] name = "float-ord" @@ -7361,7 +7358,6 @@ dependencies = [ "rand 0.8.5", "raw-window-handle", "refineable", - "renderdoc", "reqwest_client", "resvg", "scap", @@ -13468,27 +13464,6 @@ dependencies = [ "bytecheck", ] -[[package]] -name = "renderdoc" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac633a08f39bf3268714799bd8c4a1a19c19c203d817d3448bb8b91c97817cf0" -dependencies = [ - "bitflags 2.9.0", - "float-cmp", - "libloading", - "once_cell", - "renderdoc-sys", - "winapi", - "wio", -] - -[[package]] -name = "renderdoc-sys" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" - [[package]] name = "repl" version = "0.1.0" diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index cc7b1d7fb8..2bf49fa7d8 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -130,8 +130,6 @@ lyon = "1.0" workspace-hack.workspace = true libc.workspace = true -renderdoc = "0.12.1" - [target.'cfg(target_os = "macos")'.dependencies] block = "0.1" cocoa.workspace = true diff --git a/crates/gpui/src/platform/windows/direct_write.rs b/crates/gpui/src/platform/windows/direct_write.rs index 80ae3c8ea5..35d85a1462 100644 --- a/crates/gpui/src/platform/windows/direct_write.rs +++ b/crates/gpui/src/platform/windows/direct_write.rs @@ -54,13 +54,7 @@ struct GPUState { pixel_shader: ID3D11PixelShader, } -struct Syncer(T); -unsafe impl Send for Syncer {} -unsafe impl Sync for Syncer {} - struct DirectWriteState { - // #[cfg(feature = "enable-renderdoc")] - // renderdoc: Syncer>>>, components: DirectWriteComponent, system_ui_font_name: SharedString, system_font_collection: IDWriteFontCollection1, @@ -236,8 +230,6 @@ impl DirectWriteTextSystem { let system_ui_font_name = get_system_ui_font_name(); Ok(Self(RwLock::new(DirectWriteState { - // #[cfg(feature = "enable-renderdoc")] - // renderdoc: Syncer(Arc::new(RwLock::new(renderdoc::RenderDoc::new().unwrap()))), components, system_ui_font_name, system_font_collection, @@ -1156,12 +1148,6 @@ impl DirectWriteState { texture.unwrap() }; - // #[cfg(feature = "enable-renderdoc")] - // self.renderdoc - // .0 - // .write() - // .start_frame_capture(std::ptr::null(), std::ptr::null()); - let device_context = &gpu_state.device_context; unsafe { device_context.IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP) }; unsafe { device_context.VSSetShader(&gpu_state.vertex_shader, None) }; @@ -1239,14 +1225,6 @@ impl DirectWriteState { }; } - // #[cfg(feature = "enable-renderdoc")] - // self.renderdoc - // .0 - // .write() - // .end_frame_capture(std::ptr::null(), std::ptr::null()); - - println!("render finished"); - Ok(rasterized) } @@ -1893,11 +1871,6 @@ fn get_name(string: IDWriteLocalizedStrings, locale: &str) -> Result { Ok(String::from_utf16_lossy(&name_vec[..name_length])) } -#[inline] -fn translate_color(color: &DWRITE_COLOR_F) -> [f32; 4] { - [color.r, color.g, color.b, color.a] -} - fn get_system_ui_font_name() -> SharedString { unsafe { let mut info: LOGFONTW = std::mem::zeroed(); diff --git a/crates/gpui/src/platform/windows/directx_renderer.rs b/crates/gpui/src/platform/windows/directx_renderer.rs index cf5b538cea..9fb96e72a7 100644 --- a/crates/gpui/src/platform/windows/directx_renderer.rs +++ b/crates/gpui/src/platform/windows/directx_renderer.rs @@ -175,10 +175,7 @@ impl DirectXRenderer { } fn pre_draw(&self) -> Result<()> { - #[cfg(not(feature = "enable-renderdoc"))] let premultiplied_alpha = 1; - #[cfg(feature = "enable-renderdoc")] - let premultiplied_alpha = 0; update_buffer( &self.devices.device_context,