pub trait IVulkanPlatformGraphicsContext: IPlatformGraphicsContext {
// Required methods
fn device(&self) -> Arc<dyn IVulkanDevice> ⓘ;
fn instance(&self) -> Arc<dyn IVulkanInstance> ⓘ;
fn instance_api(&self) -> &VulkanInstanceApi;
fn device_api(&self) -> &VulkanDeviceApi;
fn device_handle(&self) -> Device;
fn physical_device_handle(&self) -> PhysicalDevice;
fn instance_handle(&self) -> Instance;
fn main_queue_handle(&self) -> Queue;
fn graphics_queue_family_index(&self) -> u32;
fn create_render_target(
&self,
surfaces: &[Arc<dyn IPlatformRenderSurface>],
) -> Rc<dyn IVulkanRenderTarget>;
}Expand description
A platform graphics context that renders with Vulkan.
A graphics context that is a Vulkan context announces it through its
optional features: try_get_feature(TypeId::of::<dyn IVulkanPlatformGraphicsContext>()) returns an Rc<dyn IVulkanPlatformGraphicsContext>.
The contract is implemented by this crate only: the members after
instance up to
graphics_queue_family_index are
what the objects of the crate (images, command buffers, the swap chain)
read of their context.
Required Methods§
Sourcefn device(&self) -> Arc<dyn IVulkanDevice> ⓘ
fn device(&self) -> Arc<dyn IVulkanDevice> ⓘ
The device of the context.
Sourcefn instance(&self) -> Arc<dyn IVulkanInstance> ⓘ
fn instance(&self) -> Arc<dyn IVulkanInstance> ⓘ
The instance of the device.
Sourcefn instance_api(&self) -> &VulkanInstanceApi
fn instance_api(&self) -> &VulkanInstanceApi
The instance-level entry points.
Sourcefn device_api(&self) -> &VulkanDeviceApi
fn device_api(&self) -> &VulkanDeviceApi
The device-level entry points.
Sourcefn device_handle(&self) -> Device
fn device_handle(&self) -> Device
The device as a typed handle.
Sourcefn physical_device_handle(&self) -> PhysicalDevice
fn physical_device_handle(&self) -> PhysicalDevice
The physical device as a typed handle.
Sourcefn instance_handle(&self) -> Instance
fn instance_handle(&self) -> Instance
The instance as a typed handle.
Sourcefn main_queue_handle(&self) -> Queue
fn main_queue_handle(&self) -> Queue
The main queue as a typed handle. Only valid while the device is locked by the calling thread.
Sourcefn graphics_queue_family_index(&self) -> u32
fn graphics_queue_family_index(&self) -> u32
The index of the queue family of the main queue.
Sourcefn create_render_target(
&self,
surfaces: &[Arc<dyn IPlatformRenderSurface>],
) -> Rc<dyn IVulkanRenderTarget>
fn create_render_target( &self, surfaces: &[Arc<dyn IPlatformRenderSurface>], ) -> Rc<dyn IVulkanRenderTarget>
Creates a render target for the first of the surfaces the context can render to.
§Panics
Panics when none of the surfaces is suitable, and when the swap chain of the surface cannot be created.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".