| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Buffer
Synopsis
- createBuffer :: forall a io. (PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Buffer
- withBuffer :: forall a io r. (PokeChain a, MonadIO io) => (io Buffer -> (Buffer -> io ()) -> r) -> Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> r
- destroyBuffer :: forall io. MonadIO io => Device -> Buffer -> ("allocator" ::: Maybe AllocationCallbacks) -> io ()
- data BufferCreateInfo (es :: [Type]) = BufferCreateInfo {}
Documentation
createBuffer :: forall a io. (PokeChain a, MonadIO io) => Device -> BufferCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> io Buffer Source #
vkCreateBuffer - Create a new buffer object
Parameters
deviceis the logical device that creates the buffer object.
pCreateInfois a pointer to aBufferCreateInfostructure containing parameters affecting creation of the buffer.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.pBufferis a pointer to aBufferhandle in which the resulting buffer object is returned.
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. (PokeChain a, MonadIO io) => (io Buffer -> (Buffer -> io ()) -> r) -> Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> 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.
destroyBuffer :: forall io. MonadIO io => Device -> Buffer -> ("allocator" ::: Maybe AllocationCallbacks) -> io () Source #
vkDestroyBuffer - Destroy a buffer object
Parameters
deviceis the logical device that destroys the buffer.
bufferis the buffer to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
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
| |