Skip to main content

VulkanTexture

Struct VulkanTexture 

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

An image, its backing memory, and the state needed to transition it.

Ownership is explicit: a texture must be handed back to VulkanContext::destroy_texture. Automatic retirement belongs to the fence waiter, which tracks GPU completion and cannot be built until there is asynchronous work to track.

Implementations§

Source§

impl VulkanTexture

Source

pub fn wrap_image( image: Image, extent: Extent2D, format: PixelFormat, layout: ImageLayout, ) -> VulkanTexture

Wrap an image this backend did not create.

The caller keeps ownership: destroying the returned texture releases nothing, which is what makes it safe to hand back a swapchain image the presentation engine still owns.

Source

pub fn extent(&self) -> Extent2D

Source

pub fn format(&self) -> PixelFormat

Source

pub fn raw_image(&self) -> Image

Source

pub fn byte_size(&self) -> u64

Bytes a tightly packed readback of this texture occupies.

Trait Implementations§

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