pub struct BufferInfo {
pub alignment: DeviceSize,
pub dedicated: bool,
pub host_read: bool,
pub host_write: bool,
pub size: DeviceSize,
pub usage: BufferUsageFlags,
}Expand description
Information used to create a Buffer instance.
Fields§
§alignment: DeviceSizeByte alignment of the base device address of the buffer.
Must be a power of two.
dedicated: boolSpecifies a dedicated memory allocation managed by the Vulkan driver and not by the internal memory allocation pool transient resources share.
The driver may optimize access to dedicated buffers.
host_read: boolSpecifies a buffer whose memory is host visible and may be mapped.
Memory optimal for CPU readback of data may be used.
host_write: boolSpecifies a buffer whose memory is host visible and may be mapped.
Memory optimal for uploading data to the GPU and potentially for constant buffers may be used.
size: DeviceSizeSize in bytes of the buffer to be created.
usage: BufferUsageFlagsA bitmask of specifying allowed usages of the buffer.
Implementations§
Source§impl BufferInfo
impl BufferInfo
Sourcepub const fn device_mem(size: DeviceSize, usage: BufferUsageFlags) -> BufferInfo
pub const fn device_mem(size: DeviceSize, usage: BufferUsageFlags) -> BufferInfo
Specifies a non-mappable buffer with the given size and usage values.
Device-local memory (located on the GPU) is used.
Sourcepub const fn host_mem(size: DeviceSize, usage: BufferUsageFlags) -> BufferInfo
pub const fn host_mem(size: DeviceSize, usage: BufferUsageFlags) -> BufferInfo
Specifies a mappable buffer with the given size and usage values.
Host-local memory (located in CPU-accesible RAM) is used.
§Note
For convenience the given usage value will be bitwise OR’d with
TRANSFER_DST | TRANSFER_SRC.
Sourcepub fn builder() -> BufferInfoBuilder
pub fn builder() -> BufferInfoBuilder
Creates a default BufferInfoBuilder.
Sourcepub fn is_host_mem(&self) -> bool
pub fn is_host_mem(&self) -> bool
Returns true if this information specifies host-accessible memory.
Sourcepub fn into_builder(self) -> BufferInfoBuilder
pub fn into_builder(self) -> BufferInfoBuilder
Converts a BufferInfo into a BufferInfoBuilder.
Trait Implementations§
Source§impl Clone for BufferInfo
impl Clone for BufferInfo
Source§fn clone(&self) -> BufferInfo
fn clone(&self) -> BufferInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BufferInfo
impl Debug for BufferInfo
Source§impl From<BufferInfo> for BufferSubresourceRange
impl From<BufferInfo> for BufferSubresourceRange
Source§fn from(info: BufferInfo) -> Self
fn from(info: BufferInfo) -> Self
Source§impl From<BufferInfoBuilder> for BufferInfo
impl From<BufferInfoBuilder> for BufferInfo
Source§fn from(info: BufferInfoBuilder) -> Self
fn from(info: BufferInfoBuilder) -> Self
Source§impl Hash for BufferInfo
impl Hash for BufferInfo
Source§impl PartialEq for BufferInfo
impl PartialEq for BufferInfo
Source§fn eq(&self, other: &BufferInfo) -> bool
fn eq(&self, other: &BufferInfo) -> bool
self and other values to be equal, and is used by ==.