pub struct Swapchain { /* private fields */ }
Expand description
Implementations§
Source§impl Swapchain
impl Swapchain
Sourcepub fn new(instance: &Instance, device: &Device) -> Self
pub fn new(instance: &Instance, device: &Device) -> Self
§Warning
Instance
functions cannot be loaded from a Device
and will always panic when called:
Load this struct using an Instance
instead via Self::new_from_instance()
if the
above Instance
function is called. This will be solved in the next breaking ash
release: https://github.com/ash-rs/ash/issues/727.
Sourcepub fn new_from_instance(
entry: &Entry,
instance: &Instance,
device: Device,
) -> Self
pub fn new_from_instance( entry: &Entry, instance: &Instance, device: Device, ) -> Self
Loads all functions on the Instance
instead of Device
. This incurs an extra
dispatch table for Device
functions but also allows the Instance
function to be
loaded instead of always panicking. See also Self::new()
for more details.
It is okay to pass vk::Device::null()
when this struct is only used to call the
Instance
function.
Sourcepub unsafe fn create_swapchain(
&self,
create_info: &SwapchainCreateInfoKHR,
allocation_callbacks: Option<&AllocationCallbacks>,
) -> VkResult<SwapchainKHR>
pub unsafe fn create_swapchain( &self, create_info: &SwapchainCreateInfoKHR, allocation_callbacks: Option<&AllocationCallbacks>, ) -> VkResult<SwapchainKHR>
Sourcepub unsafe fn destroy_swapchain(
&self,
swapchain: SwapchainKHR,
allocation_callbacks: Option<&AllocationCallbacks>,
)
pub unsafe fn destroy_swapchain( &self, swapchain: SwapchainKHR, allocation_callbacks: Option<&AllocationCallbacks>, )
Sourcepub unsafe fn get_swapchain_images(
&self,
swapchain: SwapchainKHR,
) -> VkResult<Vec<Image>>
pub unsafe fn get_swapchain_images( &self, swapchain: SwapchainKHR, ) -> VkResult<Vec<Image>>
Sourcepub unsafe fn acquire_next_image(
&self,
swapchain: SwapchainKHR,
timeout: u64,
semaphore: Semaphore,
fence: Fence,
) -> VkResult<(u32, bool)>
pub unsafe fn acquire_next_image( &self, swapchain: SwapchainKHR, timeout: u64, semaphore: Semaphore, fence: Fence, ) -> VkResult<(u32, bool)>
On success, returns the next image’s index and whether the swapchain is suboptimal for the surface.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImageKHR.html
Sourcepub unsafe fn queue_present(
&self,
queue: Queue,
present_info: &PresentInfoKHR,
) -> VkResult<bool>
pub unsafe fn queue_present( &self, queue: Queue, present_info: &PresentInfoKHR, ) -> VkResult<bool>
On success, returns whether the swapchain is suboptimal for the surface.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html
Sourcepub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR,
) -> VkResult<()>
pub unsafe fn get_device_group_present_capabilities( &self, device_group_present_capabilities: &mut DeviceGroupPresentCapabilitiesKHR, ) -> VkResult<()>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_device_group_present_capabilities()
when VK_KHR_surface
is enabled.
Sourcepub unsafe fn get_device_group_surface_present_modes(
&self,
surface: SurfaceKHR,
) -> VkResult<DeviceGroupPresentModeFlagsKHR>
pub unsafe fn get_device_group_surface_present_modes( &self, surface: SurfaceKHR, ) -> VkResult<DeviceGroupPresentModeFlagsKHR>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_device_group_surface_present_modes()
when VK_KHR_surface
is enabled.
Sourcepub unsafe fn get_physical_device_present_rectangles(
&self,
physical_device: PhysicalDevice,
surface: SurfaceKHR,
) -> VkResult<Vec<Rect2D>>
pub unsafe fn get_physical_device_present_rectangles( &self, physical_device: PhysicalDevice, surface: SurfaceKHR, ) -> VkResult<Vec<Rect2D>>
Only available since Vulkan 1.1.
Also available as DeviceGroup::get_physical_device_present_rectangles()
when VK_KHR_surface
is enabled.
§Warning
Function will always panic unless this struct is loaded via Self::new_from_instance()
.
Sourcepub unsafe fn acquire_next_image2(
&self,
acquire_info: &AcquireNextImageInfoKHR,
) -> VkResult<(u32, bool)>
pub unsafe fn acquire_next_image2( &self, acquire_info: &AcquireNextImageInfoKHR, ) -> VkResult<(u32, bool)>
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 DeviceGroup::acquire_next_image2()
when VK_KHR_swapchain
is enabled.
https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImage2KHR.html
pub const fn name() -> &'static CStr
pub fn fp(&self) -> &KhrSwapchainFn
pub fn device(&self) -> Device
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Swapchain
impl RefUnwindSafe for Swapchain
impl Send for Swapchain
impl Sync for Swapchain
impl Unpin for Swapchain
impl UnwindSafe for Swapchain
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)