ferroui_vulkan/lib.rs
1//! The Vulkan platform contracts and the platform graphics over them.
2//!
3//! What a platform exposes so that a render backend can draw with Vulkan:
4//! the instance and the device ([`IVulkanInstance`], [`IVulkanDevice`]), the
5//! graphics context of a device ([`IVulkanPlatformGraphicsContext`]), the
6//! surfaces a context presents to ([`IVulkanKhrSurfacePlatformSurface`],
7//! [`IVulkanKhrSurfacePlatformSurfaceFactory`],
8//! [`IVulkanRenderTargetPlatformSurface`]), the render target of a surface
9//! and the session of a frame ([`IVulkanRenderTarget`],
10//! [`IVulkanRenderSession`]), and the import of images and semaphores that
11//! were created outside of a device
12//! ([`IVulkanContextExternalObjectsFeature`]).
13//!
14//! And the implementation every windowing platform shares
15//! ([`VulkanPlatformGraphics`]): it creates the instance (with the debug
16//! messenger when asked), selects a physical device, creates the device with
17//! its queue, and gives each thread that renders a context whose render
18//! targets present through a swap chain. A platform adds three things
19//! ([`VulkanPlatformSpecificOptions`]): the way to the entry points of the
20//! Vulkan loader, the instance extensions of its window system, and the
21//! factory that turns its windows into surfaces.
22//!
23//! These types belong to no render backend. The types, constants and
24//! function tables of Vulkan are those of the [`ash`] crate, which is
25//! exported again for the crates that implement or read the contracts; the
26//! loader of the system is opened at run time ([`ash::Entry::load`]), and
27//! nothing is linked.
28
29#![deny(unsafe_op_in_unsafe_fn)]
30
31mod i_vulkan_context_external_objects_feature;
32mod i_vulkan_device;
33mod i_vulkan_platform_surface;
34mod i_vulkan_render_target;
35mod interop;
36pub mod unmanaged_interop;
37mod vulkan_bindings;
38mod vulkan_context;
39mod vulkan_exception;
40mod vulkan_external_objects_feature;
41mod vulkan_image_info;
42mod vulkan_khr_surface_render_target;
43mod vulkan_options;
44mod vulkan_platform_graphics;
45
46#[cfg(test)]
47mod live_tests;
48
49pub use ash;
50
51pub use i_vulkan_context_external_objects_feature::{
52 IVulkanContextExternalObjectsFeature, IVulkanExternalImage, IVulkanExternalSemaphore,
53};
54pub use i_vulkan_device::{IVulkanDevice, IVulkanInstance, IVulkanPlatformGraphicsContext};
55pub use i_vulkan_platform_surface::{
56 try_get_vulkan_khr_surface, try_get_vulkan_render_target_surface, IVulkanKhrSurfacePlatformSurface,
57 IVulkanKhrSurfacePlatformSurfaceFactory, IVulkanRenderTargetPlatformSurface,
58};
59pub use i_vulkan_render_target::{IVulkanRenderSession, IVulkanRenderTarget};
60pub use vulkan_bindings::VulkanHelpers;
61pub use vulkan_exception::{VulkanException, VulkanExceptionExtensions, VulkanResultExtensions};
62pub use vulkan_image_info::VulkanImageInfo;
63pub use vulkan_options::{
64 Version, VkGetInstanceProcAddressDelegate, VulkanDeviceCheckSurfaceFactory, VulkanDeviceCreationOptions,
65 VulkanInstanceCreationOptions, VulkanOptions, VulkanPlatformSpecificOptions,
66};
67pub use vulkan_platform_graphics::{IVulkanDeviceFactory, VulkanPlatformGraphics};
68
69pub(crate) use vulkan_external_objects_feature::VulkanExternalObjectsFeature;
70pub(crate) use vulkan_khr_surface_render_target::VulkanKhrRenderTarget;