pub struct NativeGpuDriver { /* private fields */ }Expand description
Physical OS GPU driver wrapping Metal, D3D12, Vulkan, or WebGL2 with real fenced ring submission and automatic fallback.
Implementations§
Source§impl NativeGpuDriver
Construction, surface attachment, texture dirty-rect upload, and pipeline query helpers for NativeGpuDriver.
impl NativeGpuDriver
Construction, surface attachment, texture dirty-rect upload, and pipeline query helpers for NativeGpuDriver.
Sourcepub fn probe(backend: GraphicsBackend) -> Self
pub fn probe(backend: GraphicsBackend) -> Self
Sourcepub fn switch_backend(&mut self, backend: GraphicsBackend)
pub fn switch_backend(&mut self, backend: GraphicsBackend)
Re-initializes the GPU driver for backend, releasing any previously retained OS handles.
§Arguments
GraphicsBackend- Target graphics backend.
Sourcepub fn attach_metal_layer(&mut self, layer_handle: usize)
pub fn attach_metal_layer(&mut self, layer_handle: usize)
Attaches a native CAMetalLayer* (or equivalent surface layer) for zero-readback hardware presentation.
§Arguments
usize- NativeCAMetalLayer*pointer (0detaches).
Sourcepub fn set_external_texture(&mut self, texture_handle: usize)
pub fn set_external_texture(&mut self, texture_handle: usize)
Binds an external shared-device GPU texture handle (3D game render target or hardware video surface).
§Arguments
usize- Native external texture handle (0restores fallback dummy texture).
Sourcepub fn upload_texture_dirty_rect(
&mut self,
format: GpuAtlasPixelFormat,
texture_slot: u8,
tex_dims: (u32, u32),
dirty_rect: (u32, u32, u32, u32),
bytes: &[u8],
bytes_per_row: usize,
) -> bool
pub fn upload_texture_dirty_rect( &mut self, format: GpuAtlasPixelFormat, texture_slot: u8, tex_dims: (u32, u32), dirty_rect: (u32, u32, u32, u32), bytes: &[u8], bytes_per_row: usize, ) -> bool
Uploads a dirty R8 or RGBA8 sub-rectangle to the resident glyph atlas or image texture on GPU.
§Arguments
GpuAtlasPixelFormat- Target texture pixel format (R8UnormorRgba8Unorm).u8- Texture slot (0= R8 glyph atlas,1= RGBA8 color glyph atlas,2= UI image texture).(u32, u32)- Full backing texture dimensions(width, height).(u32, u32, u32, u32)- Dirty sub-region(x, y, width, height).&[u8]- Source pixel bytes.usize- Row stride in bytes.
§Returns
bool-truewhen the dirty sub-rectangle uploaded cleanly to hardware GPU memory.
Sourcepub fn supports_backdrop_blur_pass(&self) -> bool
pub fn supports_backdrop_blur_pass(&self) -> bool
Returns true when the driver has both a live compiled GPU blur pipeline and an attached presentation surface.
§Returns
bool-truewhenBackdropBlurcan execute natively on GPU without CPU fallback.
Source§impl NativeGpuDriver
impl NativeGpuDriver
pub fn get_adapter(&self) -> &GpuAdapterInfo
pub fn get_device_handle(&self) -> usize
pub fn get_queue_handle(&self) -> usize
pub fn get_library_handle(&self) -> usize
pub fn get_pipeline_handle(&self) -> usize
pub fn get_blur_pipeline_handle(&self) -> usize
pub fn get_surface_layer_handle(&self) -> usize
pub fn get_glyph_r8_texture_handle(&self) -> usize
pub fn get_glyph_rgba8_texture_handle(&self) -> usize
pub fn get_image_texture_handle(&self) -> usize
pub fn get_external_texture_handle(&self) -> usize
pub fn get_ring_slots(&self) -> &[NativeGpuRingSlot; 3]
pub fn get_ring_cursor(&self) -> usize
pub fn get_submitted_frames(&self) -> u64
pub fn get_uploaded_instances(&self) -> u64
pub fn get_uploaded_bytes(&self) -> u64
pub fn get_last_upload_bytes(&self) -> usize
pub fn get_last_submitted_batches(&self) -> usize
pub fn get_staging_reallocations(&self) -> u64
pub fn get_last_presented_time_ns(&self) -> u64
pub fn get_last_gpu_exec_ns(&self) -> u64
pub fn get_fallback(&self) -> &RecordingGpuDriver
Trait Implementations§
Source§impl Debug for NativeGpuDriver
impl Debug for NativeGpuDriver
Source§impl Default for NativeGpuDriver
Default NativeGpuDriver targets headless recording fallback.
impl Default for NativeGpuDriver
Default NativeGpuDriver targets headless recording fallback.
Source§impl Drop for NativeGpuDriver
Automatic native GPU handle cleanup when NativeGpuDriver is dropped.
impl Drop for NativeGpuDriver
Automatic native GPU handle cleanup when NativeGpuDriver is dropped.
Source§impl GpuDriver for NativeGpuDriver
GpuDriver implementation uploading packed 64-byte GpuPrimitiveInstance streams to the active physical OS GPU.
impl GpuDriver for NativeGpuDriver
GpuDriver implementation uploading packed 64-byte GpuPrimitiveInstance streams to the active physical OS GPU.
Source§fn backend(&self) -> GraphicsBackend
fn backend(&self) -> GraphicsBackend
Source§fn shader_source(&self) -> &'static str
fn shader_source(&self) -> &'static str
Returns the native shader source compiled by this GPU backend.
§Returns
&'static str- Native shader program source.