euv_core/render/gpu/struct.rs
1use super::*;
2
3/// Probed physical GPU adapter and native shader compilation telemetry.
4#[derive(Clone, Debug, Eq, Getter, New, PartialEq)]
5pub struct GpuAdapterInfo {
6 /// Active graphics backend identifier.
7 #[get(type(copy))]
8 pub(crate) backend: GraphicsBackend,
9 /// Detected physical GPU adapter name (for example `"Apple M3 Max"`).
10 pub(crate) device_name: String,
11 /// True when a real physical OS GPU device/runtime was successfully initialized.
12 #[get(type(copy))]
13 pub(crate) hardware_verified: bool,
14 /// True when the native UI shader (`MSL`/`HLSL`/`GLSL`/`WGSL`) compiled on the host GPU.
15 #[get(type(copy))]
16 pub(crate) shader_compiled: bool,
17}
18
19/// Physical OS GPU driver wrapping Metal, D3D12, Vulkan, or WebGL2 with automatic recording fallback.
20#[derive(Debug, Getter)]
21pub struct NativeGpuDriver {
22 /// Probed physical adapter and shader status.
23 pub(crate) adapter: GpuAdapterInfo,
24 /// Opaque OS GPU device handle (`id<MTLDevice>` on Apple, `0` when fallback).
25 #[get(type(copy))]
26 pub(crate) device_handle: usize,
27 /// Opaque OS GPU command queue handle (`id<MTLCommandQueue>` on Apple, `0` when fallback).
28 #[get(type(copy))]
29 pub(crate) queue_handle: usize,
30 /// Opaque compiled shader library handle (`id<MTLLibrary>` on Apple, `0` when fallback).
31 #[get(type(copy))]
32 pub(crate) library_handle: usize,
33 /// Total GPU frames submitted through this driver.
34 #[get(type(copy))]
35 pub(crate) submitted_frames: u64,
36 /// Total instanced quad uploads submitted to the GPU.
37 #[get(type(copy))]
38 pub(crate) uploaded_instances: u64,
39 /// Fallback command recorder active on headless hosts.
40 pub(crate) fallback: RecordingGpuDriver,
41}