Skip to content

Commit

Permalink
Merge #1645
Browse files Browse the repository at this point in the history
1645: Disable Intel Fastclear in GL Backend r=kvark a=zicklag

This works around a Mesa bug on Intel cards:

- https://gitlab.freedesktop.org/mesa/mesa/-/issues/2565
- #1627 (comment)

**Connections**
Related to pixelated edges in GL backend brought up in #1627.

**Description**
This just adds the `INTEL_DEBUG=nofc` environment variable setting when creating an `Instance` using the GL backend in `wgpu_hal`. This is just a workaround until the mesa bug is fixed.

I wanted to wait until adapters were enumerated to determine that the user wanted to use an Intel Mesa adapter, but the environment variable has to be set before the x11 display was opened so that wasn't an option.

This may not be the strategy we want to take with this one, but it seems relatively harmless. Because the environment variable prefixed with `INTEL` anyway, it might not effect devices other than the ones we want to, which would be good.

**Testing**
I tested this on Ubuntu 20.04 with Mesa Intel(R) UHD Graphics (CML GT2) on using the GL backend.


Co-authored-by: Zicklag <zicklag@katharostech.com>
  • Loading branch information
bors[bot] and zicklag authored Jul 13, 2021
2 parents 049d94f + f0c7e99 commit d136e05
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wgpu-hal/src/gles/egl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ impl crate::Instance<super::Api> 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::<egl::EGL1_5>())
{
Expand Down

0 comments on commit d136e05

Please sign in to comment.