| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Core10.Buffer
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
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)
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 :: 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
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)
- 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
'Graphics.Vulkan.Extensions.VK_EXT_buffer_device_address.BufferDeviceAddressCreateInfoEXT'::'Graphics.Vulkan.Core10.BaseType.DeviceAddress'
is 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
| |