From f0c7e990f7b63b38c2024c201101a14a499cac19 Mon Sep 17 00:00:00 2001 From: Zicklag Date: Tue, 13 Jul 2021 11:21:06 -0500 Subject: [PATCH] Disable Intel Fastclear in GL Backend This works around a Mesa bug on Intel cards: - https://gitlab.freedesktop.org/mesa/mesa/-/issues/2565 - https://github.com/gfx-rs/wgpu/issues/1627#issuecomment-877854185 --- wgpu-hal/src/gles/egl.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wgpu-hal/src/gles/egl.rs b/wgpu-hal/src/gles/egl.rs index dc89f4b662..da04883345 100644 --- a/wgpu-hal/src/gles/egl.rs +++ b/wgpu-hal/src/gles/egl.rs @@ -396,6 +396,11 @@ impl crate::Instance for Instance { None }; + // Workaround Mesa driver bug on Intel cards by disabling fastclear: + // https://gitlab.freedesktop.org/mesa/mesa/-/issues/2565 + // https://github.com/gfx-rs/wgpu/issues/1627#issuecomment-877854185 + std::env::set_var("INTEL_DEBUG", "nofc"); + let display = if let (Some(library), Some(egl)) = (wayland_library, egl.upcast::()) {