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_display_sync_enabled(&mut self, enabled: bool)
pub fn set_display_sync_enabled(&mut self, enabled: bool)
Configures CAMetalLayer.displaySyncEnabled on macOS to switch between tear-free native VRR sync (true) and uncapped non-blocking hardware presentation (false).
§Arguments
bool-truefor hardware display sync;falsefor uncapped non-blocking presentation.
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 set_pending_gpu_scene_pass(&mut self, pass: Option<DirectGpuScenePass>)
pub fn set_pending_gpu_scene_pass(&mut self, pass: Option<DirectGpuScenePass>)
Stages an optional hardware GPU Ocean or 3D PBR offscreen scene pass for execution in the next frame’s command buffer.
§Arguments
Option<DirectGpuScenePass>- Hardware scene pass rendered before UI compositing, orNone.
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 Dual-Kawase blur_down and blur_up hardware pipelines compiled.
§Returns
bool-truewhenBackdropBlurcan execute natively on GPU without CPU fallback.
Sourcepub fn execute_dual_kawase_blur_passes(
&mut self,
width: u32,
height: u32,
blur_passes: &[GpuBackdropBlurPass],
) -> usize
pub fn execute_dual_kawase_blur_passes( &mut self, width: u32, height: u32, blur_passes: &[GpuBackdropBlurPass], ) -> usize
Executes Pass 3 Dual-Kawase blur_down + blur_up ping-pong passes on hardware GPU for blur_passes.
§Arguments
u32- Physical surface width in pixels.u32- Physical surface height in pixels.&[GpuBackdropBlurPass]- Active Dual-Kawase backdrop blur regions.
§Returns
usize- Number of Dual-Kawase blur regions executed on hardware GPU (0when unsupported).
Sourcepub fn precompiled_pipeline_count(&self) -> usize
pub fn precompiled_pipeline_count(&self) -> usize
Returns the count of resident hardware GPU render pipeline state objects (UI, Blur, 3D PBR, Fluid Ocean) currently cached on this driver.
§Returns
usize- Number of non-zero resident hardware pipeline handles (0..=4).
Source§impl NativeGpuDriver
Implements impl #impl_generics #name #ty_generics #where_clause.
impl NativeGpuDriver
Implements impl #impl_generics #name #ty_generics #where_clause.
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_blur_up_pipeline_handle(&self) -> usize
pub fn get_engine3d_pipeline_handle(&self) -> usize
pub fn get_ocean_pipeline_handle(&self) -> usize
pub fn get_scene_ocean_pipeline_handle(&self) -> usize
pub fn get_scene_boat_pipeline_handle(&self) -> usize
pub fn get_scene_3d_sky_pipeline_handle(&self) -> usize
pub fn get_scene_3d_mesh_pipeline_handle(&self) -> usize
pub fn get_scene_depth_stencil_handle(&self) -> usize
pub fn get_scene_color_texture_handle(&self) -> usize
pub fn get_scene_depth_texture_handle(&self) -> usize
pub fn get_scene_wake_texture_handle(&self) -> usize
pub fn get_scene_texture_dims(&self) -> (u32, u32)
pub fn get_scene_3d_vertex_buffer_handle(&self) -> usize
pub fn get_scene_3d_vertex_revision(&self) -> u64
pub fn get_scene_3d_vertex_capacity(&self) -> usize
pub fn get_scene_3d_instance_buffer_handle(&self) -> usize
pub fn get_scene_3d_instance_capacity(&self) -> usize
pub fn get_scene_boat_buffer_handle(&self) -> usize
pub fn get_scene_boat_capacity(&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_blur_scene_texture_handle(&self) -> usize
pub fn get_blur_half_texture_handle(&self) -> usize
pub fn get_blur_full_texture_handle(&self) -> usize
pub fn get_blur_texture_dims(&self) -> (u32, u32)
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.