vulkan-3.0.0.0: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core10.MemoryManagement

Synopsis

Documentation

getBufferMemoryRequirements :: Device -> Buffer -> IO MemoryRequirements 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 is a pointer to a MemoryRequirements structure in which the memory requirements of the buffer object are returned.

Valid Usage (Implicit)

See Also

Buffer, Device, MemoryRequirements

bindBufferMemory :: Device -> Buffer -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> IO () 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 DeviceMemory 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 MemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified buffer.

Description

bindBufferMemory is equivalent to passing the same parameters through BindBufferMemoryInfo to bindBufferMemory2.

Valid Usage

  • Buffer must not already be backed by a memory object

Valid Usage (Implicit)

  • Buffer must be a valid Buffer handle
  • memory must be a valid DeviceMemory 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
Failure

See Also

Buffer, Device, DeviceMemory, DeviceSize

getImageMemoryRequirements :: Device -> Image -> IO MemoryRequirements 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 is a pointer to a MemoryRequirements structure in which the memory requirements of the image object are returned.

Valid Usage (Implicit)

See Also

Device, Image, MemoryRequirements

bindImageMemory :: Device -> Image -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> IO () 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 DeviceMemory 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 MemoryRequirements::size member in memory, starting from memoryOffset bytes, will be bound to the specified image.

Description

bindImageMemory is equivalent to passing the same parameters through BindImageMemoryInfo to bindImageMemory2.

Valid Usage

  • 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 MemoryRequirements structure returned from a call to getImageMemoryRequirements with Image
  • memoryOffset must be an integer multiple of the alignment member of the MemoryRequirements structure returned from a call to getImageMemoryRequirements with Image
  • The difference of the size of memory and memoryOffset must be greater than or equal to the size member of the MemoryRequirements structure returned from a call to getImageMemoryRequirements with the same Image
  • If Image requires a dedicated allocation (as reported by getImageMemoryRequirements2 in MemoryDedicatedRequirements::requiresDedicatedAllocation for Image), memory must have been created with 'Graphics.Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo'::'Graphics.Vulkan.Core10.Handles.Image' equal to Image
  • If the dedicated allocation image aliasing feature is not enabled, and the MemoryAllocateInfo provided when memory was allocated included a MemoryDedicatedAllocateInfo structure in its pNext chain, and 'Graphics.Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo'::'Graphics.Vulkan.Core10.Handles.Image' was not NULL_HANDLE, then Image must equal 'Graphics.Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo'::'Graphics.Vulkan.Core10.Handles.Image' and memoryOffset must be zero.
  • If the dedicated allocation image aliasing feature is enabled, and the MemoryAllocateInfo provided when memory was allocated included a MemoryDedicatedAllocateInfo structure in its pNext chain, and 'Graphics.Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo'::'Graphics.Vulkan.Core10.Handles.Image' was not NULL_HANDLE, then memoryOffset must be zero, and Image must be either equal to 'Graphics.Vulkan.Core11.Promoted_From_VK_KHR_dedicated_allocation.MemoryDedicatedAllocateInfo'::'Graphics.Vulkan.Core10.Handles.Image' or an image that was created using the same parameters in ImageCreateInfo, with the exception that extent and arrayLayers may differ subject to the following restrictions: every dimension in the extent parameter of the image being bound must be equal to or smaller than the original image for which the allocation was created; and the arrayLayers parameter of the image being bound must be equal to or smaller than the original image for which the allocation was created.
  • If image was created with the IMAGE_CREATE_PROTECTED_BIT bit set, the image must be bound to a memory object allocated with a memory type that reports MEMORY_PROPERTY_PROTECTED_BIT
  • If image was created with the IMAGE_CREATE_PROTECTED_BIT bit not set, the image must not be bound to a memory object created with a memory type that reports MEMORY_PROPERTY_PROTECTED_BIT
  • If Image was created with DedicatedAllocationImageCreateInfoNV::dedicatedAllocation equal to TRUE, memory must have been created with 'Graphics.Vulkan.Extensions.VK_NV_dedicated_allocation.DedicatedAllocationMemoryAllocateInfoNV'::'Graphics.Vulkan.Core10.Handles.Image' equal to an image handle created with identical creation parameters to Image and memoryOffset must be zero
  • If the value of ExportMemoryAllocateInfo::handleTypes used to allocate memory is not 0, it must include at least one of the handles set in ExternalMemoryImageCreateInfo::handleTypes when Image was created
  • If memory was created by a memory import operation, the external handle type of the imported memory must also have been set in ExternalMemoryImageCreateInfo::handleTypes when Image was created

Valid Usage (Implicit)

  • Image must be a valid Image handle
  • memory must be a valid DeviceMemory 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
Failure

See Also

Device, DeviceMemory, DeviceSize, Image

data MemoryRequirements Source #

VkMemoryRequirements - Structure specifying memory requirements

See Also

DeviceSize, MemoryRequirements2, getBufferMemoryRequirements, getImageMemoryRequirements

Constructors

MemoryRequirements 

Fields

  • size :: DeviceSize

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

  • alignment :: DeviceSize

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

  • memoryTypeBits :: 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 PhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.

Instances
Show MemoryRequirements Source # 
Instance details

Defined in Graphics.Vulkan.Core10.MemoryManagement

Storable MemoryRequirements Source # 
Instance details

Defined in Graphics.Vulkan.Core10.MemoryManagement

FromCStruct MemoryRequirements Source # 
Instance details

Defined in Graphics.Vulkan.Core10.MemoryManagement

ToCStruct MemoryRequirements Source # 
Instance details

Defined in Graphics.Vulkan.Core10.MemoryManagement

Zero MemoryRequirements Source # 
Instance details

Defined in Graphics.Vulkan.Core10.MemoryManagement