Skip to main content

GpuTextureHandle

Struct GpuTextureHandle 

Source
pub struct GpuTextureHandle { /* private fields */ }
Expand description

Shared GPU texture/render-target handle composited directly with the EUV HUD on the same device without CPU readback.

Implementations§

Source§

impl GpuTextureHandle

Validation and footprint helpers for GpuTextureHandle.

Source

pub const fn new( texture_id: u64, device_id: u64, generation: u64, dimensions: (u32, u32), format: GpuTextureFormat, fence_value: u64, origin_top_left: bool, ) -> Self

Constructs a persistent GPU texture handle bound to (texture_id, device_id) with exact (width, height) dimensions and format.

§Arguments
  • u64 - Backend-opaque GPU texture identifier.
  • u64 - Owning GPU logical device identifier.
  • u64 - Surface generation counter.
  • (u32, u32) - Texture (width, height) in physical pixels.
  • GpuTextureFormat - GPU texture pixel format.
  • u64 - Synchronization fence value.
  • bool - Whether the texture uses top-left origin orientation.
§Returns
  • Self - Constructed GPU texture handle.
Source

pub const fn is_valid(&self) -> bool

Returns true when this handle refers to a non-zero GPU texture with non-zero dimensions.

§Arguments
  • &Self - Texture handle reference.
§Returns
  • bool - Validity flag.
Source

pub const fn matches_device(&self, expected_device: u64) -> bool

Returns true when this handle belongs to device_id and can be composited without cross-device copies.

§Arguments
  • &Self - Texture handle reference.
  • u64 - Expected logical GPU device identifier.
§Returns
  • bool - true when valid and matching device_id.
Source

pub const fn bytes_per_pixel(&self) -> usize

Returns bytes per pixel for this handle’s GpuTextureFormat.

§Arguments
  • &Self - Texture handle reference.
§Returns
  • usize - Byte width per pixel (4 or 8).
Source

pub const fn estimated_bytes(&self) -> usize

Returns estimated GPU texture footprint in bytes.

§Arguments
  • &Self - Texture handle reference.
§Returns
  • usize - Estimated GPU memory footprint in bytes.
Source§

impl GpuTextureHandle

Source

pub fn get_texture_id(&self) -> u64

Source

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

Source

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

Source

pub fn get_device_id(&self) -> u64

Source

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

Source

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

Source

pub fn get_generation(&self) -> u64

Source

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

Source

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

Source

pub fn get_width(&self) -> u32

Source

pub fn get_mut_width(&mut self) -> &mut u32

Source

pub fn set_width(&mut self, val: u32) -> &mut Self

Source

pub fn get_height(&self) -> u32

Source

pub fn get_mut_height(&mut self) -> &mut u32

Source

pub fn set_height(&mut self, val: u32) -> &mut Self

Source

pub fn get_format(&self) -> GpuTextureFormat

Source

pub fn get_mut_format(&mut self) -> &mut GpuTextureFormat

Source

pub fn set_format(&mut self, val: GpuTextureFormat) -> &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_origin_top_left(&self) -> bool

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for GpuTextureHandle

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 GpuTextureHandle

Source§

impl Debug for GpuTextureHandle

Source§

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

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

impl Default for GpuTextureHandle

Source§

fn default() -> Self

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

impl Eq for GpuTextureHandle

Source§

impl Hash for GpuTextureHandle

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GpuTextureHandle

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 GpuTextureHandle

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.