fix: get CONTEXT_PROFILE_MASK in invalid version (#5007)

This commit is contained in:
Rubens Brandão 2024-01-06 12:16:29 -03:00 committed by GitHub
parent dd2b985690
commit 0298198ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,7 +222,7 @@ impl super::Adapter {
let es_ver = full_ver.map_or_else(|| Self::parse_version(&version).ok(), |_| None);
if let Some(full_ver) = full_ver {
let core_profile = (full_ver >= (3, 2)).then_some(unsafe {
let core_profile = (full_ver >= (3, 2)).then(|| unsafe {
gl.get_parameter_i32(glow::CONTEXT_PROFILE_MASK)
& glow::CONTEXT_CORE_PROFILE_BIT as i32
!= 0