| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.Buffer
Synopsis
- createBuffer :: forall (a :: [Type]) io. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Buffer
- withBuffer :: forall (a :: [Type]) io r. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> (io Buffer -> (Buffer -> io ()) -> r) -> r
- destroyBuffer :: 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_CONCURRENT :: SharingMode
- pattern SHARING_MODE_EXCLUSIVE :: SharingMode
- newtype BufferUsageFlagBits where
- BufferUsageFlagBits Flags
- 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
- type BufferUsageFlags = BufferUsageFlagBits
- newtype BufferCreateFlagBits where
- BufferCreateFlagBits Flags
- 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
- pattern BUFFER_CREATE_SPARSE_ALIASED_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_SPARSE_BINDING_BIT :: BufferCreateFlagBits
- pattern BUFFER_CREATE_SPARSE_RESIDENCY_BIT :: BufferCreateFlagBits
- type BufferCreateFlags = BufferCreateFlagBits
Documentation
Arguments
| :: forall (a :: [Type]) io. (Extendss BufferCreateInfo a, PokeChain a, MonadIO io) | |
| => Device |
|
| -> BufferCreateInfo a |
|
| -> ("allocator" ::: Maybe AllocationCallbacks) |
|
| -> io Buffer |
vkCreateBuffer - Create a new buffer object
Valid Usage
-
devicemust support at least one queue family with one of the VK_QUEUE_VIDEO_ENCODE_BIT_KHR, VK_QUEUE_VIDEO_DECODE_BIT_KHR,QUEUE_SPARSE_BINDING_BIT,QUEUE_TRANSFER_BIT,QUEUE_COMPUTE_BIT, orQUEUE_GRAPHICS_BITcapabilities
- 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 - The device must have been
created with at least
1queue
Return Codes
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.
Arguments
| :: 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
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
- If the
pNextchain does not include aBufferUsageFlags2CreateInfostructure,usagemust be a valid combination ofBufferUsageFlagBitsvalues
- If the
pNextchain does not include aBufferUsageFlags2CreateInfostructure,usagemust not be 0 -
sizemust be greater than0 - 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 eithergetPhysicalDeviceQueueFamilyProperties2orgetPhysicalDeviceQueueFamilyPropertiesfor 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 feature or the bufferDeviceAddressCaptureReplay feature must be enabled - If
usageincludes VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR or VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR, andflagsdoes not include VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR, then thepNextchain must include a VkVideoProfileListInfoKHR structure withprofileCountgreater than0andpProfilesincluding at least one VkVideoProfileInfoKHR structure with avideoCodecOperationmember specifying a decode operation - If
usageincludes VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR or VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR, andflagsdoes not include VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR, then thepNextchain must include a VkVideoProfileListInfoKHR structure withprofileCountgreater than0andpProfilesincluding at least one VkVideoProfileInfoKHR structure with avideoCodecOperationmember specifying an encode operation - If
flagsincludes VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR, then videoMaintenance1 must be enabled - If the
pNextchain includes a VkVideoProfileListInfoKHR structure and for any element of itspProfilesmembervideoCodecOperationis VK_VIDEO_CODEC_OPERATION_DECODE_VP9_BIT_KHR, then the videoDecodeVP9 feature must be enabled - If the
pNextchain includes a VkVideoProfileListInfoKHR structure and for any element of itspProfilesmembervideoCodecOperationis VK_VIDEO_CODEC_OPERATION_ENCODE_AV1_BIT_KHR, then the videoEncodeAV1 feature must be enabled - If the
pNextchain includes a VkVideoEncodeProfileRgbConversionInfoVALVE structure, then the videoEncodeRgbConversion feature must be enabled -
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
tileMemoryHeap
feature is not enabled,
usagemust not includeBUFFER_USAGE_TILE_MEMORY_BIT_QCOM If
usageincludesBUFFER_USAGE_TILE_MEMORY_BIT_QCOM, thenflagsmust not contain any of the following bitsIf
usageincludesBUFFER_USAGE_TILE_MEMORY_BIT_QCOM, then only the followingusagesmay be set:BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BITBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BITBUFFER_USAGE_UNIFORM_BUFFER_BITBUFFER_USAGE_STORAGE_BUFFER_BITBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT- and if
PhysicalDeviceTileMemoryHeapPropertiesQCOM::tileBufferTransfersisTRUEthen additionallyBUFFER_USAGE_TRANSFER_SRC_BITorBUFFER_USAGE_TRANSFER_DST_BIT
If
flagsincludesBUFFER_CREATE_PROTECTED_BIT, then the effective usage must not contain bits other thanBUFFER_USAGE_TRANSFER_SRC_BITBUFFER_USAGE_TRANSFER_DST_BITBUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BITBUFFER_USAGE_STORAGE_TEXEL_BUFFER_BITBUFFER_USAGE_UNIFORM_BUFFER_BITBUFFER_USAGE_STORAGE_BUFFER_BITBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BITBUFFER_USAGE_2_VIDEO_DECODE_SRC_BIT_KHRBUFFER_USAGE_2_VIDEO_ENCODE_DST_BIT_KHRBUFFER_USAGE_2_DESCRIPTOR_HEAP_BIT_EXT
- If the
protectedDescriptorHeaps
property is not supported and the
effective usage
includes the
BUFFER_USAGE_2_DESCRIPTOR_HEAP_BIT_EXTflag,flagsmust not include theBUFFER_CREATE_PROTECTED_BITflag - If the
sparseDescriptorHeaps
property is not supported and the
effective usage
includes the
BUFFER_USAGE_2_DESCRIPTOR_HEAP_BIT_EXTflag,flagsmust not include any of theBUFFER_CREATE_SPARSE_BINDING_BIT,BUFFER_CREATE_SPARSE_RESIDENCY_BIT, orBUFFER_CREATE_SPARSE_ALIASED_BITflags
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,BufferUsageFlags2CreateInfo,DedicatedAllocationBufferCreateInfoNV,ExternalMemoryBufferCreateInfo,OpaqueCaptureDescriptorDataCreateInfoEXT, or VkVideoProfileListInfoKHR - The
sTypevalue of each structure 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_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
Instances
| Eq Buffer Source # | |
| Ord Buffer Source # | |
| Storable Buffer Source # | |
| Show 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
SHARING_MODE_EXCLUSIVEspecifies that access to any range or image subresource of the object will be exclusive to a single queue family at a time.
SHARING_MODE_CONCURRENTspecifies 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:
IMAGE_USAGE_COLOR_ATTACHMENT_BITIMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITIMAGE_USAGE_TRANSIENT_ATTACHMENT_BITIMAGE_USAGE_INPUT_ATTACHMENT_BITIMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXTIMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
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 |
Bundled Patterns
| pattern SHARING_MODE_CONCURRENT :: SharingMode | |
| pattern SHARING_MODE_EXCLUSIVE :: SharingMode |
Instances
newtype BufferUsageFlagBits Source #
VkBufferUsageFlagBits - Bitmask specifying allowed usage of a buffer
Description
BUFFER_USAGE_TRANSFER_SRC_BITspecifies that the buffer can be used as the source of a transfer command (see the definition of https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-transfer).
BUFFER_USAGE_TRANSFER_DST_BITspecifies that the buffer can be used as the destination of a transfer command.BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BITspecifies that the buffer can be used to create aBufferViewsuitable for occupying aDescriptorSetslot of typeDESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER.BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BITspecifies that the buffer can be used to create aBufferViewsuitable for occupying aDescriptorSetslot of typeDESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER.BUFFER_USAGE_UNIFORM_BUFFER_BITspecifies that the buffer can be used in aDescriptorBufferInfosuitable for occupying aDescriptorSetslot either of typeDESCRIPTOR_TYPE_UNIFORM_BUFFERorDESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC.BUFFER_USAGE_STORAGE_BUFFER_BITspecifies that the buffer can be used in aDescriptorBufferInfosuitable for occupying aDescriptorSetslot either of typeDESCRIPTOR_TYPE_STORAGE_BUFFERorDESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC.BUFFER_USAGE_INDEX_BUFFER_BITspecifies that the buffer is suitable for passing as thebufferparameter tocmdBindIndexBuffer2andcmdBindIndexBuffer.BUFFER_USAGE_VERTEX_BUFFER_BITspecifies that the buffer is suitable for passing as an element of thepBuffersarray tocmdBindVertexBuffers.BUFFER_USAGE_INDIRECT_BUFFER_BITspecifies that the buffer is suitable for passing as thebufferparameter tocmdDrawIndirect,cmdDrawIndexedIndirect,cmdDrawMeshTasksIndirectNV,cmdDrawMeshTasksIndirectCountNV,cmdDrawMeshTasksIndirectEXT,cmdDrawMeshTasksIndirectCountEXT,cmdDrawClusterIndirectHUAWEI, orcmdDispatchIndirect. It is also suitable for passing as thebuffermember ofIndirectCommandsStreamNV, orsequencesCountBufferorsequencesIndexBufferorpreprocessedBuffermember ofGeneratedCommandsInfoNV. It is also suitable for passing as the underlying buffer of either thepreprocessAddressorsequenceCountAddressmembers ofGeneratedCommandsInfoEXT.BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXTspecifies that the buffer is suitable for passing as thebufferparameter tocmdBeginConditionalRenderingEXT.BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXTspecifies that the buffer is suitable for using for binding as a transform feedback buffer withcmdBindTransformFeedbackBuffersEXT.BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXTspecifies that the buffer is suitable for using as a counter buffer withcmdBeginTransformFeedbackEXTandcmdEndTransformFeedbackEXT.BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXTspecifies 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 specifyBUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT.BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXTspecifies that the buffer is suitable to contain resource descriptors when bound as a descriptor buffer.BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXTspecifies that the buffer, when bound, can be used by the implementation to support push descriptors when using descriptor buffers.BUFFER_USAGE_TILE_MEMORY_BIT_QCOMspecifies that the buffer can be bound toDeviceMemoryallocated from aMemoryHeapwith theMEMORY_HEAP_TILE_MEMORY_BIT_QCOMproperty.BUFFER_USAGE_RAY_TRACING_BIT_NVspecifies that the buffer is suitable for use incmdTraceRaysNV.BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHRspecifies that the buffer is suitable for use as a Shader Binding Table.BUFFER_USAGE_ACCELERATION_STRUCTURE_BUILD_INPUT_READ_ONLY_BIT_KHRspecifies that the buffer is suitable for use as a read-only input to an acceleration structure build.BUFFER_USAGE_ACCELERATION_STRUCTURE_STORAGE_BIT_KHRspecifies that the buffer is suitable for storage space for aAccelerationStructureKHR.BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BITspecifies that the buffer can be used to retrieve a buffer device address viagetBufferDeviceAddressand use that address to access the buffer’s memory from a shader.- VK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR specifies that the buffer can be used as the source video bitstream buffer in a video decode operation.
- VK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR is reserved for future use.
- VK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR specifies that the buffer can be used as the destination video bitstream buffer in a video encode operation.
- VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR is reserved for future use.
BUFFER_USAGE_EXECUTION_GRAPH_SCRATCH_BIT_AMDXspecifies that the buffer can be used for as scratch memory for execution graph dispatch.BUFFER_USAGE_DESCRIPTOR_HEAP_BIT_EXTspecifies that the buffer can be used as a descriptor heap.
See Also
Constructors
| BufferUsageFlagBits Flags |
Bundled Patterns
Instances
newtype BufferCreateFlagBits Source #
VkBufferCreateFlagBits - Bitmask specifying additional parameters of a buffer
Description
BUFFER_CREATE_SPARSE_BINDING_BITspecifies that the buffer will be backed using sparse memory binding.
BUFFER_CREATE_SPARSE_RESIDENCY_BITspecifies that the buffer can be partially backed using sparse memory binding. Buffers created with this flag must also be created with theBUFFER_CREATE_SPARSE_BINDING_BITflag.BUFFER_CREATE_SPARSE_ALIASED_BITspecifies 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 theBUFFER_CREATE_SPARSE_BINDING_BITflag.BUFFER_CREATE_PROTECTED_BITspecifies that the buffer is a protected buffer.BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BITspecifies that the buffer’s address can be saved and reused on a subsequent run (e.g. for trace capture and replay), seeBufferOpaqueCaptureAddressCreateInfofor more detail.BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXTspecifies that the buffer can be used with descriptor buffers when capturing and replaying (e.g. for trace capture and replay), seeOpaqueCaptureDescriptorDataCreateInfoEXTfor more detail.- VK_BUFFER_CREATE_VIDEO_PROFILE_INDEPENDENT_BIT_KHR specifies that the buffer can be used in video coding operations without having to specify at buffer creation time the set of video profiles the buffer will be used with.
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