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
impl VulkanTexture
Sourcepub fn wrap_image(
image: Image,
extent: Extent2D,
format: PixelFormat,
layout: ImageLayout,
) -> VulkanTexture
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.
pub fn extent(&self) -> Extent2D
pub fn format(&self) -> PixelFormat
pub fn raw_image(&self) -> Image
Trait Implementations§
Source§impl HalTexture for VulkanTexture
impl HalTexture for VulkanTexture
Auto Trait Implementations§
impl !Freeze for VulkanTexture
impl !RefUnwindSafe for VulkanTexture
impl !Sync for VulkanTexture
impl Send for VulkanTexture
impl Unpin for VulkanTexture
impl UnsafeUnpin for VulkanTexture
impl UnwindSafe for VulkanTexture
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