Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
device
is the logical device that creates the buffer object.
pCreateInfo
is a pointer to aBufferCreateInfo
structure containing parameters affecting creation of the buffer.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pBuffer
is a pointer to aBuffer
handle in which the resulting buffer object is returned.
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. (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
device
is the logical device that destroys the buffer.
buffer
is the buffer to destroy.pAllocator
controls 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
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 | |
|