vulkan
Safe HaskellNone
LanguageHaskell2010

Vulkan.Core10.Buffer

Synopsis

Documentation

createBuffer Source #

Arguments

:: forall (a :: [Type]) 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
  • The device must have been created with at least 1 queue

Return Codes

Success
Failure

See Also

VK_VERSION_1_0, AllocationCallbacks, Buffer, BufferCreateInfo, Device

withBuffer :: forall (a :: [Type]) 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

:: 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

Description

usage defines the effective usage flags for the buffer. If the pNext chain includes a BufferUsageFlags2CreateInfo structure, BufferUsageFlags2CreateInfo::usage from that structure is used as the effective usage instead of usage from this structure.

Valid Usage

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]). 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_DEFINE_NON_DISPATCHABLE_HANDLE, VK_VERSION_1_0, AccelerationStructureCreateInfoKHR, BindBufferMemoryInfo, BufferCaptureDescriptorDataInfoEXT, BufferDeviceAddressInfo, BufferMemoryBarrier, BufferMemoryBarrier2, BufferMemoryRequirementsInfo2, BufferViewCreateInfo, ConditionalRenderingBeginInfoEXT, CopyBufferInfo2, CopyBufferToImageInfo2, CopyImageToBufferInfo2, DedicatedAllocationMemoryAllocateInfoNV, DescriptorBufferBindingPushDescriptorBufferHandleEXT, DescriptorBufferInfo, FrameBoundaryEXT, GeneratedCommandsInfoNV, GeometryAABBNV, GeometryTrianglesNV, IndirectCommandsStreamNV, MemoryDedicatedAllocateInfo, MicromapCreateInfoEXT, SparseBufferMemoryBindInfo, VkVideoDecodeInfoKHR, VkVideoEncodeInfoKHR, bindBufferMemory, cmdBeginTransformFeedbackEXT, cmdBindIndexBuffer, cmdBindIndexBuffer2, cmdBindIndexBuffer2, cmdBindTransformFeedbackBuffersEXT, cmdBindVertexBuffers, cmdBindVertexBuffers2, cmdBindVertexBuffers2, cmdBuildAccelerationStructureNV, cmdCopyBuffer, cmdCopyBufferToImage, cmdCopyImageToBuffer, cmdCopyQueryPoolResults, cmdDispatchIndirect, cmdDrawClusterIndirectHUAWEI, cmdDrawIndexedIndirect, cmdDrawIndexedIndirectCount, cmdDrawIndexedIndirectCount, cmdDrawIndexedIndirectCount, cmdDrawIndirect, cmdDrawIndirectByteCountEXT, cmdDrawIndirectCount, cmdDrawIndirectCount, cmdDrawIndirectCount, cmdDrawMeshTasksIndirectCountEXT, cmdDrawMeshTasksIndirectCountNV, cmdDrawMeshTasksIndirectEXT, cmdDrawMeshTasksIndirectNV, cmdEndTransformFeedbackEXT, cmdFillBuffer, cmdTraceRaysNV, cmdUpdateBuffer, cmdWriteBufferMarker2AMD, cmdWriteBufferMarkerAMD, createBuffer, destroyBuffer, getBufferMemoryRequirements

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

Storable Buffer Source # 
Instance details

Defined in Vulkan.Core10.Handles

Show 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

  • 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.
  • SHARING_MODE_CONCURRENT specifies that concurrent access to any range or image subresource of the object from multiple queue families is supported.

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, unless the maintenance9 feature is enabled, the application must perform a queue family ownership transfer if it wishes to make the memory contents of a range or image subresource accessible to a different queue family. SHARING_MODE_EXCLUSIVE resources that are already owned by a queue family may be acquired by a different queue family without a queue family ownership transfer, but unless the maintenance9 feature is enabled, their contents become undefined.

If the maintenance9 feature is enabled, the contents of buffer resources, and of linear image resources (i.e., those created with tiling set to IMAGE_TILING_LINEAR) are always preserved when they are implicitly acquired by a different queue family on the same logical device (i.e., neither queue family is QUEUE_FAMILY_FOREIGN_EXT or QUEUE_FAMILY_EXTERNAL). This means that whenever the maintenance9 feature is enabled, explicit queue family ownership transfers of buffer and linear image resources between different queue families on the same logical device are optional.

Additionally, if the maintenance9 feature is enabled, the contents of some optimal image resources (i.e., those created with IMAGE_TILING_OPTIMAL) are always preserved when they are implicitly acquired by a different queue family on the same logical device (i.e., neither queue family is QUEUE_FAMILY_FOREIGN_EXT or QUEUE_FAMILY_EXTERNAL). This applies only to optimal images that are being implicitly acquired by a queue family whose index bit is set in the current queue family’s QueueFamilyOwnershipTransferPropertiesKHR::optimalImageTransferToQueueFamilies, and that were created without any of the following bits set in usage:

This means that whenever the maintenance9 feature is enabled, explicit queue family ownership transfers of such image resources between such combinations of queue families are optional. For all other optimal images and/or combinations of queue families, the application must still perform an explicit queue family ownership transfer if it wishes to make the memory contents of an optimal image subresource already owned by a queue family accessible to a different queue family.

Applications are allowed to perform explicit queue family ownership transfers in circumstances where they are not required, but there is no functional nor performance advantage in doing so. Performing explicit transfers in such cases remains supported for backward compatibility and is not recommended for new applications.

Before being used on the first queue, images still require a layout transition from these layouts:

A queue family can take ownership of an image subresource, tensor 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, tensor subresources of tensor objects, 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, TensorCreateInfoARM

Constructors

SharingMode Int32 

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

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

Zero SharingMode Source # 
Instance details

Defined in Vulkan.Core10.Enums.SharingMode

newtype BufferUsageFlagBits Source #

VkBufferUsageFlagBits - Bitmask specifying allowed usage of a buffer

Description

See Also

VK_VERSION_1_0, BufferUsageFlags

Bundled Patterns

pattern BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR :: BufferUsageFlagBits 
pattern BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR :: BufferUsageFlagBits 
pattern BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_DESCRIPTOR_HEAP_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_EXECUTION_GRAPH_SCRATCH_BIT_AMDX :: BufferUsageFlagBits 
pattern BUFFER_USAGE_INDEX_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_INDIRECT_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR :: BufferUsageFlagBits 
pattern BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_STORAGE_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_TILE_MEMORY_BIT_QCOM :: BufferUsageFlagBits 
pattern BUFFER_USAGE_TRANSFER_DST_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_TRANSFER_SRC_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_UNIFORM_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT :: BufferUsageFlagBits 
pattern BUFFER_USAGE_VERTEX_BUFFER_BIT :: BufferUsageFlagBits 

Instances

Instances details
Bits BufferUsageFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferUsageFlagBits

FiniteBits 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

Storable 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

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

Instances

Instances details
Bits BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits

FiniteBits 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

Storable 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

Zero BufferCreateFlagBits Source # 
Instance details

Defined in Vulkan.Core10.Enums.BufferCreateFlagBits