pub struct GpuSharedSurface { /* private fields */ }Expand description
Shared GPU presentation chain binding a 3D render target texture and HUD overlay on one device with zero_cpu_readback = true.
Implementations§
Creates a GpuSharedSurface binding handle to viewport_rect and hud_overlay_rect with zero_cpu_readback = true when valid.
§Arguments
GpuTextureHandle- Same-device 3D GPU render target texture handle.Rect- 3D viewport destination bounds in logical coordinates.Rect- HUD overlay destination bounds in logical coordinates.
§Returns
Self- Configured shared GPU presentation surface.
Sourcepub fn mark_world_updated(&mut self)
pub fn mark_world_updated(&mut self)
Marks the 3D scene world texture updated for the next shared GPU composite.
§Arguments
&Self- Mutable shared surface.
Sourcepub fn mark_hud_updated(&mut self)
pub fn mark_hud_updated(&mut self)
Marks only the HUD overlay updated so the compositor can reuse the existing 3D texture without re-rendering 3D.
§Arguments
&Self- Mutable shared surface.
Sourcepub fn compose_frame(
&mut self,
compositor_device_id: u64,
render_ctx: &mut GameRenderContext<'_>,
) -> SharedGpuCompositeReceipt
pub fn compose_frame( &mut self, compositor_device_id: u64, render_ctx: &mut GameRenderContext<'_>, ) -> SharedGpuCompositeReceipt
Composes the 3D viewport texture and HUD overlay on the shared GPU present chain with zero CPU readback and zero duplicate full-frame upload.
§Arguments
&Self- Mutable shared surface.u64- Active compositor logical GPU device identifier.&mut GameRenderContext<'_>- Active viewport render context receiving the direct GPU texture composite descriptor.
§Returns
SharedGpuCompositeReceipt- Honest receipt detailing zero-readback status, world reuse, and fence progression.
pub fn get_handle(&self) -> GpuTextureHandle
pub fn get_mut_handle(&mut self) -> &mut GpuTextureHandle
pub fn set_handle(&mut self, val: GpuTextureHandle) -> &mut Self
pub fn get_viewport_rect(&self) -> Rect
pub fn get_mut_viewport_rect(&mut self) -> &mut Rect
pub fn set_viewport_rect(&mut self, val: Rect) -> &mut Self
pub fn get_hud_overlay_rect(&self) -> Rect
pub fn get_mut_hud_overlay_rect(&mut self) -> &mut Rect
pub fn set_hud_overlay_rect(&mut self, val: Rect) -> &mut Self
pub fn get_zero_cpu_readback(&self) -> bool
pub fn get_mut_zero_cpu_readback(&mut self) -> &mut bool
pub fn set_zero_cpu_readback(&mut self, val: bool) -> &mut Self
pub fn get_duplicate_upload_avoided(&self) -> bool
pub fn get_mut_duplicate_upload_avoided(&mut self) -> &mut bool
pub fn set_duplicate_upload_avoided(&mut self, val: bool) -> &mut Self
pub fn get_world_revision(&self) -> u64
pub fn get_mut_world_revision(&mut self) -> &mut u64
pub fn set_world_revision(&mut self, val: u64) -> &mut Self
pub fn get_hud_revision(&self) -> u64
pub fn get_mut_hud_revision(&mut self) -> &mut u64
pub fn set_hud_revision(&mut self, val: u64) -> &mut Self
pub fn get_presented_world_revision(&self) -> u64
pub fn get_mut_presented_world_revision(&mut self) -> &mut u64
pub fn set_presented_world_revision(&mut self, val: u64) -> &mut Self
pub fn get_presented_hud_revision(&self) -> u64
pub fn get_mut_presented_hud_revision(&mut self) -> &mut u64
pub fn set_presented_hud_revision(&mut self, val: u64) -> &mut Self
pub fn get_fence_value(&self) -> u64
pub fn get_mut_fence_value(&mut self) -> &mut u64
pub fn set_fence_value(&mut self, val: u64) -> &mut Self
pub fn get_cpu_readback_bytes(&self) -> u64
pub fn get_mut_cpu_readback_bytes(&mut self) -> &mut u64
pub fn set_cpu_readback_bytes(&mut self, val: u64) -> &mut Self
pub fn get_full_frame_uploads(&self) -> u64
pub fn get_mut_full_frame_uploads(&mut self) -> &mut u64
pub fn set_full_frame_uploads(&mut self, val: u64) -> &mut Self
pub fn get_hud_only_reuses(&self) -> u64
pub fn get_mut_hud_only_reuses(&mut self) -> &mut u64
pub fn set_hud_only_reuses(&mut self, val: u64) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more