mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-04 00:28:24 +00:00
wgpu-hal patch: log Metal versions as major.minor (#1631)
This commit is contained in:
1 parent
0623c42d10
commit
d55ac7ba7a
1 file changed
+10
-2
Vendored
+10
-2
@@ -57,18 +57,26 @@ fn accepted_msl_version(
|
||||
{
|
||||
if candidate != os_version {
|
||||
log::warn!(
|
||||
"The Metal compiler does not accept the language version this OS implies ({os_version:?}); using {candidate:?}"
|
||||
"The Metal compiler does not accept MSL {}, which this OS implies; using MSL {}",
|
||||
msl_name(os_version),
|
||||
msl_name(candidate)
|
||||
);
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
log::warn!(
|
||||
"The Metal compiler accepted no language version up to {os_version:?}; using it anyway"
|
||||
"The Metal compiler accepted no MSL version up to {}; using it anyway",
|
||||
msl_name(os_version)
|
||||
);
|
||||
os_version
|
||||
}
|
||||
|
||||
/// `major.minor` of a Metal language version (`MTLLanguageVersion` is `major << 16 | minor`).
|
||||
fn msl_name(version: MTLLanguageVersion) -> alloc::string::String {
|
||||
alloc::format!("{}.{}", version.0 >> 16, version.0 & 0xffff)
|
||||
}
|
||||
|
||||
/// Check if a device's class has a given method in its method table.
|
||||
///
|
||||
/// This mirrors the check that `objc2` performs internally (in debug builds)
|
||||
|
||||
Reference in new issue
Block a user