Skip to main content

GpuSharedSurface

Struct GpuSharedSurface 

Source
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§

Source§

impl GpuSharedSurface

Zero-readback shared GPU 3D+HUD presentation chain coordination for GpuSharedSurface.

Source

pub fn new_shared( handle: GpuTextureHandle, viewport_rect: Rect, hud_overlay_rect: Rect, ) -> Self

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.
Source

pub fn is_shared_gpu_ready(&self, compositor_device_id: u64) -> bool

Returns true when the shared surface holds a valid GPU texture matching compositor_device_id with zero CPU readback.

§Arguments
  • &Self - Shared surface reference.
  • u64 - Active compositor logical GPU device identifier.
§Returns
  • bool - true when direct same-device GPU compositing is ready.
Source

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.
Source

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.
Source

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.
Source§

impl GpuSharedSurface

Source

pub fn get_handle(&self) -> GpuTextureHandle

Source

pub fn get_mut_handle(&mut self) -> &mut GpuTextureHandle

Source

pub fn set_handle(&mut self, val: GpuTextureHandle) -> &mut Self

Source

pub fn get_viewport_rect(&self) -> Rect

Source

pub fn get_mut_viewport_rect(&mut self) -> &mut Rect

Source

pub fn set_viewport_rect(&mut self, val: Rect) -> &mut Self

Source

pub fn get_hud_overlay_rect(&self) -> Rect

Source

pub fn get_mut_hud_overlay_rect(&mut self) -> &mut Rect

Source

pub fn set_hud_overlay_rect(&mut self, val: Rect) -> &mut Self

Source

pub fn get_zero_cpu_readback(&self) -> bool

Source

pub fn get_mut_zero_cpu_readback(&mut self) -> &mut bool

Source

pub fn set_zero_cpu_readback(&mut self, val: bool) -> &mut Self

Source

pub fn get_duplicate_upload_avoided(&self) -> bool

Source

pub fn get_mut_duplicate_upload_avoided(&mut self) -> &mut bool

Source

pub fn set_duplicate_upload_avoided(&mut self, val: bool) -> &mut Self

Source

pub fn get_world_revision(&self) -> u64

Source

pub fn get_mut_world_revision(&mut self) -> &mut u64

Source

pub fn set_world_revision(&mut self, val: u64) -> &mut Self

Source

pub fn get_hud_revision(&self) -> u64

Source

pub fn get_mut_hud_revision(&mut self) -> &mut u64

Source

pub fn set_hud_revision(&mut self, val: u64) -> &mut Self

Source

pub fn get_presented_world_revision(&self) -> u64

Source

pub fn get_mut_presented_world_revision(&mut self) -> &mut u64

Source

pub fn set_presented_world_revision(&mut self, val: u64) -> &mut Self

Source

pub fn get_presented_hud_revision(&self) -> u64

Source

pub fn get_mut_presented_hud_revision(&mut self) -> &mut u64

Source

pub fn set_presented_hud_revision(&mut self, val: u64) -> &mut Self

Source

pub fn get_fence_value(&self) -> u64

Source

pub fn get_mut_fence_value(&mut self) -> &mut u64

Source

pub fn set_fence_value(&mut self, val: u64) -> &mut Self

Source

pub fn get_cpu_readback_bytes(&self) -> u64

Source

pub fn get_mut_cpu_readback_bytes(&mut self) -> &mut u64

Source

pub fn set_cpu_readback_bytes(&mut self, val: u64) -> &mut Self

Source

pub fn get_full_frame_uploads(&self) -> u64

Source

pub fn get_mut_full_frame_uploads(&mut self) -> &mut u64

Source

pub fn set_full_frame_uploads(&mut self, val: u64) -> &mut Self

Source

pub fn get_shared_gpu_composites(&self) -> u64

Source

pub fn get_mut_shared_gpu_composites(&mut self) -> &mut u64

Source

pub fn set_shared_gpu_composites(&mut self, val: u64) -> &mut Self

Source

pub fn get_hud_only_reuses(&self) -> u64

Source

pub fn get_mut_hud_only_reuses(&mut self) -> &mut u64

Source

pub fn set_hud_only_reuses(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for GpuSharedSurface

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GpuSharedSurface

Source§

impl Debug for GpuSharedSurface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GpuSharedSurface

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for GpuSharedSurface

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GpuSharedSurface

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.