Libraries.Game.Graphics.Vulkan.VulkanBuffer Documentation

Inherits from: Libraries.Language.Object

Actions Documentation

BeginMapping()

This action allocates a chunk of memory that is accessible to the program, and maps the memory to the GPU's resources. The allocated memory must be freed later using the StopMapping action when it is no longer needed, or it will automatically be freed when calling the Dispose action. If this buffer doesn't support mapping, using this action will cause an error.

Return

boolean:

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Create(Libraries.Game.Graphics.Vulkan.VulkanDevice device, integer size, integer bufferUsage, integer memoryUsage, integer allocationFlags, integer requiredMemoryFlags, integer preferredMemoryFlags, boolean allowConcurrentAccess)

Create a buffer that can be transferred into and that can be read at arbitrary times and places.

Parameters

Return

boolean:

CreateMappableBuffer(Libraries.Game.Graphics.Vulkan.VulkanDevice device, integer size, integer bufferUsage)

Parameters

Return

boolean

CreateReadbackBuffer(Libraries.Game.Graphics.Vulkan.VulkanDevice device, integer size)

Create a buffer on host-accessible memory for mapped sequential writing, using whatever usage flags the user provides.

Parameters

Return

boolean:

CreateTransferDestinationBuffer(Libraries.Game.Graphics.Vulkan.VulkanDevice device, integer size, integer bufferUsage)

Create a buffer that will be used as a transfer source, using automatic memory type detection, and allocated so the host (i.e. the program) can access the memory for mapped sequential writing.

Parameters

Return

boolean:

CreateTransferSourceBuffer(Libraries.Game.Graphics.Vulkan.VulkanDevice device, integer size)

Parameters

Return

boolean

Dispose()

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetSize()

Return

integer

IsMapping()

This action returns true if the VulkanBuffer is currently mapping to a section of memory, or false otherwise. If the buffer doesn't support mapping (i.e. it wasn't created with the "MEMORY_PROPERTY_HOST_VISIBLE_BIT" property) then this will always return false.

Return

boolean:

StopMapping()

This action frees the memory that has been previously allocated by the BeginMapping action. If the buffer doesn't currently have mapped memory, or if it doesn't support mapping, this action will do nothing.

SupportsBufferDeviceAddress()

This action returns true if this buffer supports "mapped" memory that is directly accessible from the program, or false otherwise. Non-mapped (or "local") memory is stored directly on the GPU, which is more performant but not directly accessible from the program. Buffers don't support mapping by default, but can use mapped memory if they are created with the "MEMORY_PROPERTY_HOST_VISIBLE_BIT" as part of the memory flags when they are created.

Return

boolean:

SupportsMapping()

This action returns true if this buffer supports "mapped" memory that is directly accessible from the program, or false otherwise. Non-mapped (or "local") memory is stored directly on the GPU, which is more performant but not directly accessible from the program. Buffers don't support mapping by default, but can use mapped memory if they are created with the "MEMORY_PROPERTY_HOST_VISIBLE_BIT" as part of the memory flags when they are created.

Return

boolean: