pub struct BufferInfo {
pub alignment: DeviceSize,
pub alloc_dedicated: bool,
pub host_readable: bool,
pub host_writable: bool,
pub sharing_mode: SharingMode,
pub size: DeviceSize,
pub usage: BufferUsageFlags,
}Expand description
Information used to create a Buffer instance.
See VkBufferCreateInfo.
Fields§
§alignment: DeviceSizeByte alignment of the base device address of the buffer.
Must be a power of two.
alloc_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_readable: boolSpecifies a buffer whose memory is host-visible and may be mapped for reads.
Memory optimal for CPU readback of data may be used.
host_writable: boolSpecifies a buffer whose memory is host-visible and may be mapped for writes.
Memory optimal for uploading data to the GPU and potentially for constant buffers may be used.
sharing_mode: SharingModeControls whether the buffer is accessible from a single queue family (EXCLUSIVE) or
from all queues (CONCURRENT).
size: DeviceSizeSize in bytes of the buffer to be created.
usage: BufferUsageFlagsA bitmask specifying the allowed usages of the buffer.
Implementations§
Source§impl BufferInfo
impl BufferInfo
Sourcepub fn builder() -> BufferInfoBuilder
pub fn builder() -> BufferInfoBuilder
Creates a default BufferInfoBuilder.
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-accessible RAM) is used.
§Note
For convenience the given usage value will be bitwise OR’d with
TRANSFER_DST | TRANSFER_SRC.
Sourcepub fn into_builder(self) -> BufferInfoBuilder
pub fn into_builder(self) -> BufferInfoBuilder
Converts a BufferInfo into a BufferInfoBuilder.
Sourcepub fn is_host_visible(&self) -> bool
pub fn is_host_visible(&self) -> bool
Returns true if this information specifies host-visible memory.
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 moreimpl Copy for BufferInfo
Source§impl Debug for BufferInfo
impl Debug for BufferInfo
impl Eq 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 ==.