Skip to content

Commit 90cb7be

Browse files
WIP: fix(msl-out): use packed operations for matCx3
1 parent 894d036 commit 90cb7be

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

naga/src/back/msl/writer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ fn should_pack_struct_member(
494494
size: crate::VectorSize::Tri,
495495
scalar: scalar @ crate::Scalar { width: 4 | 2, .. },
496496
} if is_tight => Some(scalar),
497+
crate::TypeInner::Matrix {
498+
columns: _,
499+
rows: crate::VectorSize::Tri,
500+
scalar: scalar @ crate::Scalar { width: 4, .. },
501+
} => Some(scalar),
497502
_ => None,
498503
}
499504
}

wgpu-hal/src/metal/adapter.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,19 @@ impl super::PrivateCapabilities {
535535
}
536536
}
537537

538-
let version: NSOperatingSystemVersion = unsafe {
538+
#[allow(unused_assignments)]
539+
let mut version: NSOperatingSystemVersion = unsafe {
539540
let process_info: *mut objc::runtime::Object =
540541
msg_send![class!(NSProcessInfo), processInfo];
541542
msg_send![process_info, operatingSystemVersion]
542543
};
543544

545+
version = NSOperatingSystemVersion {
546+
major: 10,
547+
minor: 11,
548+
patch: 0,
549+
};
550+
544551
let os_is_mac = device.supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1);
545552
// Metal was first introduced in OS X 10.11 and iOS 8. The current version number of visionOS is 1.0.0. Additionally,
546553
// on the Simulator, Apple only provides the Apple2 GPU capability, and the Apple2+ GPU capability covers the capabilities of Apple2.

wgpu-hal/src/metal/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl super::Device {
191191
);
192192

193193
let options = metal::CompileOptions::new();
194-
options.set_language_version(self.shared.private_caps.msl_version);
194+
options.set_language_version(dbg!(self.shared.private_caps.msl_version));
195195

196196
if self.shared.private_caps.supports_preserve_invariance {
197197
options.set_preserve_invariance(true);

0 commit comments

Comments
 (0)