Implements PhysicalDevice::id() for Metal (#1431)

This commit is contained in:
Putta Khunchalee
2026-02-07 12:48:37 +01:00
committed by GitHub
parent 11d1b07a10
commit d93a8ebb75
4 changed files with 14 additions and 5 deletions
+9
View File
@@ -23,3 +23,12 @@ In order to build Obliteration from source make sure you have the following prer
- `Desktop development with C++` workload is required
- [Windows Terminal](https://aka.ms/terminal)
- You can use a classic `Command Prompt` but make sure you enable [ANSI escape sequences](https://stackoverflow.com/q/16755142/1829232)
## AArch64
- Rust on the latest nightly channel
- You can install with `rustup toolchain install nightly`
- Rust std source for nightly
- You can install with `rustup component add rust-src --toolchain nightly`
- Rust `aarch64-unknown-none-softfloat` target
- You can install with `rustup target add aarch64-unknown-none-softfloat`
+2 -2
View File
@@ -43,8 +43,8 @@ impl GraphicsBuilder for MetalBuilder {
}
impl super::PhysicalDevice for metal::Device {
fn id(&self) -> &[u8] {
todo!()
fn id(&self) -> Vec<u8> {
self.deref().registry_id().to_ne_bytes().into()
}
fn name(&self) -> &str {
+1 -1
View File
@@ -28,7 +28,7 @@ pub trait GraphicsBuilder: 'static {
/// Represents a graphics hardware.
pub trait PhysicalDevice: Sized {
fn id(&self) -> &[u8];
fn id(&self) -> Vec<u8>;
fn name(&self) -> &str;
}
+2 -2
View File
@@ -171,8 +171,8 @@ pub struct PhysicalDevice {
}
impl super::PhysicalDevice for PhysicalDevice {
fn id(&self) -> &[u8] {
&self.id
fn id(&self) -> Vec<u8> {
self.id.into()
}
fn name(&self) -> &str {