| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.Buffer
Synopsis
- createBuffer :: forall a io. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Buffer
- withBuffer :: forall a io r. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> (io Buffer -> (Buffer -> io ()) -> r) -> r
- destroyBuffer :: forall io. MonadIO io => Device -> Buffer -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data BufferCreateInfo (es :: [Type]) = BufferCreateInfo {}
- newtype Buffer = Buffer Word64
- newtype SharingMode where
- SharingMode Int32
- pattern SHARING_MODE_EXCLUSIVE :: SharingMode
- pattern SHARING_MODE_CONCURRENT :: SharingMode
- newtype BufferUsageFlagBits where
- BufferUsageFlagBits Flags
- pattern BUFFER_USAGE_TRANSFER_SRC_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_TRANSFER_DST_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_UNIFORM_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_STORAGE_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_INDEX_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_VERTEX_BUFFER_BIT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_INDIRECT_BUFFER_BIT :: BufferUsageFlagBits
- 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
- 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_ACCELERATION_STRUCTURE_STORAGE_BIT_KHR :: BufferUsageFlagBits
- pattern BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHR :: BufferUsageFlagBits
- pattern BUFFER_USAGE_EXECUTION_GRAPH_SCRATCH_BIT_AMDX :: BufferUsageFlagBits
- pattern BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT :: BufferUsageFlagBits
- pattern BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT :: BufferUsageFlagBits
- type BufferUsageFlags = BufferUsageFlagBits
- newtype BufferCreateFlagBits where
- BufferCreateFlagBits Flags
- pattern BUFFER_CREATE_SPARSE_BINDING_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_SPARSE_RESIDENCY_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_SPARSE_ALIASED_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits
- type BufferCreateFlags = BufferCreateFlagBits
Documentation
Arguments
| :: forall a io. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> BufferCreateInfo a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io Buffer |
vkCreateBuffer - Create a new buffer object
Valid Usage
- If the
flagsmember ofpCreateInfoincludesBUFFER_CREATE_SPARSE_BINDING_BIT, and the extendedSparseAddressSpace feature is not enabled, creating thisBuffermust not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceLimits::sparseAddressSpaceSize
- If the
flagsmember ofpCreateInfoincludesBUFFER_CREATE_SPARSE_BINDING_BIT, the extendedSparseAddressSpace feature is enabled, and theusagemember ofpCreateInfocontains bits not inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlags, creating thisBuffermust not cause the total required sparse memory for all currently valid sparse resources on the device, excludingBuffercreated withusagemember ofpCreateInfocontaining bits inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlagsandImagecreated withusagemember ofpCreateInfocontaining bits inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseImageUsageFlags, to exceedPhysicalDeviceLimits::sparseAddressSpaceSize - If the
flagsmember ofpCreateInfoincludesBUFFER_CREATE_SPARSE_BINDING_BITand the extendedSparseAddressSpace feature is enabled, creating thisBuffermust not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseAddressSpaceSize - If using the
Bufferfor an import operation from aBufferCollectionFUCHSIAwhere aBufferCollectionBufferCreateInfoFUCHSIAhas been chained topNext,pCreateInfomust match theBufferConstraintsInfoFUCHSIA::createInfoused when setting the constraints on the buffer collection withsetBufferCollectionBufferConstraintsFUCHSIA
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
pCreateInfomust be a valid pointer to a validBufferCreateInfostructure - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure -
pBuffermust be a valid pointer to aBufferhandle
Return Codes
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.
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Buffer |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io () |
vkDestroyBuffer - Destroy a buffer object
Valid Usage
- All submitted commands that
refer to
buffer, either directly or via aBufferView, must have completed execution
- If
AllocationCallbackswere provided whenbufferwas created, a compatible set of callbacks must be provided here - If no
AllocationCallbackswere provided whenbufferwas created,pAllocatormust beNULL
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
- If
bufferis notNULL_HANDLE,buffermust be a validBufferhandle - If
pAllocatoris notNULL,pAllocatormust be a valid pointer to a validAllocationCallbacksstructure - If
bufferis a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
buffermust be externally synchronized
See Also
data BufferCreateInfo (es :: [Type]) Source #
VkBufferCreateInfo - Structure specifying the parameters of a newly created buffer object
Description
If a
BufferUsageFlags2CreateInfoKHR
structure is present in the pNext chain,
BufferUsageFlags2CreateInfoKHR::usage
from that structure is used instead of usage from this structure.
Valid Usage
- If
sharingModeisSHARING_MODE_CONCURRENT,pQueueFamilyIndicesmust be a valid pointer to an array ofqueueFamilyIndexCountuint32_tvalues - If
sharingModeisSHARING_MODE_CONCURRENT,queueFamilyIndexCountmust be greater than1 - If
sharingModeisSHARING_MODE_CONCURRENT, each element ofpQueueFamilyIndicesmust be unique and must be less thanpQueueFamilyPropertyCountreturned by eithergetPhysicalDeviceQueueFamilyPropertiesorgetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice - If the
sparseBinding
feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_BINDING_BIT - If the
sparseResidencyBuffer
feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT - If the
sparseResidencyAliased
feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_ALIASED_BIT - If
flagscontainsBUFFER_CREATE_SPARSE_RESIDENCY_BITorBUFFER_CREATE_SPARSE_ALIASED_BIT, it must also containBUFFER_CREATE_SPARSE_BINDING_BIT - If the
pNextchain includes aExternalMemoryBufferCreateInfostructure, itshandleTypesmember must only contain bits that are also inExternalBufferProperties::externalMemoryProperties.compatibleHandleTypes, as returned bygetPhysicalDeviceExternalBufferPropertieswithpExternalBufferInfo->handleTypeequal to any one of the handle types specified inExternalMemoryBufferCreateInfo::handleTypes - If the
protectedMemory
feature is not enabled,
flagsmust not containBUFFER_CREATE_PROTECTED_BIT - If any of the bits
BUFFER_CREATE_SPARSE_BINDING_BIT,BUFFER_CREATE_SPARSE_RESIDENCY_BIT, orBUFFER_CREATE_SPARSE_ALIASED_BITare set,BUFFER_CREATE_PROTECTED_BITmust not also be set - If the
pNextchain includes aDedicatedAllocationBufferCreateInfoNVstructure, and thededicatedAllocationmember of the chained structure isTRUE, thenflagsmust not includeBUFFER_CREATE_SPARSE_BINDING_BIT,BUFFER_CREATE_SPARSE_RESIDENCY_BIT, orBUFFER_CREATE_SPARSE_ALIASED_BIT - If
BufferDeviceAddressCreateInfoEXT::deviceAddressis not zero,flagsmust includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT - If
BufferOpaqueCaptureAddressCreateInfo::opaqueCaptureAddressis not zero,flagsmust includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT - If
flagsincludesBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT, the bufferDeviceAddressCaptureReplay or bufferDeviceAddressCaptureReplayEXT feature must be enabled - If
usageincludesVK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHRorVK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR, then thepNextchain must include a VkVideoProfileListInfoKHR structure withprofileCountgreater than0andpProfilesincluding at least one VkVideoProfileInfoKHR structure with avideoCodecOperationmember specifying a decode operation - If
usageincludesVK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHRorVK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR, then thepNextchain must include a VkVideoProfileListInfoKHR structure withprofileCountgreater than0andpProfilesincluding at least one VkVideoProfileInfoKHR structure with avideoCodecOperationmember specifying an encode operation -
sizemust be less than or equal toPhysicalDeviceMaintenance4Properties::maxBufferSize - If
usageincludesBUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT, creating thisBuffermust not cause the total required space for all currently valid buffers using this flag on the device to exceedPhysicalDeviceDescriptorBufferPropertiesEXT::samplerDescriptorBufferAddressSpaceSizeorPhysicalDeviceDescriptorBufferPropertiesEXT::descriptorBufferAddressSpaceSize - If
usageincludesBUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT, creating thisBuffermust not cause the total required space for all currently valid buffers using this flag on the device to exceedPhysicalDeviceDescriptorBufferPropertiesEXT::resourceDescriptorBufferAddressSpaceSizeorPhysicalDeviceDescriptorBufferPropertiesEXT::descriptorBufferAddressSpaceSize - If
flagsincludesBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT, the descriptorBufferCaptureReplay feature must be enabled - If the
pNextchain includes aOpaqueCaptureDescriptorDataCreateInfoEXTstructure,flagsmust containBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT - If
usageincludesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT, the descriptorBufferPushDescriptors feature must be enabled - If
usageincludesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT::bufferlessPushDescriptors must beFALSE - If
usageincludesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT,usagemust contain at least one ofBUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXTorBUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT - If the
pNextchain does not include aBufferUsageFlags2CreateInfoKHRstructure,usagemust be a valid combination ofBufferUsageFlagBitsvalues - If the
pNextchain does not include aBufferUsageFlags2CreateInfoKHRstructure,usagemust not be0
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_BUFFER_CREATE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofBufferCollectionBufferCreateInfoFUCHSIA,BufferDeviceAddressCreateInfoEXT,BufferOpaqueCaptureAddressCreateInfo,BufferUsageFlags2CreateInfoKHR,DedicatedAllocationBufferCreateInfoNV,ExternalMemoryBufferCreateInfo,OpaqueCaptureDescriptorDataCreateInfoEXT, or VkVideoProfileListInfoKHR - The
sTypevalue of each struct in thepNextchain must be unique -
flagsmust be a valid combination ofBufferCreateFlagBitsvalues -
sharingModemust be a validSharingModevalue
See Also
VK_VERSION_1_0,
BufferConstraintsInfoFUCHSIA,
BufferCreateFlags,
BufferUsageFlags,
DeviceBufferMemoryRequirements,
DeviceSize,
SharingMode,
StructureType, createBuffer
Constructors
| BufferCreateInfo | |
Fields
| |
Instances
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,
FrameBoundaryEXT,
GeneratedCommandsInfoNV,
GeometryAABBNV,
GeometryTrianglesNV,
IndirectCommandsStreamNV,
MemoryDedicatedAllocateInfo,
MicromapCreateInfoEXT,
SparseBufferMemoryBindInfo,
VkVideoDecodeInfoKHR,
VkVideoEncodeInfoKHR,
bindBufferMemory,
cmdBeginTransformFeedbackEXT,
cmdBindIndexBuffer,
cmdBindIndexBuffer2KHR,
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
Instances
| Storable Buffer Source # | |
| Show Buffer Source # | |
| Eq Buffer Source # | |
| Ord Buffer Source # | |
| HasObjectType Buffer Source # | |
Defined in Vulkan.Core10.Handles Methods objectTypeAndHandle :: Buffer -> (ObjectType, Word64) Source # | |
| IsHandle Buffer Source # | |
Defined in Vulkan.Core10.Handles | |
| Zero Buffer Source # | |
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
VK_VERSION_1_0,
BufferCreateInfo,
ImageCreateInfo,
PhysicalDeviceImageDrmFormatModifierInfoEXT,
SwapchainCreateInfoKHR
Constructors
| SharingMode Int32 |
Bundled Patterns
| pattern SHARING_MODE_EXCLUSIVE :: SharingMode |
|
| pattern SHARING_MODE_CONCURRENT :: SharingMode |
|
Instances
newtype BufferUsageFlagBits Source #
VkBufferUsageFlagBits - Bitmask specifying allowed usage of a buffer
See Also
Constructors
| BufferUsageFlagBits Flags |
Bundled Patterns
Instances
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
Constructors
| BufferCreateFlagBits Flags |
Bundled Patterns
| pattern BUFFER_CREATE_SPARSE_BINDING_BIT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_SPARSE_RESIDENCY_BIT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_SPARSE_ALIASED_BIT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits |
|