Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
:: 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
flags
member ofpCreateInfo
includesBUFFER_CREATE_SPARSE_BINDING_BIT
, and the extendedSparseAddressSpace feature is not enabled, creating thisBuffer
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceLimits
::sparseAddressSpaceSize
- If the
flags
member ofpCreateInfo
includesBUFFER_CREATE_SPARSE_BINDING_BIT
, the extendedSparseAddressSpace feature is enabled, and theusage
member ofpCreateInfo
contains bits not inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV
::extendedSparseBufferUsageFlags
, creating thisBuffer
must not cause the total required sparse memory for all currently valid sparse resources on the device, excludingBuffer
created withusage
member ofpCreateInfo
containing bits inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV
::extendedSparseBufferUsageFlags
andImage
created withusage
member ofpCreateInfo
containing bits inPhysicalDeviceExtendedSparseAddressSpacePropertiesNV
::extendedSparseImageUsageFlags
, to exceedPhysicalDeviceLimits
::sparseAddressSpaceSize
- If the
flags
member ofpCreateInfo
includesBUFFER_CREATE_SPARSE_BINDING_BIT
and the extendedSparseAddressSpace feature is enabled, creating thisBuffer
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceExtendedSparseAddressSpacePropertiesNV
::extendedSparseAddressSpaceSize
- If using the
Buffer
for an import operation from aBufferCollectionFUCHSIA
where aBufferCollectionBufferCreateInfoFUCHSIA
has been chained topNext
,pCreateInfo
must match theBufferConstraintsInfoFUCHSIA
::createInfo
used when setting the constraints on the buffer collection withsetBufferCollectionBufferConstraintsFUCHSIA
Valid Usage (Implicit)
-
device
must be a validDevice
handle
-
pCreateInfo
must be a valid pointer to a validBufferCreateInfo
structure - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure -
pBuffer
must be a valid pointer to aBuffer
handle
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.
:: 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
AllocationCallbacks
were provided whenbuffer
was created, a compatible set of callbacks must be provided here - If no
AllocationCallbacks
were provided whenbuffer
was created,pAllocator
must beNULL
Valid Usage (Implicit)
-
device
must be a validDevice
handle
- If
buffer
is notNULL_HANDLE
,buffer
must be a validBuffer
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validAllocationCallbacks
structure - If
buffer
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
buffer
must 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
sharingMode
isSHARING_MODE_CONCURRENT
,pQueueFamilyIndices
must be a valid pointer to an array ofqueueFamilyIndexCount
uint32_t
values - If
sharingMode
isSHARING_MODE_CONCURRENT
,queueFamilyIndexCount
must be greater than1
- If
sharingMode
isSHARING_MODE_CONCURRENT
, each element ofpQueueFamilyIndices
must be unique and must be less thanpQueueFamilyPropertyCount
returned by eithergetPhysicalDeviceQueueFamilyProperties
orgetPhysicalDeviceQueueFamilyProperties2
for thephysicalDevice
that was used to createdevice
- If the
sparseBinding
feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_BINDING_BIT
- If the
sparseResidencyBuffer
feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT
- If the
sparseResidencyAliased
feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_ALIASED_BIT
- If
flags
containsBUFFER_CREATE_SPARSE_RESIDENCY_BIT
orBUFFER_CREATE_SPARSE_ALIASED_BIT
, it must also containBUFFER_CREATE_SPARSE_BINDING_BIT
- If the
pNext
chain includes aExternalMemoryBufferCreateInfo
structure, itshandleTypes
member must only contain bits that are also inExternalBufferProperties
::externalMemoryProperties.compatibleHandleTypes
, as returned bygetPhysicalDeviceExternalBufferProperties
withpExternalBufferInfo->handleType
equal to any one of the handle types specified inExternalMemoryBufferCreateInfo
::handleTypes
- If the
protectedMemory
feature is not enabled,
flags
must not containBUFFER_CREATE_PROTECTED_BIT
- If any of the bits
BUFFER_CREATE_SPARSE_BINDING_BIT
,BUFFER_CREATE_SPARSE_RESIDENCY_BIT
, orBUFFER_CREATE_SPARSE_ALIASED_BIT
are set,BUFFER_CREATE_PROTECTED_BIT
must not also be set - If the
pNext
chain includes aDedicatedAllocationBufferCreateInfoNV
structure, and thededicatedAllocation
member of the chained structure isTRUE
, thenflags
must not includeBUFFER_CREATE_SPARSE_BINDING_BIT
,BUFFER_CREATE_SPARSE_RESIDENCY_BIT
, orBUFFER_CREATE_SPARSE_ALIASED_BIT
- If
BufferDeviceAddressCreateInfoEXT
::deviceAddress
is not zero,flags
must includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
- If
BufferOpaqueCaptureAddressCreateInfo
::opaqueCaptureAddress
is not zero,flags
must includeBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
- If
flags
includesBUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT
, the bufferDeviceAddressCaptureReplay or bufferDeviceAddressCaptureReplayEXT feature must be enabled - If
usage
includesVK_BUFFER_USAGE_VIDEO_DECODE_SRC_BIT_KHR
orVK_BUFFER_USAGE_VIDEO_DECODE_DST_BIT_KHR
, then thepNext
chain must include a VkVideoProfileListInfoKHR structure withprofileCount
greater than0
andpProfiles
including at least one VkVideoProfileInfoKHR structure with avideoCodecOperation
member specifying a decode operation - If
usage
includesVK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR
orVK_BUFFER_USAGE_VIDEO_ENCODE_DST_BIT_KHR
, then thepNext
chain must include a VkVideoProfileListInfoKHR structure withprofileCount
greater than0
andpProfiles
including at least one VkVideoProfileInfoKHR structure with avideoCodecOperation
member specifying an encode operation -
size
must be less than or equal toPhysicalDeviceMaintenance4Properties
::maxBufferSize
- If
usage
includesBUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT
, creating thisBuffer
must not cause the total required space for all currently valid buffers using this flag on the device to exceedPhysicalDeviceDescriptorBufferPropertiesEXT
::samplerDescriptorBufferAddressSpaceSize
orPhysicalDeviceDescriptorBufferPropertiesEXT
::descriptorBufferAddressSpaceSize
- If
usage
includesBUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT
, creating thisBuffer
must not cause the total required space for all currently valid buffers using this flag on the device to exceedPhysicalDeviceDescriptorBufferPropertiesEXT
::resourceDescriptorBufferAddressSpaceSize
orPhysicalDeviceDescriptorBufferPropertiesEXT
::descriptorBufferAddressSpaceSize
- If
flags
includesBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
, the descriptorBufferCaptureReplay feature must be enabled - If the
pNext
chain includes aOpaqueCaptureDescriptorDataCreateInfoEXT
structure,flags
must containBUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
- If
usage
includesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT
, the descriptorBufferPushDescriptors feature must be enabled - If
usage
includesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT
::bufferlessPushDescriptors must beFALSE
- If
usage
includesBUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT
,usage
must contain at least one ofBUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT
orBUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT
- If the
pNext
chain does not include aBufferUsageFlags2CreateInfoKHR
structure,usage
must be a valid combination ofBufferUsageFlagBits
values - If the
pNext
chain does not include aBufferUsageFlags2CreateInfoKHR
structure,usage
must not be0
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_BUFFER_CREATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofBufferCollectionBufferCreateInfoFUCHSIA
,BufferDeviceAddressCreateInfoEXT
,BufferOpaqueCaptureAddressCreateInfo
,BufferUsageFlags2CreateInfoKHR
,DedicatedAllocationBufferCreateInfoNV
,ExternalMemoryBufferCreateInfo
,OpaqueCaptureDescriptorDataCreateInfoEXT
, or VkVideoProfileListInfoKHR - The
sType
value of each struct in thepNext
chain must be unique -
flags
must be a valid combination ofBufferCreateFlagBits
values -
sharingMode
must be a validSharingMode
value
See Also
VK_VERSION_1_0,
BufferConstraintsInfoFUCHSIA
,
BufferCreateFlags
,
BufferUsageFlags
,
DeviceBufferMemoryRequirements
,
DeviceSize
,
SharingMode
,
StructureType
, createBuffer
BufferCreateInfo | |
|
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 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
pattern SHARING_MODE_EXCLUSIVE :: SharingMode |
|
pattern SHARING_MODE_CONCURRENT :: SharingMode |
|
Instances
newtype BufferUsageFlagBits Source #
VkBufferUsageFlagBits - Bitmask specifying allowed usage of a buffer
See Also
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
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 |
|