Struct draw2d::graphics::vulkan::device::Device[][src]

pub struct Device {
    pub physical_device: PhysicalDevice,
    pub logical_device: Device,
    pub graphics_queue: Queue,
    pub present_queue: Queue,
    // some fields omitted
}
Expand description

This struct holds all device-specific resources, the physical device and logical device for interacting with it, and the associated queues.

Fields

physical_device: PhysicalDevicelogical_device: Devicegraphics_queue: Queuepresent_queue: Queue

Implementations

Create a new device based on this application’s required features and properties.

Allocate a a chunk of memory for use in a buffer or texture.

unsafe because

  • the caller is responsible for eventually calling ‘free memory’ before the application quits

Free a memory allocation.

unsafe because

  • the caller is responsible for ensuring that the memory is no longer in use by the gpu.

Give a debug name for a vulkan object owned by this device.

Whatever name is provided here will show up in the debug logs if there are any issues detected by the validation layers.

Synchronously submit commands for execution on the graphics queue.

This method is internally synchronized and can be called on multiple threads without any additional synchronization.

This method forces the device to wait idle after submitting commands, as such it is very slow (don’t do it in a loop every frame!).

Unsafe Because

  • no internal synchronization is done, any resources used by graphcis commands must be synchronized by the caller
  • note: the device idles after the submission, so no resources refereced inside this method should be in-use after the call.

Submit a command buffer to the specified queue, then wait for it to idle.

Create a new swapchain loader which will be owned by the caller.

Trait Implementations

Destroy the logical device.

Device owns an Arc so it’s guaranteed that the instance will not be destroyed until the logical device has been dropped.

Create a new sampler. Read more

Destroy a sampler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.