Skip to main content

IVulkanPlatformGraphicsContext

Trait IVulkanPlatformGraphicsContext 

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

Source

fn device(&self) -> Arc<dyn IVulkanDevice> ⓘ

The device of the context.

Source

fn instance(&self) -> Arc<dyn IVulkanInstance> ⓘ

The instance of the device.

Source

fn instance_api(&self) -> &VulkanInstanceApi

The instance-level entry points.

Source

fn device_api(&self) -> &VulkanDeviceApi

The device-level entry points.

Source

fn device_handle(&self) -> Device

The device as a typed handle.

Source

fn physical_device_handle(&self) -> PhysicalDevice

The physical device as a typed handle.

Source

fn instance_handle(&self) -> Instance

The instance as a typed handle.

Source

fn main_queue_handle(&self) -> Queue

The main queue as a typed handle. Only valid while the device is locked by the calling thread.

Source

fn graphics_queue_family_index(&self) -> u32

The index of the queue family of the main queue.

Source

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".

Implementors§