vulkan-3.6.9: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

Vulkan.Core10.Buffer

Synopsis

Documentation

createBuffer Source #

Arguments

:: forall a io. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) 
=> Device

device is the logical device that creates the buffer object.

-> BufferCreateInfo a

pCreateInfo is a pointer to a BufferCreateInfo structure containing parameters affecting creation of the buffer.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io Buffer 

vkCreateBuffer - Create a new buffer object

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle
  • pCreateInfo must be a valid pointer to a valid BufferCreateInfo structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • pBuffer must be a valid pointer to a Buffer handle

Return Codes

Success
Failure

See Also

AllocationCallbacks, Buffer, BufferCreateInfo, Device

withBuffer :: forall a io r. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> (io Buffer -> (Buffer -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createBuffer and destroyBuffer

To ensure that destroyBuffer is always called: pass bracket (or the allocate function from your favourite resource management library) as the first argument. To just extract the pair pass (,) as the first argument.

destroyBuffer Source #

Arguments

:: forall io. MonadIO io 
=> Device

device is the logical device that destroys the buffer.

-> Buffer

buffer is the buffer to destroy.

-> ("allocator" ::: Maybe AllocationCallbacks)

pAllocator controls host memory allocation as described in the Memory Allocation chapter.

-> io () 

vkDestroyBuffer - Destroy a buffer object

Valid Usage

  • All submitted commands that refer to buffer, either directly or via a BufferView, must have completed execution
  • If AllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here
  • If no AllocationCallbacks were provided when buffer was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle
  • If buffer is not NULL_HANDLE, buffer must be a valid Buffer handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • If buffer is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to buffer must be externally synchronized

See Also

AllocationCallbacks, Buffer, Device

data BufferCreateInfo (es :: [Type]) Source #

VkBufferCreateInfo - Structure specifying the parameters of a newly created buffer object

Valid Usage

  • size must be greater than 0

Valid Usage (Implicit)

See Also

BufferCreateFlags, BufferUsageFlags, DeviceSize, SharingMode, StructureType, createBuffer

Constructors

BufferCreateInfo 

Fields

Instances

Instances details
Extensible BufferCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Buffer

Methods

extensibleType :: StructureType Source #

getNext :: forall (es :: [Type]). BufferCreateInfo es -> Chain es Source #

setNext :: forall (ds :: [Type]) (es :: [Type]). BufferCreateInfo ds -> Chain es -> BufferCreateInfo es Source #

extends :: forall e b proxy. Typeable e => proxy e -> (Extends BufferCreateInfo e => b) -> Maybe b Source #

Show (Chain es) => Show (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

Generic (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

Associated Types

type Rep (BufferCreateInfo es) :: Type -> Type #

(Extendss BufferCreateInfo es, PeekChain es) => FromCStruct (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

(Extendss BufferCreateInfo es, PokeChain es) => ToCStruct (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

es ~ ('[] :: [Type]) => Zero (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

type Rep (BufferCreateInfo es) Source # 
Instance details

Defined in Vulkan.Core10.Buffer

newtype Buffer Source #

Constructors

Buffer Word64 

Instances

Instances details
Eq Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

(==) :: Buffer -> Buffer -> Bool #

(/=) :: Buffer -> Buffer -> Bool #

Ord Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Show Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Storable Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

zero :: Buffer Source #

HasObjectType Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

newtype SharingMode Source #

VkSharingMode - Buffer and image sharing modes

Description

Note

SHARING_MODE_CONCURRENT may result in lower performance access to the buffer or image than SHARING_MODE_EXCLUSIVE.

Ranges of buffers and image subresources of image objects created using SHARING_MODE_EXCLUSIVE must only be accessed by queues in the queue family that has ownership of the resource. Upon creation, such resources are not owned by any queue family; ownership is implicitly acquired upon first use within a queue. Once a resource using SHARING_MODE_EXCLUSIVE is owned by some queue family, the application must perform a queue family ownership transfer to make the memory contents of a range or image subresource accessible to a different queue family.

Note

Images still require a layout transition from IMAGE_LAYOUT_UNDEFINED or IMAGE_LAYOUT_PREINITIALIZED before being used on the first queue.

A queue family can take ownership of an image subresource or buffer range of a resource created with SHARING_MODE_EXCLUSIVE, without an ownership transfer, in the same way as for a resource that was just created; however, taking ownership in this way has the effect that the contents of the image subresource or buffer range are undefined.

Ranges of buffers and image subresources of image objects created using SHARING_MODE_CONCURRENT must only be accessed by queues from the queue families specified through the queueFamilyIndexCount and pQueueFamilyIndices members of the corresponding create info structures.

See Also

BufferCreateInfo, ImageCreateInfo, PhysicalDeviceImageDrmFormatModifierInfoEXT, SwapchainCreateInfoKHR

Constructors

SharingMode Int32 

Bundled Patterns

pattern SHARING_MODE_EXCLUSIVE :: SharingMode

SHARING_MODE_EXCLUSIVE specifies that access to any range or image subresource of the object will be exclusive to a single queue family at a time.

pattern SHARING_MODE_CONCURRENT :: SharingMode

SHARING_MODE_CONCURRENT specifies that concurrent access to any range or image subresource of the object from multiple queue families is supported.

Instances

Instances details
Eq SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Ord SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Read SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Show SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Storable SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Zero SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

newtype BufferUsageFlagBits Source #

VkBufferUsageFlagBits - Bitmask specifying allowed usage of a buffer

See Also

BufferUsageFlags

Bundled Patterns

pattern BUFFER_USAGE_TRANSFER_SRC_BIT :: BufferUsageFlagBits

BUFFER_USAGE_TRANSFER_SRC_BIT specifies that the buffer can be used as the source of a transfer command (see the definition of https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-transfer).

pattern BUFFER_USAGE_TRANSFER_DST_BIT :: BufferUsageFlagBits

BUFFER_USAGE_TRANSFER_DST_BIT specifies that the buffer can be used as the destination of a transfer command.

pattern BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT specifies that the buffer can be used to create a BufferView suitable for occupying a DescriptorSet slot of type DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER.

pattern BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT specifies that the buffer can be used to create a BufferView suitable for occupying a DescriptorSet slot of type DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER.

pattern BUFFER_USAGE_UNIFORM_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_UNIFORM_BUFFER_BIT specifies that the buffer can be used in a DescriptorBufferInfo suitable for occupying a DescriptorSet slot either of type DESCRIPTOR_TYPE_UNIFORM_BUFFER or DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC.

pattern BUFFER_USAGE_STORAGE_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_STORAGE_BUFFER_BIT specifies that the buffer can be used in a DescriptorBufferInfo suitable for occupying a DescriptorSet slot either of type DESCRIPTOR_TYPE_STORAGE_BUFFER or DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC.

pattern BUFFER_USAGE_INDEX_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_INDEX_BUFFER_BIT specifies that the buffer is suitable for passing as the buffer parameter to cmdBindIndexBuffer.

pattern BUFFER_USAGE_VERTEX_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_VERTEX_BUFFER_BIT specifies that the buffer is suitable for passing as an element of the pBuffers array to cmdBindVertexBuffers.

pattern BUFFER_USAGE_INDIRECT_BUFFER_BIT :: BufferUsageFlagBits

BUFFER_USAGE_INDIRECT_BUFFER_BIT specifies that the buffer is suitable for passing as the buffer parameter to cmdDrawIndirect, cmdDrawIndexedIndirect, cmdDrawMeshTasksIndirectNV, cmdDrawMeshTasksIndirectCountNV, or cmdDispatchIndirect. It is also suitable for passing as the buffer member of IndirectCommandsStreamNV, or sequencesCountBuffer or sequencesIndexBuffer or preprocessedBuffer member of GeneratedCommandsInfoNV

pattern BUFFER_USAGE_RAY_TRACING_BIT_KHR :: BufferUsageFlagBits

BUFFER_USAGE_RAY_TRACING_BIT_KHR specifies that the buffer is suitable for use in cmdTraceRaysKHR and cmdBuildAccelerationStructureKHR.

pattern BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT specifies that the buffer is suitable for passing as the buffer parameter to cmdBeginConditionalRenderingEXT.

pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT specifies that the buffer is suitable for using as a counter buffer with cmdBeginTransformFeedbackEXT and cmdEndTransformFeedbackEXT.

pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT specifies that the buffer is suitable for using for binding as a transform feedback buffer with cmdBindTransformFeedbackBuffersEXT.

pattern BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT :: BufferUsageFlagBits

BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT specifies that the buffer can be used to retrieve a buffer device address via getBufferDeviceAddress and use that address to access the buffer’s memory from a shader.

Instances

Instances details
Eq BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Ord BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Read BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Show BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Storable BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Bits BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Zero BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

newtype BufferCreateFlagBits Source #

VkBufferCreateFlagBits - Bitmask specifying additional parameters of a buffer

Description

See Sparse Resource Features and Physical Device Features for details of the sparse memory features supported on a device.

See Also

BufferCreateFlags

Bundled Patterns

pattern BUFFER_CREATE_SPARSE_BINDING_BIT :: BufferCreateFlagBits

BUFFER_CREATE_SPARSE_BINDING_BIT specifies that the buffer will be backed using sparse memory binding.

pattern BUFFER_CREATE_SPARSE_RESIDENCY_BIT :: BufferCreateFlagBits

BUFFER_CREATE_SPARSE_RESIDENCY_BIT specifies that the buffer can be partially backed using sparse memory binding. Buffers created with this flag must also be created with the BUFFER_CREATE_SPARSE_BINDING_BIT flag.

pattern BUFFER_CREATE_SPARSE_ALIASED_BIT :: BufferCreateFlagBits

BUFFER_CREATE_SPARSE_ALIASED_BIT specifies that the buffer will be backed using sparse memory binding with memory ranges that might also simultaneously be backing another buffer (or another portion of the same buffer). Buffers created with this flag must also be created with the BUFFER_CREATE_SPARSE_BINDING_BIT flag.

pattern BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits

BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT specifies that the buffer’s address can be saved and reused on a subsequent run (e.g. for trace capture and replay), see BufferOpaqueCaptureAddressCreateInfo for more detail.

pattern BUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits

BUFFER_CREATE_PROTECTED_BIT specifies that the buffer is a protected buffer.

Instances

Instances details
Eq BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Ord BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Read BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Show BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Storable BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Bits BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Zero BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits