From 3c5d36cf6ece9d91636eeab9680dbb66c32c2894 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Tue, 17 Oct 2023 22:04:13 -0400 Subject: [PATCH] Work around naga issue with GLSL 460 --- wgpu-hal/src/gles/adapter.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index e343d54f2f6..26dfb7475a7 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -277,7 +277,11 @@ impl super::Adapter { log::info!("SL version: {}", &sl_version); if full_ver.is_some() { let (sl_major, sl_minor) = Self::parse_full_version(&sl_version).ok()?; - let value = sl_major as u16 * 100 + sl_minor as u16 * 10; + let mut value = sl_major as u16 * 100 + sl_minor as u16 * 10; + // Naga doesn't think it supports GL 460+, so we cap it at 450 + if value > 450 { + value = 450; + } naga::back::glsl::Version::Desktop(value) } else { let (sl_major, sl_minor) = Self::parse_version(&sl_version).ok()?;