vulkan-2.0.0.0: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core10.MemoryManagement

Synopsis

Documentation

vkGetBufferMemoryRequirements :: ("device" ::: VkDevice) -> ("buffer" ::: VkBuffer) -> ("pMemoryRequirements" ::: Ptr VkMemoryRequirements) -> IO () Source #

vkGetBufferMemoryRequirements - Returns the memory requirements for specified Vulkan object

Parameters

  • device is the logical device that owns the buffer.
  • buffer is the buffer to query.
  • pMemoryRequirements points to an instance of the VkMemoryRequirements structure in which the memory requirements of the buffer object are returned.

Description

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • buffer must be a valid VkBuffer handle
  • pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure
  • buffer must have been created, allocated, or retrieved from device

See Also

VkBuffer, VkDevice, VkMemoryRequirements

vkBindBufferMemory :: ("device" ::: VkDevice) -> ("buffer" ::: VkBuffer) -> ("memory" ::: VkDeviceMemory) -> ("memoryOffset" ::: VkDeviceSize) -> IO VkResult Source #

vkBindBufferMemory - Bind device memory to a buffer object

Parameters

  • device is the logical device that owns the buffer and memory.
  • buffer is the buffer to be attached to memory.
  • memory is a VkDeviceMemory object describing the device memory to attach.
  • memoryOffset is the start offset of the region of memory which is to be bound to the buffer. The number of bytes returned in the VkMemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified buffer.

Description

vkBindBufferMemory is equivalent to passing the same parameters through VkBindBufferMemoryInfo to vkBindBufferMemory2.

Valid Usage

  • buffer must not already be backed by a memory object
  • buffer must not have been created with any sparse memory binding flags
  • memoryOffset must be less than the size of memory
  • If buffer was created with the VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minTexelBufferOffsetAlignment
  • If buffer was created with the VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minUniformBufferOffsetAlignment
  • If buffer was created with the VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, memoryOffset must be a multiple of VkPhysicalDeviceLimits::minStorageBufferOffsetAlignment
  • memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer
  • memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer
  • The size member of the VkMemoryRequirements structure returned from a call to vkGetBufferMemoryRequirements with buffer must be less than or equal to the size of memory minus memoryOffset
  • If buffer requires a dedicated allocation(as reported by vkGetBufferMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for buffer), memory must have been created with VkMemoryDedicatedAllocateInfo::buffer equal to buffer
  • If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::buffer was not VK_NULL_HANDLE, then buffer must equal VkMemoryDedicatedAllocateInfo::buffer, and memoryOffset must be zero.
  • If buffer was created with VkDedicatedAllocationBufferCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::buffer equal to a buffer handle created with identical creation parameters to buffer and memoryOffset must be zero

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • buffer must be a valid VkBuffer handle
  • memory must be a valid VkDeviceMemory handle
  • buffer must have been created, allocated, or retrieved from device
  • memory must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to buffer must be externally synchronized

Return Codes

Success
- VK_SUCCESS
Failure
- VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY

See Also

VkBuffer, VkDevice, VkDeviceMemory, VkDeviceSize

vkGetImageMemoryRequirements :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("pMemoryRequirements" ::: Ptr VkMemoryRequirements) -> IO () Source #

vkGetImageMemoryRequirements - Returns the memory requirements for specified Vulkan object

Parameters

  • device is the logical device that owns the image.
  • image is the image to query.
  • pMemoryRequirements points to an instance of the VkMemoryRequirements structure in which the memory requirements of the image object are returned.

Description

Valid Usage

  • image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT flag set

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • image must be a valid VkImage handle
  • pMemoryRequirements must be a valid pointer to a VkMemoryRequirements structure
  • image must have been created, allocated, or retrieved from device

See Also

VkDevice, VkImage, VkMemoryRequirements

vkBindImageMemory :: ("device" ::: VkDevice) -> ("image" ::: VkImage) -> ("memory" ::: VkDeviceMemory) -> ("memoryOffset" ::: VkDeviceSize) -> IO VkResult Source #

vkBindImageMemory - Bind device memory to an image object

Parameters

  • device is the logical device that owns the image and memory.
  • image is the image.
  • memory is the VkDeviceMemory object describing the device memory to attach.
  • memoryOffset is the start offset of the region of memory which is to be bound to the image. The number of bytes returned in the VkMemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified image.

Description

vkBindImageMemory is equivalent to passing the same parameters through VkBindImageMemoryInfo to vkBindImageMemory2.

Valid Usage

  • image must not have been created with the VK_IMAGE_CREATE_DISJOINT_BIT set.
  • image must not already be backed by a memory object
  • image must not have been created with any sparse memory binding flags
  • memoryOffset must be less than the size of memory
  • memory must have been allocated using one of the memory types allowed in the memoryTypeBits member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image
  • memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image
  • The size member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements with image must be less than or equal to the size of memory minus memoryOffset
  • If image requires a dedicated allocation (as reported by vkGetImageMemoryRequirements2 in VkMemoryDedicatedRequirements::requiresDedicatedAllocation for image), memory must have been created with VkMemoryDedicatedAllocateInfo::image equal to image
  • If the VkMemoryAllocateInfo provided when memory was allocated included an instance of VkMemoryDedicatedAllocateInfo in its pNext chain, and VkMemoryDedicatedAllocateInfo::image was not VK_NULL_HANDLE, then image must equal VkMemoryDedicatedAllocateInfo::image and memoryOffset must be zero.
  • If image was created with VkDedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to VK_TRUE, memory must have been created with VkDedicatedAllocationMemoryAllocateInfoNV::image equal to an image handle created with identical creation parameters to image and memoryOffset must be zero

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • image must be a valid VkImage handle
  • memory must be a valid VkDeviceMemory handle
  • image must have been created, allocated, or retrieved from device
  • memory must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to image must be externally synchronized

Return Codes

Success
- VK_SUCCESS
Failure
- VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY

See Also

VkDevice, VkDeviceMemory, VkDeviceSize, VkImage

data VkMemoryRequirements Source #

VkMemoryRequirements - Structure specifying memory requirements

Description

See Also

VkDeviceSize, VkMemoryRequirements2, vkGetBufferMemoryRequirements, vkGetImageMemoryRequirements

Constructors

VkMemoryRequirements 

Fields

  • vkSize :: VkDeviceSize

    size is the size, in bytes, of the memory allocation required for the resource.

  • vkAlignment :: VkDeviceSize

    alignment is the alignment, in bytes, of the offset within the allocation required for the resource.

  • vkMemoryTypeBits :: Word32

    memoryTypeBits is a bitmask and contains one bit set for every supported memory type for the resource. Bit i is set if and only if the memory type i in the VkPhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.