Safe Haskell | None |
---|---|
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_RAY_TRACING_BIT_KHR :: 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_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
, creating thisBuffer
must not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceLimits
::sparseAddressSpaceSize
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
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 first argument.
To just extract the pair pass (,)
as the first 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
Valid Usage
size
must be greater than0
- 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
sparse bindings
feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_BINDING_BIT
- If the
sparse buffer residency
feature is not enabled,
flags
must not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT
- If the
sparse aliased residency
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 protected memory 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 ::bufferDeviceAddressCaptureReplay feature must be enabled
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 ofBufferDeviceAddressCreateInfoEXT
,BufferOpaqueCaptureAddressCreateInfo
,DedicatedAllocationBufferCreateInfoNV
, orExternalMemoryBufferCreateInfo
- The
sType
value of each struct in thepNext
chain must be unique flags
must be a valid combination ofBufferCreateFlagBits
valuesusage
must be a valid combination ofBufferUsageFlagBits
valuesusage
must not be0
sharingMode
must be a validSharingMode
value
See Also
BufferCreateFlags
,
BufferUsageFlags
,
DeviceSize
,
SharingMode
,
StructureType
, createBuffer
BufferCreateInfo | |
|
Instances
VkBuffer - Opaque handle to a buffer object
See Also
BindBufferMemoryInfo
,
BufferDeviceAddressInfo
,
BufferMemoryBarrier
,
BufferMemoryRequirementsInfo2
,
BufferViewCreateInfo
,
ConditionalRenderingBeginInfoEXT
,
DedicatedAllocationMemoryAllocateInfoNV
,
DescriptorBufferInfo
,
GeneratedCommandsInfoNV
,
GeometryAABBNV
,
GeometryTrianglesNV
,
IndirectCommandsStreamNV
,
MemoryDedicatedAllocateInfo
,
SparseBufferMemoryBindInfo
,
StridedBufferRegionKHR
,
bindBufferMemory
,
cmdBeginTransformFeedbackEXT
,
cmdBindIndexBuffer
,
cmdBindTransformFeedbackBuffersEXT
,
cmdBindVertexBuffers
,
cmdBuildAccelerationStructureIndirectKHR
,
cmdBuildAccelerationStructureNV
,
cmdCopyBuffer
,
cmdCopyBufferToImage
,
cmdCopyImageToBuffer
,
cmdCopyQueryPoolResults
,
cmdDispatchIndirect
,
cmdDrawIndexedIndirect
,
cmdDrawIndexedIndirectCount
,
cmdDrawIndexedIndirectCountAMD
,
cmdDrawIndexedIndirectCountKHR
,
cmdDrawIndirect
,
cmdDrawIndirectByteCountEXT
,
cmdDrawIndirectCount
,
cmdDrawIndirectCountAMD
,
cmdDrawIndirectCountKHR
,
cmdDrawMeshTasksIndirectCountNV
,
cmdDrawMeshTasksIndirectNV
,
cmdEndTransformFeedbackEXT
,
cmdFillBuffer
,
cmdTraceRaysIndirectKHR
,
cmdTraceRaysNV
,
cmdUpdateBuffer
,
cmdWriteBufferMarkerAMD
,
createBuffer
,
destroyBuffer
,
getBufferMemoryRequirements
Instances
Eq Buffer Source # | |
Ord Buffer Source # | |
Show Buffer Source # | |
Storable Buffer Source # | |
Zero Buffer Source # | |
Defined in Vulkan.Core10.Handles | |
HasObjectType Buffer Source # | |
Defined in Vulkan.Core10.Handles objectTypeAndHandle :: Buffer -> (ObjectType, Word64) Source # | |
IsHandle 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
BufferCreateInfo
,
ImageCreateInfo
,
PhysicalDeviceImageDrmFormatModifierInfoEXT
,
SwapchainCreateInfoKHR
pattern SHARING_MODE_EXCLUSIVE :: SharingMode |
|
pattern SHARING_MODE_CONCURRENT :: SharingMode |
|
Instances
newtype BufferUsageFlagBits Source #
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_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits |
|
pattern BUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits |
|