pub struct VulkanFrameTarget {
pub image: Image,
pub view: ImageView,
pub format: Format,
pub extent: Extent2D,
pub initial_layout: ImageLayout,
pub final_layout: ImageLayout,
}Expand description
One host-owned Vulkan image target for an Ailloli UI render pass.
Immersive hosts will usually wrap the currently acquired presented image and its image view. The host remains responsible for acquire/release/composition.
§Examples
use ailloli_ui_render_vulkan::VulkanFrameTarget;
use ash::vk;
let target = VulkanFrameTarget::new(
vk::Image::null(),
vk::ImageView::null(),
vk::Format::R8G8B8A8_UNORM,
vk::Extent2D { width: 1280, height: 720 },
);
assert_eq!(target.extent.width, 1280);Fields§
§image: ImageHost-owned target image; null is rejected at render time.
view: ImageViewHost-owned 2D image view; null is rejected at render time.
format: FormatPixel format used to build compatible render passes and pipelines.
extent: Extent2DNon-zero target extent in physical pixels.
initial_layout: ImageLayoutLayout expected before the renderer’s transition.
final_layout: ImageLayoutLayout produced after rendering completes.
Implementations§
Source§impl VulkanFrameTarget
Constructors for host-owned frame targets.
impl VulkanFrameTarget
Constructors for host-owned frame targets.
Sourcepub fn new(
image: Image,
view: ImageView,
format: Format,
extent: Extent2D,
) -> Self
pub fn new( image: Image, view: ImageView, format: Format, extent: Extent2D, ) -> Self
Creates a target transitioning from UNDEFINED to COLOR_ATTACHMENT_OPTIMAL.
Handle and extent validation is deferred to rendering so constructing a target does not call Vulkan.
§Examples
use ailloli_ui_render_vulkan::VulkanFrameTarget;
use ash::vk;
let target = VulkanFrameTarget::new(
vk::Image::null(), vk::ImageView::null(), vk::Format::B8G8R8A8_SRGB,
vk::Extent2D { width: 640, height: 480 },
);
assert!(target.initial_layout == vk::ImageLayout::UNDEFINED);
assert!(target.final_layout == vk::ImageLayout::COLOR_ATTACHMENT_OPTIMAL);Sourcepub fn with_layouts(
self,
initial_layout: ImageLayout,
final_layout: ImageLayout,
) -> Self
pub fn with_layouts( self, initial_layout: ImageLayout, final_layout: ImageLayout, ) -> Self
Replaces the layouts consumed and produced by the render pass.
§Examples
use ailloli_ui_render_vulkan::VulkanFrameTarget;
use ash::vk;
let target = VulkanFrameTarget::new(
vk::Image::null(), vk::ImageView::null(), vk::Format::B8G8R8A8_SRGB,
vk::Extent2D { width: 1, height: 1 },
).with_layouts(vk::ImageLayout::PRESENT_SRC_KHR, vk::ImageLayout::PRESENT_SRC_KHR);
assert!(target.initial_layout == vk::ImageLayout::PRESENT_SRC_KHR);Trait Implementations§
Source§impl Clone for VulkanFrameTarget
impl Clone for VulkanFrameTarget
Source§fn clone(&self) -> VulkanFrameTarget
fn clone(&self) -> VulkanFrameTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VulkanFrameTarget
Auto Trait Implementations§
impl Freeze for VulkanFrameTarget
impl RefUnwindSafe for VulkanFrameTarget
impl Send for VulkanFrameTarget
impl Sync for VulkanFrameTarget
impl Unpin for VulkanFrameTarget
impl UnwindSafe for VulkanFrameTarget
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§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.