vulkan-3.24.5: Bindings to the Vulkan graphics API.
Safe HaskellSafe-Inferred
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

VK_VERSION_1_0, 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 last argument. To just extract the pair pass (,) as the last 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

VK_VERSION_1_0, 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

VK_VERSION_1_0, BufferConstraintsInfoFUCHSIA, BufferCreateFlags, BufferUsageFlags, DeviceBufferMemoryRequirements, DeviceSize, SharingMode, StructureType, createBuffer

Constructors

BufferCreateInfo 

Fields

Instances

Instances details
Extensible BufferCreateInfo Source # 
Instance details

Defined in Vulkan.Core10.Buffer

Methods

extensibleTypeName :: String Source #

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

setNext :: forall (ds :: [Type]) (es :: [TYPE LiftedRep]). 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

(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

newtype Buffer Source #

VkBuffer - Opaque handle to a buffer object

See Also

VK_VERSION_1_0, AccelerationStructureCreateInfoKHR, BindBufferMemoryInfo, BufferCaptureDescriptorDataInfoEXT, BufferDeviceAddressInfo, BufferMemoryBarrier, BufferMemoryBarrier2, BufferMemoryRequirementsInfo2, BufferViewCreateInfo, ConditionalRenderingBeginInfoEXT, CopyBufferInfo2, CopyBufferToImageInfo2, CopyImageToBufferInfo2, DedicatedAllocationMemoryAllocateInfoNV, DescriptorBufferBindingPushDescriptorBufferHandleEXT, DescriptorBufferInfo, GeneratedCommandsInfoNV, GeometryAABBNV, GeometryTrianglesNV, IndirectCommandsStreamNV, MemoryDedicatedAllocateInfo, MicromapCreateInfoEXT, SparseBufferMemoryBindInfo, VkVideoDecodeInfoKHR, VkVideoEncodeInfoKHR, bindBufferMemory, cmdBeginTransformFeedbackEXT, cmdBindIndexBuffer, cmdBindTransformFeedbackBuffersEXT, cmdBindVertexBuffers, cmdBindVertexBuffers2, cmdBindVertexBuffers2EXT, cmdBuildAccelerationStructureNV, cmdCopyBuffer, cmdCopyBufferToImage, cmdCopyImageToBuffer, cmdCopyQueryPoolResults, cmdDispatchIndirect, cmdDrawClusterIndirectHUAWEI, cmdDrawIndexedIndirect, cmdDrawIndexedIndirectCount, cmdDrawIndexedIndirectCountAMD, cmdDrawIndexedIndirectCountKHR, cmdDrawIndirect, cmdDrawIndirectByteCountEXT, cmdDrawIndirectCount, cmdDrawIndirectCountAMD, cmdDrawIndirectCountKHR, cmdDrawMeshTasksIndirectCountEXT, cmdDrawMeshTasksIndirectCountNV, cmdDrawMeshTasksIndirectEXT, cmdDrawMeshTasksIndirectNV, cmdEndTransformFeedbackEXT, cmdFillBuffer, cmdTraceRaysNV, cmdUpdateBuffer, cmdWriteBufferMarker2AMD, cmdWriteBufferMarkerAMD, createBuffer, destroyBuffer, getBufferMemoryRequirements

Constructors

Buffer Word64 

Instances

Instances details
Storable Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Show Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

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

HasObjectType Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

IsHandle Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Zero Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Methods

zero :: Buffer Source #

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

VK_VERSION_1_0, 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
Storable 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

Eq SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

Ord 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

VK_VERSION_1_0, 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://registry.khronos.org/vulkan/specs/1.3-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, cmdDrawMeshTasksIndirectEXT, cmdDrawMeshTasksIndirectCountEXT, cmdDrawClusterIndirectHUAWEI, 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_MICROMAP_STORAGE_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT specifies that the buffer, when bound, can be used by the implementation to support push descriptors when using descriptor buffers.

pattern BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT specifies that the buffer is suitable to contain resource descriptors when bound as a descriptor buffer.

pattern BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits

BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT specifies that the buffer is suitable to contain sampler and combined image sampler descriptors when bound as a descriptor buffer. Buffers containing combined image sampler descriptors must also specify BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT.

pattern BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR :: BufferUsageFlagBits

BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR specifies that the buffer is suitable for use as a Shader Binding Table.

pattern BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR :: BufferUsageFlagBits

BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR specifies that the buffer is suitable for storage space for a AccelerationStructureKHR.

pattern BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR :: BufferUsageFlagBits

BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR specifies that the buffer is suitable for use as a read-only input to an acceleration structure build.

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
Storable BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Bits BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

FiniteBits 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

Eq BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

Ord 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

VK_VERSION_1_0, 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_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: BufferCreateFlagBits

BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT specifies that the buffer can be used with descriptor buffers when capturing and replaying (e.g. for trace capture and replay), see OpaqueCaptureDescriptorDataCreateInfoEXT for more detail.

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
Storable BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Bits BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

FiniteBits 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

Eq BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Ord BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

Zero BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits