Trait VulkanObject

Source
pub trait VulkanObject:
    Sized
    + Send
    + Sync
    + Clone
    + Debug {
    type NativeVulkanObject;

    // Required methods
    fn id(&self) -> u64;
    fn as_native_vulkan_object(&self) -> Self::NativeVulkanObject;
    fn try_destroy(self) -> Result<(), TryDestroyError<Self>>;
}

Required Associated Types§

Required Methods§

Source

fn id(&self) -> u64

Get the object id.

This function returns the same value as as_native_vulkan_object(), but conveniently cast to a u64. This is useful for extensions like VK_EXT_debug_report and VK_EXT_debug_marker, which use these to refer Vulkan objects.

Object ids (or more correctly, handles) come in two variants, dispatchable and non-dispatchable. While dispatchable objects are actually pointers, and thus unique, the same is not true for non-dispatchable objects. For instance, two Semaphores, created independently of each other, might in fact have the same handle.

Additionally, handles of non-dispatchable objects are only ever meaningful, if their type is known (whether it is i.e. a Semaphore or some other type). This must be taken into account, if handles are used to identify Vulkan objects.

Refer to the Vulkan specification (Object Model) for more information.

Source

fn as_native_vulkan_object(&self) -> Self::NativeVulkanObject

Source

fn try_destroy(self) -> Result<(), TryDestroyError<Self>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl VulkanObject for Buffer

Source§

impl VulkanObject for BufferView

Source§

impl VulkanObject for CommandBuffer

Source§

impl VulkanObject for CommandPool

Source§

impl VulkanObject for DescriptorPool

Source§

impl VulkanObject for DescriptorSet

Source§

impl VulkanObject for DescriptorSetLayout

Source§

impl VulkanObject for Device

Source§

impl VulkanObject for DeviceMemory

Source§

impl VulkanObject for Event

Source§

impl VulkanObject for Fence

Source§

impl VulkanObject for Framebuffer

Source§

impl VulkanObject for Image

Source§

impl VulkanObject for ImageView

Source§

impl VulkanObject for Instance

Source§

impl VulkanObject for PhysicalDevice

Source§

impl VulkanObject for Pipeline

Source§

impl VulkanObject for PipelineCache

Source§

impl VulkanObject for PipelineLayout

Source§

impl VulkanObject for QueryPool

Source§

impl VulkanObject for Queue

Source§

impl VulkanObject for RenderPass

Source§

impl VulkanObject for Sampler

Source§

impl VulkanObject for Semaphore

Source§

impl VulkanObject for ShaderModule

Source§

impl VulkanObject for DebugReportCallbackExt

Source§

impl VulkanObject for DisplayKhr

Source§

impl VulkanObject for DisplayModeKhr

Source§

impl VulkanObject for SurfaceKhr

Source§

impl VulkanObject for SwapchainKhr