Libraries.Game.Graphics.Vulkan.VulkanInstance Documentation

This class is a Quorum representation of a Vulkan instance. A Vulkan Instance is an interface that allows the application to send requests to the Vulkan library. Most commonly, Vulkan is used for rendering graphics, but it can also be used for any other hardware accelerated computations, such as performing statistical calculations on the GPU. An Instance isn't usually used directly. More often, it is used as a shared resource by other Vulkan objects, such as Vulkan Physical Devices.

Inherits from: Libraries.Language.Object

Actions Documentation

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(text applicationName, integer applicationVersion, integer apiVersion, Libraries.Containers.Array<text> layerNames, Libraries.Containers.Array<text> extensionNames)

This action initializes the Vulkan instance using the provided layers and extensions. The layers and extensions available on this device can be found using the VulkanUtilities class. If the instance is successfully created, this function returns true. If the instance cannot be created, this action returns false instead.

Parameters

  • text applicationName: The title of the application that is using this instance. Hardware agents can use this to identify your app, if they choose.
  • integer applicationVersion: The version number of your application. Hardware agents can use this to identify the version of your app, if they choose.
  • integer apiVersion: The Vulkan API version to use. This must be an encoded API number (see "ConvertToAPIVersionID" in VulkanUtilities).
  • Libraries.Containers.Array: An array containing the names of each of the layers to be used by the Vulkan instance.
  • Libraries.Containers.Array: An array containing the names of each of the extensions to be used by the Vulkan instance.

Return

boolean: True if the instance is successfully created, or false if it could not be created.

CreateGraphicsInstance(text applicationName, integer applicationVersion, integer apiVersion, boolean useValidationLayers)

This action initializes the Vulkan instance with the proper extensions needed for basic rendering and screen display. For fine control over which extensions and layers are used, use the Create action instead. If the instance is successfully created, this function returns true. If the instance cannot be created, this action returns false instead.

Parameters

  • text applicationName: The title of the application that is using this instance. Hardware agents can use this to identify your app, if they choose.
  • integer applicationVersion: The version number of your application. Hardware agents can use this to identify the version of your app, if they choose.
  • integer apiVersion: The Vulkan API version to use. This must be an encoded API number (see "ConvertToAPIVersionID" in VulkanUtilities).
  • boolean useValidationLayers: Whether or not the instance should use Validation Layers, if they are available. If this is true and they aren't available, the instance will be made without them.

Return

boolean: True if the instance is successfully created, or false if it could not be created.

Dispose()

This action destroys the instance and releases all system resources related to it. Once the instance is disposed, it can't be used anymore, so this should only be done to clean up resources when the instance is no longer needed.

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()

GetLogger()

This action returns the Logger that is being used by this Vulkan instance. All Vulkan errors and warnings (including any that would be produced by validation layers, if there are any) will be reported to the logger. By default, no logger is provided if validation layers are not used, and a ConsoleLogger is provided if validation layers are on.

Return

Libraries.System.Logging.Logger: The Logger being used to handle errors and warnings from the Vulkan instance.

HasValidationLayers()

This action returns the Logger that is being used by this Vulkan instance. All Vulkan errors and warnings (including any that would be produced by validation layers, if there are any) will be reported to the logger. By default, no logger is provided if validation layers are not used, and a ConsoleLogger is provided if validation layers are on.

Return

boolean: The Logger being used to handle errors and warnings from the Vulkan instance.

IsInitialized()

This action initializes the Vulkan instance with the proper extensions needed for basic rendering and screen display. For fine control over which extensions and layers are used, use the Create action instead. If the instance is successfully created, this function returns true. If the instance cannot be created, this action returns false instead.

Return

boolean: True if the instance is successfully created, or false if it could not be created.

SetLogger(Libraries.System.Logging.Logger logger)

This action sets the Logger that should be used by this Vulkan instance. All Vulkan errors and warnings (including any that would be produced by validation layers, if there are any) will be reported to the logger. By default, no logger is provided if validation layers are not used, and a ConsoleLogger is provided if validation layers are on.

Parameters