Struct vulkano::device::Device [−][src]
pub struct Device { /* fields omitted */ }
Represents a Vulkan context.
Implementations
impl Device
[src]
impl Device
[src]pub fn new<'a, I, Ext>(
phys: PhysicalDevice<'_>,
requested_features: &Features,
extensions: Ext,
queue_families: I
) -> Result<(Arc<Device>, QueuesIter), DeviceCreationError> where
I: IntoIterator<Item = (QueueFamily<'a>, f32)>,
Ext: Into<RawDeviceExtensions>,
[src]
pub fn new<'a, I, Ext>(
phys: PhysicalDevice<'_>,
requested_features: &Features,
extensions: Ext,
queue_families: I
) -> Result<(Arc<Device>, QueuesIter), DeviceCreationError> where
I: IntoIterator<Item = (QueueFamily<'a>, f32)>,
Ext: Into<RawDeviceExtensions>,
[src]Builds a new Vulkan device for the given physical device.
You must pass two things when creating a logical device:
-
A list of optional Vulkan features that must be enabled on the device. Note that if a feature is not enabled at device creation, you can’t use it later even it it’s supported by the physical device.
-
An iterator to a list of queues to create. Each element of the iterator must indicate the family whose queue belongs to and a priority between 0.0 and 1.0 to assign to it. A queue with a higher value indicates that the commands will execute faster than on a queue with a lower value. Note however that no guarantee can be made on the way the priority value is handled by the implementation.
Panic
- Panics if one of the queue families doesn’t belong to the given device.
pub fn pointers(&self) -> &DevicePointers
[src]
pub fn pointers(&self) -> &DevicePointers
[src]Grants access to the pointers to the Vulkan functions of the device.
pub unsafe fn wait(&self) -> Result<(), OomError>
[src]
pub unsafe fn wait(&self) -> Result<(), OomError>
[src]Waits until all work on this device has finished. You should never need to call this function, but it can be useful for debugging or benchmarking purposes.
Note: This is the Vulkan equivalent of OpenGL’s
glFinish
.
Safety
This function is not thread-safe. You must not submit anything to any of the queue of the device (either explicitly or implicitly, for example with a future’s destructor) while this function is waiting.
pub fn physical_device(&self) -> PhysicalDevice<'_>
[src]
pub fn physical_device(&self) -> PhysicalDevice<'_>
[src]Returns the physical device that was used to create this device.
pub fn active_queue_families<'a>(
&'a self
) -> Box<dyn ExactSizeIterator<Item = QueueFamily<'a>> + 'a>
[src]
pub fn active_queue_families<'a>(
&'a self
) -> Box<dyn ExactSizeIterator<Item = QueueFamily<'a>> + 'a>
[src]Returns an iterator to the list of queues families that this device uses.
Note: Will return
-> impl ExactSizeIterator<Item = QueueFamily>
in the future.
pub fn enabled_features(&self) -> &Features
[src]
pub fn enabled_features(&self) -> &Features
[src]Returns the features that are enabled in the device.
pub fn loaded_extensions(&self) -> &DeviceExtensions
[src]
pub fn loaded_extensions(&self) -> &DeviceExtensions
[src]Returns the list of extensions that have been loaded.
pub fn standard_pool(me: &Arc<Self>) -> Arc<StdMemoryPool>
[src]
pub fn standard_pool(me: &Arc<Self>) -> Arc<StdMemoryPool>
[src]Returns the standard memory pool used by default if you don’t provide any other pool.
pub fn standard_descriptor_pool(me: &Arc<Self>) -> Arc<StdDescriptorPool>
[src]
pub fn standard_descriptor_pool(me: &Arc<Self>) -> Arc<StdDescriptorPool>
[src]Returns the standard descriptor pool used by default if you don’t provide any other pool.
pub fn standard_command_pool(
me: &Arc<Self>,
queue: QueueFamily<'_>
) -> Arc<StandardCommandPool>
[src]
pub fn standard_command_pool(
me: &Arc<Self>,
queue: QueueFamily<'_>
) -> Arc<StandardCommandPool>
[src]Returns the standard command buffer pool used by default if you don’t provide any other pool.
Panic
- Panics if the device and the queue family don’t belong to the same physical device.
pub fn set_object_name<T: VulkanObject + DeviceOwned>(
&self,
object: &T,
name: &CStr
) -> Result<(), OomError>
[src]
pub fn set_object_name<T: VulkanObject + DeviceOwned>(
&self,
object: &T,
name: &CStr
) -> Result<(), OomError>
[src]Assigns a human-readable name to object
for debugging purposes.
Panics
- If
object
is not owned by this device.
pub unsafe fn set_object_name_raw(
&self,
ty: ObjectType,
object: u64,
name: &CStr
) -> Result<(), OomError>
[src]
pub unsafe fn set_object_name_raw(
&self,
ty: ObjectType,
object: u64,
name: &CStr
) -> Result<(), OomError>
[src]Assigns a human-readable name to object
for debugging purposes.
Safety
object
must be a Vulkan handle owned by this device, and its type must be accurately described by ty
.
pub fn image_format_properties(
&self,
format: Format,
ty: ImageType,
tiling: ImageTiling,
usage: ImageUsage,
create_flags: ImageCreateFlags
) -> Result<ImageFormatProperties, String>
[src]
pub fn image_format_properties(
&self,
format: Format,
ty: ImageType,
tiling: ImageTiling,
usage: ImageUsage,
create_flags: ImageCreateFlags
) -> Result<ImageFormatProperties, String>
[src]Checks the given combination of image attributes/configuration for compatibility with the physical device.
Returns a struct with additional capabilities available for this image configuration.
Trait Implementations
impl VulkanObject for Device
[src]
impl VulkanObject for Device
[src]const TYPE: ObjectType
[src]
const TYPE: ObjectType
[src]The ObjectType
of the internal Vulkan handle.
fn internal_object(&self) -> Device
[src]
fn internal_object(&self) -> Device
[src]Returns a reference to the object.
impl Eq for Device
[src]
impl Send for Device
[src]
impl Sync for Device
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]Builds a pointer to this type from a raw pointer.
pub fn is_size_suitable(usize) -> bool
[src]
pub fn is_size_suitable(usize) -> bool
[src]Returns true if the size is suitable to store a type like this.
pub fn indiv_size() -> usize
[src]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.