Struct Swapchain

Source
pub struct Swapchain {
    pub image_format: Format,
    pub extent: Extent2D,
    /* private fields */
}

Fields§

§image_format: Format§extent: Extent2D

Implementations§

Methods from Deref<Target = Device>§

Source

pub fn fp(&self) -> &DeviceFn

Source

pub fn device(&self) -> Device

Source

pub unsafe fn create_swapchain( &self, create_info: &SwapchainCreateInfoKHR<'_>, allocation_callbacks: Option<&AllocationCallbacks<'_>>, ) -> Result<SwapchainKHR, Result>

Source

pub unsafe fn destroy_swapchain( &self, swapchain: SwapchainKHR, allocation_callbacks: Option<&AllocationCallbacks<'_>>, )

Source

pub unsafe fn get_swapchain_images( &self, swapchain: SwapchainKHR, ) -> Result<Vec<Image>, Result>

Source

pub unsafe fn acquire_next_image( &self, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence, ) -> Result<(u32, bool), Result>

On success, returns the next image’s index and whether the swapchain is suboptimal for the surface.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImageKHR.html

Source

pub unsafe fn queue_present( &self, queue: Queue, present_info: &PresentInfoKHR<'_>, ) -> Result<bool, Result>

On success, returns whether the swapchain is suboptimal for the surface.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html

Source

pub unsafe fn get_device_group_present_capabilities( &self, device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR<'_>, ) -> Result<(), Result>

Only available since Vulkan 1.1.

Also available as [khr::device_group::Device::get_device_group_present_capabilities()] when VK_KHR_surface is enabled.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html

Source

pub unsafe fn get_device_group_surface_present_modes( &self, surface: SurfaceKHR, ) -> Result<DeviceGroupPresentModeFlagsKHR, Result>

Only available since Vulkan 1.1.

Also available as [khr::device_group::Device::get_device_group_surface_present_modes()] when VK_KHR_surface is enabled.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html

Source

pub unsafe fn acquire_next_image2( &self, acquire_info: &AcquireNextImageInfoKHR<'_>, ) -> Result<(u32, bool), Result>

On success, returns the next image’s index and whether the swapchain is suboptimal for the surface.

Only available since Vulkan 1.1.

Also available as [khr::device_group::Device::acquire_next_image2()] when VK_KHR_swapchain is enabled.

https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImage2KHR.html

Trait Implementations§

Source§

impl AsRef<SwapchainKHR> for Swapchain

Source§

fn as_ref(&self) -> &SwapchainKHR

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Deref for Swapchain

Source§

type Target = Device

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more