mirror of
https://github.com/obhq/obliteration.git
synced 2026-10-11 21:39:55 +00:00
Implements PhysicalDevice::id() for Metal (#1431)
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user