diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 785ed49e31..c3e1a13b06 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -220,7 +220,6 @@ impl super::Adapter { let full_ver = Self::parse_full_version(&version).ok(); let es_ver = full_ver.map_or_else(|| Self::parse_version(&version).ok(), |_| None); - let web_gl = cfg!(target_arch = "wasm32"); if let Some(full_ver) = full_ver { let core_profile = (full_ver >= (3, 2)).then_some(unsafe { @@ -608,10 +607,7 @@ impl super::Adapter { super::PrivateCapabilities::TEXTURE_STORAGE, supported((3, 0), (4, 2)), ); - private_caps.set( - super::PrivateCapabilities::DEBUG_FNS, - supported((3, 2), (4, 3)) && !web_gl, - ); + private_caps.set(super::PrivateCapabilities::DEBUG_FNS, gl.supports_debug()); private_caps.set( super::PrivateCapabilities::INVALIDATE_FRAMEBUFFER, supported((3, 0), (4, 3)), diff --git a/wgpu-hal/src/gles/device.rs b/wgpu-hal/src/gles/device.rs index a48fe9dc75..8cc2a95756 100644 --- a/wgpu-hal/src/gles/device.rs +++ b/wgpu-hal/src/gles/device.rs @@ -344,7 +344,7 @@ impl super::Device { let program = unsafe { gl.create_program() }.unwrap(); #[cfg(not(target_arch = "wasm32"))] if let Some(label) = label { - if gl.supports_debug() { + if private_caps.contains(PrivateCapabilities::DEBUG_FNS) { let name = unsafe { mem::transmute(program) }; unsafe { gl.object_label(glow::PROGRAM, name, Some(label)) }; } @@ -593,7 +593,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::BUFFER, name, Some(label)) }; } @@ -732,7 +736,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::RENDERBUFFER, name, Some(label)) }; } @@ -896,7 +904,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::TEXTURE, name, Some(label)) }; } @@ -1035,7 +1047,11 @@ impl crate::Device for super::Device { #[cfg(not(target_arch = "wasm32"))] if let Some(label) = desc.label { - if gl.supports_debug() { + if self + .shared + .private_caps + .contains(PrivateCapabilities::DEBUG_FNS) + { let name = unsafe { mem::transmute(raw) }; unsafe { gl.object_label(glow::SAMPLER, name, Some(label)) }; }