Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- createBuffer :: PokeChain a => Device -> BufferCreateInfo a -> ("allocator" ::: Maybe AllocationCallbacks) -> IO Buffer
- withBuffer :: PokeChain a => Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> (Buffer -> IO r) -> IO r
- destroyBuffer :: Device -> Buffer -> ("allocator" ::: Maybe AllocationCallbacks) -> IO ()
- data BufferCreateInfo (es :: [Type]) = BufferCreateInfo {}
Documentation
createBuffer :: PokeChain a => 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)
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 :: PokeChain a => Device -> BufferCreateInfo a -> Maybe AllocationCallbacks -> (Buffer -> IO r) -> IO r Source #
A safe wrapper for createBuffer
and destroyBuffer
using bracket
The allocated value must not be returned from the provided computation
destroyBuffer :: 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)
- 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
'Graphics.Vulkan.Extensions.VK_EXT_buffer_device_address.BufferDeviceAddressCreateInfoEXT'::'Graphics.Vulkan.Core10.BaseType.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 | |
|