diff options
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | renderer/Cargo.toml | 1 | ||||
-rw-r--r-- | wgpu/Cargo.toml | 1 | ||||
-rw-r--r-- | wgpu/src/window/compositor.rs | 5 |
4 files changed, 9 insertions, 0 deletions
@@ -65,6 +65,8 @@ advanced = ["iced_core/advanced", "iced_widget/advanced"] fira-sans = ["iced_renderer/fira-sans"] # Enables auto-detecting light/dark mode for the built-in theme auto-detect-theme = ["iced_core/auto-detect-theme"] +# Enables strict assertions for debugging purposes at the expense of performance +strict-assertions = ["iced_renderer/strict-assertions"] [dependencies] iced_core.workspace = true diff --git a/renderer/Cargo.toml b/renderer/Cargo.toml index 458681dd..ac223f16 100644 --- a/renderer/Cargo.toml +++ b/renderer/Cargo.toml @@ -22,6 +22,7 @@ geometry = ["iced_graphics/geometry", "iced_tiny_skia?/geometry", "iced_wgpu?/ge web-colors = ["iced_wgpu?/web-colors"] webgl = ["iced_wgpu?/webgl"] fira-sans = ["iced_graphics/fira-sans"] +strict-assertions = ["iced_wgpu?/strict-assertions"] [dependencies] iced_graphics.workspace = true diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index b13ecb36..a8ebf3aa 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -23,6 +23,7 @@ image = ["iced_graphics/image"] svg = ["iced_graphics/svg", "resvg/text"] web-colors = ["iced_graphics/web-colors"] webgl = ["wgpu/webgl"] +strict-assertions = [] [dependencies] iced_graphics.workspace = true diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 0cfd49b7..56f33b50 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -56,6 +56,11 @@ impl Compositor { ) -> Result<Self, Error> { let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { backends: settings.backends, + flags: if cfg!(feature = "strict-assertions") { + wgpu::InstanceFlags::debugging() + } else { + wgpu::InstanceFlags::empty() + }, ..Default::default() }); |