diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index 5bf92069a86..236fec49c3d 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -462,11 +462,13 @@ impl crate::Adapter for super::Adapter { let mut set_sample_count = |sc: u32, tfc: Tfc| { ms_levels.SampleCount = sc; - if self.device.CheckFeatureSupport( - d3d12::D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, - <*mut _>::cast(&mut ms_levels), - mem::size_of::() as _, - ) == winerror::S_OK + if unsafe { + self.device.CheckFeatureSupport( + d3d12::D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, + <*mut _>::cast(&mut ms_levels), + mem::size_of::() as _, + ) + } == winerror::S_OK && ms_levels.NumQualityLevels != 0 { caps.set(tfc, !no_msaa_load && !no_msaa_target); diff --git a/wgpu-hal/src/gles/adapter.rs b/wgpu-hal/src/gles/adapter.rs index 83355649da0..d27beecf668 100644 --- a/wgpu-hal/src/gles/adapter.rs +++ b/wgpu-hal/src/gles/adapter.rs @@ -196,7 +196,7 @@ impl super::Adapter { (vendor, renderer) }; - + let version = unsafe { gl.get_parameter_string(glow::VERSION) }; log::info!("Vendor: {}", vendor); @@ -666,11 +666,12 @@ impl crate::Adapter for super::Adapter { use wgt::TextureFormat as Tf; let sample_count = { - let max_samples = self - .shared - .context - .lock() - .get_parameter_i32(glow::MAX_SAMPLES); + let max_samples = unsafe { + self.shared + .context + .lock() + .get_parameter_i32(glow::MAX_SAMPLES) + }; if max_samples >= 8 { Tfc::MULTISAMPLE_X2 | Tfc::MULTISAMPLE_X4 | Tfc::MULTISAMPLE_X8 } else if max_samples >= 4 {