Struct ccthw::graphics::vulkan_api::RenderDevice
source · pub struct RenderDevice { /* private fields */ }
Expand description
A combination of the VulkanInstance, LogicalDevice, and queues required by this application.
Implementations§
source§impl RenderDevice
impl RenderDevice
sourcepub unsafe fn new(
instance: VulkanInstance,
features: PhysicalDeviceFeatures,
surface: SurfaceKHR
) -> Result<Self, GraphicsError>
pub unsafe fn new( instance: VulkanInstance, features: PhysicalDeviceFeatures, surface: SurfaceKHR ) -> Result<Self, GraphicsError>
Create a new render device.
Params
instance
- the VulkanInstance used to create all application resources. The RenderDevice takes ownership of the vulkan instance so it can be destroyed in the correct order.features
- the physical device features required by this application.surface
- the surface this application will use for swapchain presentation. Typically provided by the windowing system.
Safety
Unsafe because the application must destroy the render device before exit. The application must also destroy all resources created by the logical device before destroying the render device.
sourcepub fn memory(&self) -> MutexGuard<'_, MemoryAllocator>
pub fn memory(&self) -> MutexGuard<'_, MemoryAllocator>
Borrow the device memory allocator.
sourcepub fn set_debug_name(
&self,
handle: impl Handle,
object_type: ObjectType,
name: impl Into<String>
)
pub fn set_debug_name( &self, handle: impl Handle, object_type: ObjectType, name: impl Into<String> )
Set the name that shows up in Vulkan debug logs for a given resource.
Params
handle
- a Vulkan resource represented by the Ash libraryobject_type
- the Vulkan object typename
- a human-readable name for the object. This will show up in debug logs if the object is referenced.
sourcepub fn presentation_queue(&self) -> &Queue
pub fn presentation_queue(&self) -> &Queue
The queue this application uses for graphics operations.
sourcepub fn graphics_queue(&self) -> &Queue
pub fn graphics_queue(&self) -> &Queue
The queue this application uses for graphics operations.
sourcepub unsafe fn device(&self) -> &Device
pub unsafe fn device(&self) -> &Device
The Ash logical device used to interface with the underlying Vulkan hardware device.
Safety
The caller must not keep copies of the device handle after the render device is dropped.
sourcepub unsafe fn surface(&self) -> &SurfaceKHR
pub unsafe fn surface(&self) -> &SurfaceKHR
The KHR surface provided by the window system for rendering.
Safety
The caller must not keep copies of the device handle after the render device is dropped.
sourcepub fn get_surface_formats(
&self
) -> Result<Vec<SurfaceFormatKHR>, GraphicsError>
pub fn get_surface_formats( &self ) -> Result<Vec<SurfaceFormatKHR>, GraphicsError>
Get all of the surface formats supported by this device.
sourcepub fn get_present_modes(&self) -> Result<Vec<PresentModeKHR>, GraphicsError>
pub fn get_present_modes(&self) -> Result<Vec<PresentModeKHR>, GraphicsError>
Get all of the presentation modes supported by this device.
sourcepub fn get_surface_capabilities(
&self
) -> Result<SurfaceCapabilitiesKHR, GraphicsError>
pub fn get_surface_capabilities( &self ) -> Result<SurfaceCapabilitiesKHR, GraphicsError>
Get the surface capabilities for this device.
Trait Implementations§
source§impl Debug for RenderDevice
impl Debug for RenderDevice
source§impl Display for RenderDevice
impl Display for RenderDevice
Auto Trait Implementations§
impl RefUnwindSafe for RenderDevice
impl !Send for RenderDevice
impl !Sync for RenderDevice
impl Unpin for RenderDevice
impl UnwindSafe for RenderDevice
Blanket Implementations§
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.