| Safe Haskell | None |
|---|---|
| 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_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
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, creating thisBuffermust not cause the total required sparse memory for all currently valid sparse resources on the device to exceedPhysicalDeviceLimits::sparseAddressSpaceSize
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
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.
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
Valid Usage
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 eithergetPhysicalDeviceQueueFamilyPropertiesorgetPhysicalDeviceQueueFamilyProperties2for thephysicalDevicethat was used to createdevice - If the
sparse bindings
feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_BINDING_BIT - If the
sparse buffer residency
feature is not enabled,
flagsmust not containBUFFER_CREATE_SPARSE_RESIDENCY_BIT - If the
sparse aliased residency
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 protected memory 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 ::bufferDeviceAddressCaptureReplay feature must be enabled
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 ofBufferDeviceAddressCreateInfoEXT,BufferOpaqueCaptureAddressCreateInfo,DedicatedAllocationBufferCreateInfoNV, orExternalMemoryBufferCreateInfo - The
sTypevalue of each struct in thepNextchain must be unique flagsmust be a valid combination ofBufferCreateFlagBitsvaluesusagemust be a valid combination ofBufferUsageFlagBitsvaluesusagemust not be0sharingModemust be a validSharingModevalue
See Also
BufferCreateFlags,
BufferUsageFlags,
DeviceSize,
SharingMode,
StructureType, createBuffer
Constructors
| BufferCreateInfo | |
Fields
| |
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,
cmdBindVertexBuffers2EXT,
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 Methods 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
Constructors
| SharingMode Int32 |
Bundled Patterns
| pattern SHARING_MODE_EXCLUSIVE :: SharingMode |
|
| pattern SHARING_MODE_CONCURRENT :: SharingMode |
|
Instances
newtype BufferUsageFlagBits Source #
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_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT :: BufferCreateFlagBits |
|
| pattern BUFFER_CREATE_PROTECTED_BIT :: BufferCreateFlagBits |
|