pub struct OpenXrExternalVulkanContext<'a> {
pub device: &'a Device,
pub queue: Queue,
pub queue_family_index: u32,
pub command_pool: CommandPool,
pub memory_properties: Option<&'a PhysicalDeviceMemoryProperties>,
}Expand description
Borrowed Vulkan handles needed to render or upload in an external XR host.
Handles must all belong to the same live device and queue family. Memory properties are optional for rendering but required by staging allocations such as the ray overlay.
§Examples
use ailloli_ui_openxr::OpenXrExternalVulkanContext;
fn queue_family(context: OpenXrExternalVulkanContext<'_>) -> u32 { context.queue_family_index }Fields§
§device: &'a DeviceLive Vulkan logical device.
queue: QueueGraphics queue used for rendering and synchronous uploads.
queue_family_index: u32Family index owning queue and command_pool.
command_pool: CommandPoolCommand pool from which one-time and renderer buffers are allocated.
memory_properties: Option<&'a PhysicalDeviceMemoryProperties>Physical-device memory properties, or None when staging is unavailable.
Implementations§
Source§impl<'a> OpenXrExternalVulkanContext<'a>
impl<'a> OpenXrExternalVulkanContext<'a>
Sourcepub fn new(
device: &'a Device,
queue: Queue,
queue_family_index: u32,
command_pool: CommandPool,
) -> Self
pub fn new( device: &'a Device, queue: Queue, queue_family_index: u32, command_pool: CommandPool, ) -> Self
Creates a render-only context without memory properties.
§Examples
use ailloli_ui_openxr::OpenXrExternalVulkanContext;
fn make(device: &ash::Device, queue: ash::vk::Queue, pool: ash::vk::CommandPool) -> OpenXrExternalVulkanContext<'_> {
OpenXrExternalVulkanContext::new(device, queue, 0, pool)
}Sourcepub fn with_memory_properties(
device: &'a Device,
queue: Queue,
queue_family_index: u32,
command_pool: CommandPool,
memory_properties: &'a PhysicalDeviceMemoryProperties,
) -> Self
pub fn with_memory_properties( device: &'a Device, queue: Queue, queue_family_index: u32, command_pool: CommandPool, memory_properties: &'a PhysicalDeviceMemoryProperties, ) -> Self
Creates a context that also supports host-visible staging allocations.
§Examples
use ailloli_ui_openxr::OpenXrExternalVulkanContext;
fn make<'a>(device: &'a ash::Device, queue: ash::vk::Queue, pool: ash::vk::CommandPool, memory: &'a ash::vk::PhysicalDeviceMemoryProperties) -> OpenXrExternalVulkanContext<'a> {
OpenXrExternalVulkanContext::with_memory_properties(device, queue, 0, pool, memory)
}Sourcepub fn render_context(self) -> VulkanRenderContext<'a>
pub fn render_context(self) -> VulkanRenderContext<'a>
Converts this copyable host context to the renderer’s borrowed context.
Optional memory properties are preserved.
§Examples
use ailloli_ui_openxr::OpenXrExternalVulkanContext;
use ailloli_ui_render_vulkan::VulkanRenderContext;
fn convert<'a>(context: OpenXrExternalVulkanContext<'a>) -> VulkanRenderContext<'a> { context.render_context() }Trait Implementations§
Source§impl<'a> Clone for OpenXrExternalVulkanContext<'a>
impl<'a> Clone for OpenXrExternalVulkanContext<'a>
Source§fn clone(&self) -> OpenXrExternalVulkanContext<'a>
fn clone(&self) -> OpenXrExternalVulkanContext<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> From<&'a OpenXrVulkanContext> for OpenXrExternalVulkanContext<'a>
impl<'a> From<&'a OpenXrVulkanContext> for OpenXrExternalVulkanContext<'a>
Source§fn from(context: &'a OpenXrVulkanContext) -> Self
fn from(context: &'a OpenXrVulkanContext) -> Self
impl<'a> Copy for OpenXrExternalVulkanContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for OpenXrExternalVulkanContext<'a>
impl<'a> RefUnwindSafe for OpenXrExternalVulkanContext<'a>
impl<'a> Send for OpenXrExternalVulkanContext<'a>
impl<'a> Sync for OpenXrExternalVulkanContext<'a>
impl<'a> Unpin for OpenXrExternalVulkanContext<'a>
impl<'a> UnwindSafe for OpenXrExternalVulkanContext<'a>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more