Struct vulkano::device::private_data::PrivateDataSlot
source · pub struct PrivateDataSlot { /* private fields */ }
Expand description
An object that stores one u64
value per Vulkan object.
Implementations§
source§impl PrivateDataSlot
impl PrivateDataSlot
sourcepub fn new(
device: Arc<Device>,
create_info: PrivateDataSlotCreateInfo
) -> Result<Self, Validated<VulkanError>>
pub fn new( device: Arc<Device>, create_info: PrivateDataSlotCreateInfo ) -> Result<Self, Validated<VulkanError>>
Creates a new PrivateDataSlot
.
The private_data
feature must be enabled on the device.
sourcepub unsafe fn from_handle(
device: Arc<Device>,
handle: PrivateDataSlot,
_create_info: PrivateDataSlotCreateInfo
) -> Self
pub unsafe fn from_handle( device: Arc<Device>, handle: PrivateDataSlot, _create_info: PrivateDataSlotCreateInfo ) -> Self
Creates a new PrivateDataSlot
from a raw object handle.
Safety
handle
must be a valid Vulkan object handle created fromdevice
.create_info
must match the info used to create the object.
sourcepub fn set_private_data<T: VulkanObject + DeviceOwned>(
&self,
object: &T,
data: u64
) -> Result<(), Validated<VulkanError>>
pub fn set_private_data<T: VulkanObject + DeviceOwned>( &self, object: &T, data: u64 ) -> Result<(), Validated<VulkanError>>
Sets the private data that is associated with object
to data
.
If self
already has data for object
, that data is replaced with the new value.
sourcepub fn get_private_data<T: VulkanObject + DeviceOwned>(&self, object: &T) -> u64
pub fn get_private_data<T: VulkanObject + DeviceOwned>(&self, object: &T) -> u64
Returns the private data in self
that is associated with object
.
If no private data was previously set, 0 is returned.
Trait Implementations§
source§impl Debug for PrivateDataSlot
impl Debug for PrivateDataSlot
source§impl DeviceOwned for PrivateDataSlot
impl DeviceOwned for PrivateDataSlot
source§impl Drop for PrivateDataSlot
impl Drop for PrivateDataSlot
source§impl VulkanObject for PrivateDataSlot
impl VulkanObject for PrivateDataSlot
Auto Trait Implementations§
impl !RefUnwindSafe for PrivateDataSlot
impl Send for PrivateDataSlot
impl Sync for PrivateDataSlot
impl Unpin for PrivateDataSlot
impl !UnwindSafe for PrivateDataSlot
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> DeviceOwnedVulkanObject for Twhere
T: DeviceOwned + VulkanObject,
impl<T> DeviceOwnedVulkanObject for Twhere T: DeviceOwned + VulkanObject,
source§fn set_debug_utils_object_name(
&self,
object_name: Option<&str>
) -> Result<(), VulkanError>
fn set_debug_utils_object_name( &self, object_name: Option<&str> ) -> Result<(), VulkanError>
Assigns a human-readable name to the object for debugging purposes. Read more