vulkan-3.2.0.0: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core10.Buffer

Synopsis

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 a BufferCreateInfo 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 a Buffer handle in which the resulting buffer object is returned.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid Device handle
  • pCreateInfo must be a valid pointer to a valid BufferCreateInfo structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • pBuffer must be a valid pointer to a Buffer handle

Return Codes

Success
Failure

See Also

AllocationCallbacks, Buffer, BufferCreateInfo, Device

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 a BufferView, must have completed execution
  • If AllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here
  • If no AllocationCallbacks were provided when buffer was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid Device handle
  • If buffer is not NULL_HANDLE, buffer must be a valid Buffer handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid AllocationCallbacks structure
  • If buffer is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to buffer must be externally synchronized

See Also

AllocationCallbacks, Buffer, Device

data BufferCreateInfo (es :: [Type]) Source #

VkBufferCreateInfo - Structure specifying the parameters of a newly created buffer object

Valid Usage

  • size must be greater than 0

Valid Usage (Implicit)

See Also

BufferCreateFlags, BufferUsageFlags, DeviceSize, SharingMode, StructureType, createBuffer

Constructors

BufferCreateInfo 

Fields