From a83a1acf17a6e5e715a6435ef0bd04aa3cfa7209 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Tue, 19 Apr 2022 12:49:56 -0400 Subject: [PATCH] Ignore bug in dxgi debug layer --- wgpu-hal/src/dx12/instance.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wgpu-hal/src/dx12/instance.rs b/wgpu-hal/src/dx12/instance.rs index 286f3e177..42fc16140 100644 --- a/wgpu-hal/src/dx12/instance.rs +++ b/wgpu-hal/src/dx12/instance.rs @@ -58,6 +58,19 @@ unsafe extern "system" fn output_debug_string_handler( return excpt::EXCEPTION_CONTINUE_SEARCH; } + let dxgi_debug_layer_bug_text1 = "ID3D12CommandQueue::Present"; + // We currently dont cross command list types, so this text has the + // highest chance of being a true positive for this issue. + let dxgi_debug_layer_bug_text2 = "resource state on previous Command List type"; + if level == log::Level::Error + && message.contains(dxgi_debug_layer_bug_text1) + && message.contains(dxgi_debug_layer_bug_text2) + { + // This is a bug in the DXGI and D3D12 validation layer when on windows 11. + // See https://stackoverflow.com/q/69805245 for more. + return excpt::EXCEPTION_CONTINUE_SEARCH; + } + let _ = std::panic::catch_unwind(|| { log::log!(level, "{}", message); });