目录

XEngine

Overview

Provides graphics APIs of XEngine.

Syscap: SystemCapability.Graphic.XEngine

Since: 5.0.0(12)

Summary

[h2]Files

Name

Description

xeg_extension_defs.h

Provides extension macro definition of XEngine.

xeg_gles_adaptive_vrs.h

VRS APIs of XEngine. Before using APIs in this header file, you need to call the HMS_XEG_GetString API to verify that extension XEG_ADAPTIVE_VRS_EXTENSION_NAME is available.

xeg_gles_extension.h

(GLES) API for querying extensions of XEngine.

xeg_gles_neural_upscale.h

AI spatial upscaling APIs of XEngine. Before using APIs in this header file, you need to call the HMS_XEG_GetString API to verify that extension XEG_NEURAL_UPSCALE_EXTENSION_NAME is available.

xeg_gles_spatial_upscale.h

GLES APIs for the GPU spatial upscaling feature of XEngine. Before using APIs in this header file, you need to call the HMS_XEG_GetString API to verify that extension XEG_SPATIAL_UPSCALE_EXTENSION_NAME is available.

xeg_vulkan_adaptive_vrs.h

Vulkan APIs for the adaptive VRS of XEngine. Before using APIs in this header file, you need to call the HMS_XEG_EnumerateDeviceExtensionProperties API to verify that extension XEG_ADAPTIVE_VRS_EXTENSION_NAME is available.

xeg_vulkan_extension.h

(Vulkan) API for querying extensions of XEngine.

xeg_vulkan_spatial_upscale.h

Vulkan APIs for the GPU spatial upscaling of XEngine. Before using APIs in this header file, you need to call the HMS_XEG_EnumerateDeviceExtensionProperties API to verify that extension XEG_SPATIAL_UPSCALE_EXTENSION_NAME is available.

xeg_vulkan_temporal_upscale.h

AI temporal upscaling APIs of XEngine. The recommended upscaling multiple range is [1.25, 2.0]. Before using APIs in this header file, you need to call the HMS_XEG_EnumerateDeviceExtensionProperties API to verify that extension XEG_TEMPORAL_UPSCALE_EXTENSION_NAME is available.

[h2]Data Structures

Name

Description

struct XEG_AdaptiveVRSCreateInfo

This structure describes the parameter information for creating an XEG_AdaptiveVRS object. When the information in the structure changes, a new XEG_AdaptiveVRS object needs to be created.

struct XEG_AdaptiveVRSDescription

This structure describes the parameter information required for delivering the command for drawing the shading rate texture. The information needs to be updated for each frame.

struct XEG_ExtensionProperties

This structure describes the set of XEngine extensions queried through the HMS_XEG_EnumerateDeviceExtensionProperties API.

struct XEG_SpatialUpscaleCreateInfo

This structure describes the information for creating an XEG_SpatialUpscale object. When the information in the structure changes, a new XEG_SpatialUpscale object needs to be created.

struct XEG_SpatialUpscaleDescription

This structure describes the image information required for delivering the GPU spatial upscaling rendering command.

struct XEG_TemporalUpscaleCreateInfo

This structure describes the information for creating an XEG_TemporalUpscale object. When the information in the structure changes, a new XEG_TemporalUpscale object needs to be created.

struct XEG_TemporalUpscaleDescription

This structure describes the input information for delivering AI temporal upscaling rendering command.

[h2]Macros

Name

Description

XEG_spatial_upscale 1

Extension macro definition of GPU spatial upscaling of XEngine.

XEG_SPATIAL_UPSCALE_VERSION 1

Extension version number of GPU spatial upscaling of XEngine.

XEG_SPATIAL_UPSCALE_EXTENSION_NAME "XEG_spatial_upscale"

Extension name of GPU spatial upscaling of XEngine.

XEG_neural_upscale 1

Extension macro definition of AI spatial upscaling of XEngine.

XEG_NEURAL_UPSCALE_VERSION 1

Extension version number of AI spatial upscaling of XEngine.

XEG_NEURAL_UPSCALE_EXTENSION_NAME "XEG_neural_upscale"

Extension name of AI spatial upscaling of XEngine.

XEG_temporal_upscale 1

Extension macro definition of AI temporal upscaling of XEngine.

XEG_TEMPORAL_UPSCALE_VERSION 1

Extension version number of AI temporal upscaling of XEngine.

XEG_TEMPORAL_UPSCALE_EXTENSION_NAME "XEG_temporal_upscale"

Extension name of AI temporal upscaling of XEngine.

XEG_adaptive_vrs 1

Extension macro definition of adaptive VRS of XEngine.

XEG_ADAPTIVE_VRS_VERSION 1

Extension version number of adaptive VRS of XEngine.

XEG_ADAPTIVE_VRS_EXTENSION_NAME "XEG_adaptive_vrs"

Extension name of adaptive VRS of XEngine.

XEG_ADAPTIVE_VRS_INPUT_SIZE 0x1U

Sets the INPUT_SIZE parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the image width and height finally rendered by the rendering pipeline of the previous frame.

XEG_ADAPTIVE_VRS_INPUT_REGION 0x2U

Sets the INPUT_REGION parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the image region finally rendered by the rendering pipeline of the previous frame.

XEG_ADAPTIVE_VRS_TEXEL_SIZE 0x3U

Sets the TEXEL_SIZE parameter of the HMS_XEG_AdaptiveVRSParameter API.

XEG_ADAPTIVE_VRS_ERROR_SENSITIVITY 0x4U

Sets the ERROR_SENSITIVITY parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the threshold for controlling the generation of the shading rate image. A larger value indicates a smaller average shading rate, that is, the performance is better but the image quality deteriorates. The recommended value range is [0, 1].

XEG_ADAPTIVE_VRS_FLIP 0x5U

Sets the FLIP parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating whether to flip the image vertically.

XEG_EXTENSIONS 0x01U

Input parameter of the HMS_XEG_GetString API, which is used to obtain GLES extensions supported by XEngine.

XEG_NEURAL_UPSCALE_SCISSOR 0x1U

Sets the cropping window parameter for upscaling through the HMS_XEG_NeuralUpscaleParameter API. The cropping window is used to determine the area for sampling the input image.

XEG_NEURAL_UPSCALE_SHARPNESS 0x2U

Sets the sharpness parameter for upscaling through the HMS_XEG_NeuralUpscaleParameter API. The recommended value range of sharpness is [0, 1].

XEG_NEURAL_UPSCALE_INPUT_HANDLE 0x4U

Sets the OH_NativeBuffer handle associated with the upscaling input texture through the HMS_XEG_NeuralUpscaleParameter API.

XEG_SPATIAL_UPSCALE_SCISSOR 0x1U

Sets the SCISSOR parameter of the HMS_XEG_SpatialUpscaleParameter API.

XEG_SPATIAL_UPSCALE_SHARPNESS 0x2U

Sets the SHARPNESS parameter of the HMS_XEG_SpatialUpscaleParameter API.

XEG_MAX_EXTENSION_NAME_SIZE 256

Maximum length of the extension name supported by XEngine.

[h2]Typedefs

Name

Description

typedef void(GL_APIENTRYP PFN_HMS_XEG_ADAPTIVEVRSPARAMETER) (GLenum pname, GLvoid *param)

Defines the function pointer for setting the input parameter of the adaptive variable rate shading (VRS).

typedef void(GL_APIENTRYP PFN_HMS_XEG_DISPATCHADAPTIVEVRS) (GLfloat *reprojectionMatrix, GLuint inputColorImage, GLuint inputDepthImage, GLuint shadingRateImage)

Defines the function pointer for computing the shading rate image.

typedef void(GL_APIENTRYP PFN_HMS_XEG_APPLYADAPTIVEVRS) (GLuint shadingRateImage)

Defines the function pointer for applying the shading rate image to the render target.

typedef const GLubyte *(GL_APIENTRYP PFN_HMS_XEG_GETSTRING) (GLenum name)

Defines the function pointer of the GLES API for querying extensions of XEngine.

typedef void(GL_APIENTRYP PFN_HMS_XEG_NEURALUPSCALEPARAMETER) (GLenum pname, GLvoid *param)

Defines the function pointer for setting the AI spatial upscaling input parameter.

typedef void(GL_APIENTRYP PFN_HMS_XEG_RENDERNEURALUPSCALE) (GLuint inputTexture)

Defines the function pointer for executing the AI spatial upscaling rendering command.

typedef void(GL_APIENTRYP PFN_HMS_XEG_SPATIALUPSCALEPARAMETER) (GLenum pname, GLvoid *param)

Defines the function pointer for setting the GPU spatial upscaling input parameter.

typedef void(GL_APIENTRYP PFN_HMS_XEG_RENDERSPATIALUPSCALE) (GLuint inputTexture)

Defines the function pointer for executing the GPU spatial upscaling rendering command.

VK_DEFINE_HANDLE(XEG_AdaptiveVRS)

XEG_AdaptiveVRS handle.

typedef struct XEG_AdaptiveVRSCreateInfo XEG_AdaptiveVRSCreateInfo

This structure describes the parameter information for creating an XEG_AdaptiveVRS object. When the information in the structure changes, a new XEG_AdaptiveVRS object needs to be created.

typedef struct XEG_AdaptiveVRSDescription XEG_AdaptiveVRSDescription

This structure describes the parameter information required for delivering the command for drawing the shading rate texture. The information needs to be updated for each frame.

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_CreateAdaptiveVRS) (VkDevice device, const XEG_AdaptiveVRSCreateInfo *pXegAdaptiveVRSCreateInfo, XEG_AdaptiveVRS *pXegAdaptiveVRS)

Defines the function pointer for creating an XEG_AdaptiveVRS object.

typedef void(VKAPI_PTR * PFN_HMS_XEG_CmdDispatchAdaptiveVRS) (VkCommandBuffer commandBuffer, XEG_AdaptiveVRS xegAdaptiveVRS, XEG_AdaptiveVRSDescription *pXegAdaptiveVRSDescription)

Defines the function pointer for computing the adaptive VRS command.

typedef void(VKAPI_PTR * PFN_HMS_XEG_DestroyAdaptiveVRS) (XEG_AdaptiveVRS xegAdaptiveVRS)

Defines the function pointer for destroying an XEG_AdaptiveVRS object.

typedef struct XEG_ExtensionProperties XEG_ExtensionProperties

This structure describes the set of XEngine extensions queried through the HMS_XEG_EnumerateDeviceExtensionProperties API.

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_EnumerateDeviceExtensionProperties) (VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, XEG_ExtensionProperties *pProperties)

Defines the function pointer of the Vulkan API for querying extensions of XEngine.

VK_DEFINE_HANDLE(XEG_SpatialUpscale)

Handle to XEG_SpatialUpscale.

typedef struct XEG_SpatialUpscaleCreateInfo XEG_SpatialUpscaleCreateInfo

This structure describes the information for creating an XEG_SpatialUpscale object. When the information in the structure changes, a new XEG_SpatialUpscale object needs to be created.

typedef struct XEG_SpatialUpscaleDescription XEG_SpatialUpscaleDescription

This structure describes the image information required for delivering the GPU spatial upscaling rendering command.

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_CreateSpatialUpscale) (VkDevice device, const XEG_SpatialUpscaleCreateInfo *pXegSpatialUpscaleCreateInfo, XEG_SpatialUpscale *pXegSpatialUpscale)

Defines the function pointer for creating an XEG_SpatialUpscale object.

typedef void(VKAPI_PTR * PFN_HMS_XEG_CmdRenderSpatialUpscale) (VkCommandBuffer commandBuffer, XEG_SpatialUpscale xegSpatialUpscale, XEG_SpatialUpscaleDescription *pXegSpatialUpscaleDescription)

Defines the function pointer for executing the GPU spatial upscaling rendering command.

typedef void(VKAPI_PTR * PFN_HMS_XEG_DestroySpatialUpscale) (XEG_SpatialUpscale xegSpatialUpscale)

Defines the function pointer for destroying an XEG_SpatialUpscale object.

VK_DEFINE_HANDLE(XEG_TemporalUpscale)

Handle to XEG_TemporalUpscale.

typedef struct XEG_TemporalUpscaleCreateInfo XEG_TemporalUpscaleCreateInfo

This structure describes the information for creating an XEG_TemporalUpscale object. When the information in the structure changes, a new XEG_TemporalUpscale object needs to be created.

typedef struct XEG_TemporalUpscaleDescription XEG_TemporalUpscaleDescription

This structure describes the input information for delivering AI temporal upscaling rendering command.

typedef VkResult(VKAPI_ATTR * PFN_HMS_XEG_CreateTemporalUpscale) (VkDevice device, XEG_TemporalUpscaleCreateInfo *pTemporalUpscaleInfo, XEG_TemporalUpscale *pTemporalUpscale)

Defines the function pointer for creating an XEG_TemporalUpscale object.

typedef void(VKAPI_ATTR * PFN_HMS_XEG_CmdRenderTemporalUpscale) (VkCommandBuffer commandBuffer, XEG_TemporalUpscale temporalUpscale, XEG_TemporalUpscaleDescription *pDescription)

Defines the function pointer for recording the AI temporal upscaling rendering command.

typedef void(VKAPI_ATTR * PFN_HMS_XEG_DestroyTemporalUpscale) (XEG_TemporalUpscale temporalUpscale)

Defines the function pointer for destroying an XEG_TemporalUpscale object.

[h2]Functions

Name

Description

GL_APICALL void GL_APIENTRY HMS_XEG_AdaptiveVRSParameter (GLenum pname, GLvoid *param)

Sets parameters of the adaptive VRS.

GL_APICALL void GL_APIENTRY HMS_XEG_DispatchAdaptiveVRS (GLfloat *reprojectionMatrix, GLuint inputColorImage, GLuint inputDepthImage, GLuint shadingRateImage)

Computes the shading rate image.

GL_APICALL void GL_APIENTRY HMS_XEG_ApplyAdaptiveVRS (GLuint shadingRateImage)

Applies the shading rate image to the render target.

const GLubyte * HMS_XEG_GetString (GLenum name)

GLES API for querying extensions of XEngine.

GL_APICALL void GL_APIENTRY HMS_XEG_NeuralUpscaleParameter (GLenum pname, GLvoid *param)

Sets the AI spatial upscaling input parameter.

GL_APICALL void GL_APIENTRY HMS_XEG_RenderNeuralUpscale (GLuint inputTexture)

Executes the AI spatial upscaling rendering command.

GL_APICALL void GL_APIENTRY HMS_XEG_SpatialUpscaleParameter (GLenum pname, GLvoid *param)

Sets the GPU spatial upscaling input parameter.

GL_APICALL void GL_APIENTRY HMS_XEG_RenderSpatialUpscale (GLuint inputTexture)

Executes the GPU spatial upscaling rendering command.

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateAdaptiveVRS (VkDevice device, XEG_AdaptiveVRSCreateInfo *pXegAdaptiveVRSCreateInfo, XEG_AdaptiveVRS *pXegAdaptiveVRS)

Creates an XEG_AdaptiveVRS object.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdDispatchAdaptiveVRS (VkCommandBuffer cmdBuffer, XEG_AdaptiveVRS xegAdaptiveVRS, XEG_AdaptiveVRSDescription *pXegAdaptiveVRSDescription)

Executes the command for computing the adaptive VRS.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroyAdaptiveVRS (XEG_AdaptiveVRS xegAdaptiveVRS)

Destroys an XEG_AdaptiveVRS object.

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_EnumerateDeviceExtensionProperties (VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, XEG_ExtensionProperties *pProperties)

Vulkan API for querying extensions of XEngine.

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateSpatialUpscale (VkDevice device, const XEG_SpatialUpscaleCreateInfo *pXegSpatialUpscaleCreateInfo, XEG_SpatialUpscale *pXegSpatialUpscale)

Creates an XEG_SpatialUpscale object.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdRenderSpatialUpscale (VkCommandBuffer commandBuffer, XEG_SpatialUpscale xegSpatialUpscale, XEG_SpatialUpscaleDescription *pXegSpatialUpscaleDescription)

Executes the GPU spatial upscaling rendering command.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroySpatialUpscale (XEG_SpatialUpscale xegSpatialUpscale)

Destroys an XEG_SpatialUpscale object.

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateTemporalUpscale (VkDevice device, XEG_TemporalUpscaleCreateInfo *pTemporalUpscaleInfo, XEG_TemporalUpscale *pTemporalUpscale)

Creates an XEG_TemporalUpscale object.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdRenderTemporalUpscale (VkCommandBuffer commandBuffer, XEG_TemporalUpscale temporalUpscale, XEG_TemporalUpscaleDescription *pDescription)

Records the AI temporal upscaling rendering command.

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroyTemporalUpscale (XEG_TemporalUpscale temporalUpscale)

Destroys an XEG_TemporalUpscale object.

Macro Definition

[h2]XEG_adaptive_vrs

#define XEG_adaptive_vrs   1

Description

Extension macro definition of adaptive VRS of XEngine.

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_ERROR_SENSITIVITY

#define XEG_ADAPTIVE_VRS_ERROR_SENSITIVITY   0x4U

Description

Sets the ERROR_SENSITIVITY parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the threshold for controlling the generation of the shading rate image. A larger value indicates a smaller average shading rate, that is, the performance is better but the image quality deteriorates. The recommended value range is [0, 1].

When this macro is used to set the ERROR_SENSITIVITY parameter through the HMS_XEG_AdaptiveVRSParameter API, param passed to the API must be a GLfloat pointer. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is optional, and the default value is 0.5.

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_EXTENSION_NAME

#define XEG_ADAPTIVE_VRS_EXTENSION_NAME   "XEG_adaptive_vrs"

Description

Extension name of adaptive VRS of XEngine.

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_FLIP

#define XEG_ADAPTIVE_VRS_FLIP   0x5U

Description

Sets the FLIP parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating whether to flip the image vertically.

When this macro is used to set the FLIP parameter through the HMS_XEG_AdaptiveVRSParameter API, param passed to the API must be a GLboolean pointer. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is optional, and the default value is false. The value true indicates to flip the image vertically, and the value false indicates not to flip the image vertically.

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_INPUT_REGION

#define XEG_ADAPTIVE_VRS_INPUT_REGION   0x2U

Description

Sets the INPUT_REGION parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the image region finally rendered by the rendering pipeline of the previous frame.

When this macro is used to set the INPUT_REGION parameter through the HMS_XEG_AdaptiveVRSParameter API, param passed to the API must be a GLuint array whose length is 4, which indicates the coordinates of the lower left corner and the width and height of the rendered image area, respectively. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is optional, and the default value is [0, 0, INPUT_SIZE[0], INPUT_SIZE[1]].

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_INPUT_SIZE

#define XEG_ADAPTIVE_VRS_INPUT_SIZE   0x1U

Description

Sets the INPUT_SIZE parameter of the HMS_XEG_AdaptiveVRSParameter API, indicating the image width and height finally rendered by the rendering pipeline of the previous frame.

When this macro is used to set the INPUT_SIZE parameter through the HMS_XEG_AdaptiveVRSParameter API, param passed to the API must be a GLsizei array whose length is 2. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is mandatory and must have the same width and height as inputColorImage of HMS_XEG_DispatchAdaptiveVRS.

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_TEXEL_SIZE

#define XEG_ADAPTIVE_VRS_TEXEL_SIZE   0x3U

Description

Sets the TEXEL_SIZE parameter of the HMS_XEG_AdaptiveVRSParameter API.

When this macro is used to set the TEXEL_SIZE parameter through the HMS_XEG_AdaptiveVRSParameter API, param passed to the API must be a GLsizei array whose length is 2, which indicates TEXEL_WIDTH and TEXEL_HEIGHT, respectively. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is optional, and the value can be [8, 8] or [16, 16]. The default value is [8, 8].

Since: 5.0.0(12)

[h2]XEG_ADAPTIVE_VRS_VERSION

#define XEG_ADAPTIVE_VRS_VERSION   1

Description

Extension version number of adaptive VRS of XEngine.

Since: 5.0.0(12)

[h2]XEG_EXTENSIONS

#define XEG_EXTENSIONS   0x01U

Description

Input parameter of the HMS_XEG_GetString API, which is used to obtain GLES extensions supported by XEngine.

Since: 5.0.0(12)

[h2]XEG_MAX_EXTENSION_NAME_SIZE

#define XEG_MAX_EXTENSION_NAME_SIZE   256

Description

Maximum length of the extension name supported by XEngine.

Since: 5.0.0(12)

[h2]XEG_neural_upscale

#define XEG_neural_upscale   1

Description

Extension macro definition of AI spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_NEURAL_UPSCALE_EXTENSION_NAME

#define XEG_NEURAL_UPSCALE_EXTENSION_NAME   "XEG_neural_upscale"

Description

Extension name of AI spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_NEURAL_UPSCALE_INPUT_HANDLE

#define XEG_NEURAL_UPSCALE_INPUT_HANDLE   0x4U

Description

Sets the OH_NativeBuffer handle associated with the upscaling input texture through the HMS_XEG_NeuralUpscaleParameter API.

When this macro is used to set the upscaling input parameter, the value of param passed to the API must be a valid OH_NativeBuffer handle corresponding to the inputTexture parameter passed to the HMS_XEG_RenderNeuralUpscale API. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is mandatory.

Since: 5.0.0(12)

[h2]XEG_NEURAL_UPSCALE_SCISSOR

#define XEG_NEURAL_UPSCALE_SCISSOR   0x1U

Description

Sets the cropping window parameter for upscaling through the HMS_XEG_NeuralUpscaleParameter API. The cropping window is used to determine the area for sampling the input image.

When this macro is used to set cropping window parameters, the value of param passed to the API must be an unsigned integer array with a length of 4. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. The values in the array are x, y, width, and height in sequence, where x and y determine the lower left corner of the cropping window, and width and height respectively determine the width and height of the cropping window. This parameter is optional, and the default value (0, 0, width of the input texture, height of the input texture) will be used if cropping window parameters are not set.

Since: 5.0.0(12)

[h2]XEG_NEURAL_UPSCALE_SHARPNESS

#define XEG_NEURAL_UPSCALE_SHARPNESS   0x2U

Description

Sets the sharpness parameter for upscaling through the HMS_XEG_NeuralUpscaleParameter API. The recommended value range of sharpness is [0, 1].

When this macro is used to set the sharpness parameter of upscaling, the value of param passed to the API must be a valid pointer pointing to a float value. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. This parameter is optional, and the default value 0.2 will be used if the sharpness parameter is not set.

Since: 5.0.0(12)

[h2]XEG_NEURAL_UPSCALE_VERSION

#define XEG_NEURAL_UPSCALE_VERSION   1

Description

Extension version number of AI spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_spatial_upscale

#define XEG_spatial_upscale   1

Description

Extension macro definition of GPU spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_SPATIAL_UPSCALE_EXTENSION_NAME

#define XEG_SPATIAL_UPSCALE_EXTENSION_NAME   "XEG_spatial_upscale"

Description

Extension name of GPU spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_SPATIAL_UPSCALE_SCISSOR

#define XEG_SPATIAL_UPSCALE_SCISSOR   0x1U

Description

Sets the SCISSOR parameter of the HMS_XEG_SpatialUpscaleParameter API.

When this macro is used to set the SCISSOR parameter through the HMS_XEG_SpatialUpscaleParameter API, the value of param passed to the API must be a pointer pointing to an unsigned integer array whose length is 4. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. The four values of SCISSOR are the x and y coordinates of the lower left corner and the width and height of the cropping window in sequence.

Since: 5.0.0(12)

[h2]XEG_SPATIAL_UPSCALE_SHARPNESS

#define XEG_SPATIAL_UPSCALE_SHARPNESS   0x2U

Description

Sets the SHARPNESS parameter of the HMS_XEG_SpatialUpscaleParameter API.

When this macro is used to set the SHARPNESS parameter through the HMS_XEG_SpatialUpscaleParameter API, the value of param passed to the API must be a pointer pointing to the float type. It is recommended that the value ranges from 0 to 1. Otherwise, undefined behavior will occur, for example, the rendering effect is incorrect or the program crashes. A larger value of SHARPNESS indicates a stronger sharpening effect. The sharpness needs to be adjusted for images of different styles. Otherwise, over-sharpening will occur, for example, the image has a lot of noises.

Since: 5.0.0(12)

[h2]XEG_SPATIAL_UPSCALE_VERSION

#define XEG_SPATIAL_UPSCALE_VERSION   1

Description

Extension version number of GPU spatial upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_temporal_upscale

#define XEG_temporal_upscale   1

Description

Extension macro definition of AI temporal upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_TEMPORAL_UPSCALE_EXTENSION_NAME

#define XEG_TEMPORAL_UPSCALE_EXTENSION_NAME   "XEG_temporal_upscale"

Description

Extension name of AI temporal upscaling of XEngine.

Since: 5.0.0(12)

[h2]XEG_TEMPORAL_UPSCALE_VERSION

#define XEG_TEMPORAL_UPSCALE_VERSION   1

Description

Extension version number of AI temporal upscaling of XEngine.

Since: 5.0.0(12)

Typedef

[h2]PFN_HMS_XEG_ADAPTIVEVRSPARAMETER

typedef void(GL_APIENTRYP PFN_HMS_XEG_ADAPTIVEVRSPARAMETER) (GLenum pname, GLvoid *param)

Description

Defines the function pointer for setting the input parameter of the adaptive variable rate shading (VRS).

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_ADAPTIVE_VRS_INPUT_SIZE, XEG_ADAPTIVE_VRS_INPUT_REGION, XEG_ADAPTIVE_VRS_TEXEL_SIZE, XEG_ADAPTIVE_VRS_ERROR_SENSITIVITY, or XEG_ADAPTIVE_VRS_FLIP.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.

[h2]PFN_HMS_XEG_APPLYADAPTIVEVRS

typedef void(GL_APIENTRYP PFN_HMS_XEG_APPLYADAPTIVEVRS) (GLuint shadingRateImage)

Description

Defines the function pointer for applying the shading rate image to the render target.

Since: 5.0.0(12)

Parameters:

Name

Description

shadingRateImage

Shading rate image obtained after computation and 0 means disables adaptive VRS.

[h2]PFN_HMS_XEG_CmdDispatchAdaptiveVRS

typedef void(VKAPI_PTR * PFN_HMS_XEG_CmdDispatchAdaptiveVRS) (VkCommandBuffer commandBuffer, XEG_AdaptiveVRS xegAdaptiveVRS, XEG_AdaptiveVRSDescription *pXegAdaptiveVRSDescription)

Description

Defines the function pointer for computing the adaptive VRS command.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

VkCommandBuffer of the current command, which must be submitted to vkQueueSubmit before being executed.

xegAdaptiveVRS

The XEG_AdaptiveVRS object that has been created.

pXegAdaptiveVRSDescription

Pointer to the parameter structure XEG_AdaptiveVRSDescription of the delivering command. Its value cannot be null.

[h2]PFN_HMS_XEG_CmdRenderSpatialUpscale

typedef void(VKAPI_PTR * PFN_HMS_XEG_CmdRenderSpatialUpscale) (VkCommandBuffer commandBuffer, XEG_SpatialUpscale xegSpatialUpscale, XEG_SpatialUpscaleDescription *pXegSpatialUpscaleDescription)

Description

Defines the function pointer for executing the GPU spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

VkCommandBuffer of the current command, which must be submitted to vkQueueSubmit before being executed.

xegSpatialUpscale

The XEG_SpatialUpscale object that has been created.

pXegSpatialUpscaleDescription

Pointer to the parameter structure XEG_SpatialUpscaleDescription of the rendering command. Its value cannot be null.

[h2]PFN_HMS_XEG_CmdRenderTemporalUpscale

typedef void(VKAPI_ATTR * PFN_HMS_XEG_CmdRenderTemporalUpscale) (VkCommandBuffer commandBuffer, XEG_TemporalUpscale temporalUpscale, XEG_TemporalUpscaleDescription *pDescription)

Description

Defines the function pointer for recording the AI temporal upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

Vulkan command buffer object, which must be of the primary type.

temporalUpscale

The XEG_TemporalUpscale object that has been created.

pDescription

Pointer to the upscaling rendering input information structure XEG_TemporalUpscaleDescription. Its value cannot be null.

[h2]PFN_HMS_XEG_CreateAdaptiveVRS

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_CreateAdaptiveVRS) (VkDevice device, const XEG_AdaptiveVRSCreateInfo *pXegAdaptiveVRSCreateInfo, XEG_AdaptiveVRS *pXegAdaptiveVRS)

Description

Defines the function pointer for creating an XEG_AdaptiveVRS object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pXegAdaptiveVRSCreateInfo

Pointer to the structure XEG_AdaptiveVRSCreateInfo. Its value cannot be null.

pXegAdaptiveVRS

Pointer to the handle. The created XEG_AdaptiveVRS is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]PFN_HMS_XEG_CreateSpatialUpscale

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_CreateSpatialUpscale) (VkDevice device, const XEG_SpatialUpscaleCreateInfo *pXegSpatialUpscaleCreateInfo, XEG_SpatialUpscale *pXegSpatialUpscale)

Description

Defines the function pointer for creating an XEG_SpatialUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pXegSpatialUpscaleCreateInfo

Pointer to the structure XEG_SpatialUpscaleCreateInfo. Its value cannot be null.

pXegSpatialUpscale

Pointer to the handle. The created XEG_SpatialUpscale is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]PFN_HMS_XEG_CreateTemporalUpscale

typedef VkResult(VKAPI_ATTR * PFN_HMS_XEG_CreateTemporalUpscale) (VkDevice device, XEG_TemporalUpscaleCreateInfo *pTemporalUpscaleInfo, XEG_TemporalUpscale *pTemporalUpscale)

Description

Defines the function pointer for creating an XEG_TemporalUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pTemporalUpscaleInfo

Pointer to the upscaling creation information structure XEG_TemporalUpscaleCreateInfo. Its value cannot be null.

pTemporalUpscale

Pointer to the handle. The created XEG_TemporalUpscale is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]PFN_HMS_XEG_DestroyAdaptiveVRS

typedef void(VKAPI_PTR * PFN_HMS_XEG_DestroyAdaptiveVRS) (XEG_AdaptiveVRS xegAdaptiveVRS)

Description

Defines the function pointer for destroying an XEG_AdaptiveVRS object.

Since: 5.0.0(12)

Parameters:

Name

Description

xegAdaptiveVRS

The XEG_AdaptiveVRS object that has been created.

[h2]PFN_HMS_XEG_DestroySpatialUpscale

typedef void(VKAPI_PTR * PFN_HMS_XEG_DestroySpatialUpscale) (XEG_SpatialUpscale xegSpatialUpscale)

Description

Defines the function pointer for destroying an XEG_SpatialUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

xegSpatialUpscale

The XEG_SpatialUpscale object that has been created.

[h2]PFN_HMS_XEG_DestroyTemporalUpscale

typedef void(VKAPI_ATTR * PFN_HMS_XEG_DestroyTemporalUpscale) (XEG_TemporalUpscale temporalUpscale)

Description

Defines the function pointer for destroying an XEG_TemporalUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

temporalUpscale

The XEG_TemporalUpscale object to destroy.

[h2]PFN_HMS_XEG_DISPATCHADAPTIVEVRS

typedef void(GL_APIENTRYP PFN_HMS_XEG_DISPATCHADAPTIVEVRS) (GLfloat *reprojectionMatrix, GLuint inputColorImage, GLuint inputDepthImage, GLuint shadingRateImage)

Description

Defines the function pointer for computing the shading rate image.

Since: 5.0.0(12)

Parameters:

Name

Description

reprojectionMatrix

Pointer to the result matrix of the computation between the current frame and the previous frame. The computation formula is as follows: (Projection matrix of the previous frame x Observation matrix of the previous frame) x (Inverse matrix of (Projection matrix of the current frame x Observation matrix of the current frame)). The matrix must be a 4 x 4 column major-order matrix. This parameter is optional, the image quality is better when it is not empty.

inputColorImage

Texture ID of the color attachment containing the final rendering result of the rendering pipeline of the previous frame.

inputDepthImage

Texture ID of the depth attachment containing the rendering result of the rendering pipeline of the current frame.

shadingRateImage

Texture ID used to generate the shading rate image information, which needs to be created and entered by the user.

[h2]PFN_HMS_XEG_EnumerateDeviceExtensionProperties

typedef VkResult(VKAPI_PTR * PFN_HMS_XEG_EnumerateDeviceExtensionProperties) (VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, XEG_ExtensionProperties *pProperties)

Description

Defines the function pointer of the Vulkan API for querying extensions of XEngine.

Since: 5.0.0(12)

Parameters:

Name

Description

physicalDevice

Current Vulkan physical device.

pPropertyCount

Number of queried or passed extensions. If pProperties is nullptr, the number of currently supported XEngine extensions is returned. If the passed propertyCount is greater than or equal to the number of actually supported XEngine extensions, the query information is returned through the pProperties API and the return result is VK_SUCCESS. If the passed propertyCount is less than the number of actually supported XEngine extensions, the query information is returned through the pProperties API and the return result is VK_INCOMPLETE.

pProperties

Queried XEngine extensions, which are returned through the XEG_ExtensionProperties pointer of the structure.

Returns:

Result code of the VkResult type. If the query is successful, VK_SUCCESS is returned. If pProperties is not nullptr and the passed propertyCount is less than the number of actually supported XEngine extensions, VK_INCOMPLETE is returned, indicating that the queried features are incomplete.

[h2]PFN_HMS_XEG_GETSTRING

typedef const GLubyte*(GL_APIENTRYP PFN_HMS_XEG_GETSTRING) (GLenum name)

Description

Defines the function pointer of the GLES API for querying extensions of XEngine.

Since: 5.0.0(12)

Parameters:

Name

Description

name

Enumerated name of the input parameter. The value can be XEG_EXTENSIONS.

Returns:

If the parameter is XEG_EXTENSIONS, a list of extensions supported by XEngine is returned. Multiple extensions are separated by spaces. Note that the extension name does not contain any space. If the query fails, null pointer is returned.

[h2]PFN_HMS_XEG_NEURALUPSCALEPARAMETER

typedef void(GL_APIENTRYP PFN_HMS_XEG_NEURALUPSCALEPARAMETER) (GLenum pname, GLvoid *param)

Description

Defines the function pointer for setting the AI spatial upscaling input parameter.

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_NEURAL_UPSCALE_SCISSOR, XEG_NEURAL_UPSCALE_SHARPNESS, or XEG_NEURAL_UPSCALE_INPUT_HANDLE.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.

[h2]PFN_HMS_XEG_RENDERNEURALUPSCALE

typedef void(GL_APIENTRYP PFN_HMS_XEG_RENDERNEURALUPSCALE) (GLuint inputTexture)

Description

Defines the function pointer for executing the AI spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

inputTexture

The input texture. The texture type must be GL_TEXTURE_2D, and there is only 1 mipLevel. The valid value range of the input image width is [448, 1728], Otherwise, the AI inference result may be incorrect. The input texture must be created by OH_NativeBuffer. Before calling this API, you need to set the handle corresponding to OH_NativeBuffer as the upscaling input parameter. For details, see the HMS_XEG_NeuralUpscaleParameter API.

[h2]PFN_HMS_XEG_RENDERSPATIALUPSCALE

typedef void(GL_APIENTRYP PFN_HMS_XEG_RENDERSPATIALUPSCALE) (GLuint inputTexture)

Description

Defines the function pointer for executing the GPU spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

inputTexture

Input texture. The texture type must be GL_TEXTURE_2D, and there is only 1 mipLevel. The texture must be created before this API is called. Otherwise, the rendering will fail, for example, a black screen occurs.

[h2]PFN_HMS_XEG_SPATIALUPSCALEPARAMETER

typedef void(GL_APIENTRYP PFN_HMS_XEG_SPATIALUPSCALEPARAMETER) (GLenum pname, GLvoid *param)

Description

Defines the function pointer for setting the GPU spatial upscaling input parameter.

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_SPATIAL_UPSCALE_SCISSOR or XEG_SPATIAL_UPSCALE_SHARPNESS.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.

[h2]XEG_AdaptiveVRS

VK_DEFINE_HANDLE(XEG_AdaptiveVRS)

Description

XEG_AdaptiveVRS handle.

Since: 5.0.0(12)

[h2]XEG_AdaptiveVRSCreateInfo

typedef struct XEG_AdaptiveVRSCreateInfo XEG_AdaptiveVRSCreateInfo

Description

This structure describes the parameter information for creating an XEG_AdaptiveVRS object. When the information in the structure changes, a new XEG_AdaptiveVRS object needs to be created.

Since: 5.0.0(12)

[h2]XEG_AdaptiveVRSDescription

typedef struct XEG_AdaptiveVRSDescription XEG_AdaptiveVRSDescription

Description

This structure describes the parameter information required for delivering the command for drawing the shading rate texture. The information needs to be updated for each frame.

Since: 5.0.0(12)

[h2]XEG_ExtensionProperties

typedef struct XEG_ExtensionProperties XEG_ExtensionProperties

Description

This structure describes the set of XEngine extensions queried through the HMS_XEG_EnumerateDeviceExtensionProperties API.

Since: 5.0.0(12)

[h2]XEG_SpatialUpscale

VK_DEFINE_HANDLE(XEG_SpatialUpscale)

Description

Handle to XEG_SpatialUpscale.

Since: 5.0.0(12)

[h2]XEG_SpatialUpscaleCreateInfo

typedef struct XEG_SpatialUpscaleCreateInfo XEG_SpatialUpscaleCreateInfo

Description

This structure describes the information for creating an XEG_SpatialUpscale object. When the information in the structure changes, a new XEG_SpatialUpscale object needs to be created.

Since: 5.0.0(12)

[h2]XEG_SpatialUpscaleDescription

typedef struct XEG_SpatialUpscaleDescription XEG_SpatialUpscaleDescription

Description

This structure describes the image information required for delivering the GPU spatial upscaling rendering command.

Since: 5.0.0(12)

[h2]XEG_TemporalUpscale

VK_DEFINE_HANDLE(XEG_TemporalUpscale)

Description

Handle to XEG_TemporalUpscale.

Since: 5.0.0(12)

[h2]XEG_TemporalUpscaleCreateInfo

typedef struct XEG_TemporalUpscaleCreateInfo XEG_TemporalUpscaleCreateInfo

Description

This structure describes the information for creating an XEG_TemporalUpscale object. When the information in the structure changes, a new XEG_TemporalUpscale object needs to be created.

Since: 5.0.0(12)

[h2]XEG_TemporalUpscaleDescription

typedef struct XEG_TemporalUpscaleDescription XEG_TemporalUpscaleDescription

Description

This structure describes the input information for delivering AI temporal upscaling rendering command.

Since: 5.0.0(12)

Function

[h2]HMS_XEG_AdaptiveVRSParameter()

GL_APICALL void GL_APIENTRY HMS_XEG_AdaptiveVRSParameter (GLenum pname, GLvoid * param)

Description

Sets parameters of the adaptive VRS.

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_ADAPTIVE_VRS_INPUT_SIZE, XEG_ADAPTIVE_VRS_INPUT_REGION, XEG_ADAPTIVE_VRS_TEXEL_SIZE, XEG_ADAPTIVE_VRS_ERROR_SENSITIVITY, or XEG_ADAPTIVE_VRS_FLIP.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.

[h2]HMS_XEG_ApplyAdaptiveVRS()

GL_APICALL void GL_APIENTRY HMS_XEG_ApplyAdaptiveVRS (GLuint shadingRateImage)

Description

Applies the shading rate image to the render target.

Since: 5.0.0(12)

Parameters:

Name

Description

shadingRateImage

Shading rate image obtained after computation and 0 means disables adaptive VRS.

[h2]HMS_XEG_CmdDispatchAdaptiveVRS()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdDispatchAdaptiveVRS (VkCommandBuffer cmdBuffer, XEG_AdaptiveVRS xegAdaptiveVRS, XEG_AdaptiveVRSDescription * pXegAdaptiveVRSDescription)

Description

Executes the command for computing the adaptive VRS.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

VkCommandBuffer of the current command, which must be submitted to vkQueueSubmit before being executed.

xegAdaptiveVRS

The XEG_AdaptiveVRS object that has been created.

pXegAdaptiveVRSDescription

Pointer to the parameter structure XEG_AdaptiveVRSDescription of the delivering command. Its value cannot be null.

[h2]HMS_XEG_CmdRenderSpatialUpscale()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdRenderSpatialUpscale (VkCommandBuffer commandBuffer, XEG_SpatialUpscale xegSpatialUpscale, XEG_SpatialUpscaleDescription * pXegSpatialUpscaleDescription)

Description

Executes the GPU spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

VkCommandBuffer of the current command, which must be submitted to vkQueueSubmit before being executed.

xegSpatialUpscale

The XEG_SpatialUpscale object that has been created.

pXegSpatialUpscaleDescription

Pointer to the parameter structure XEG_SpatialUpscaleDescription of the rendering command. Its value cannot be null.

[h2]HMS_XEG_CmdRenderTemporalUpscale()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_CmdRenderTemporalUpscale (VkCommandBuffer commandBuffer, XEG_TemporalUpscale temporalUpscale, XEG_TemporalUpscaleDescription * pDescription)

Description

Records the AI temporal upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

commandBuffer

Vulkan command buffer object, which must be of the primary type.

temporalUpscale

The XEG_TemporalUpscale object that has been created.

pDescription

Pointer to the upscaling rendering input information structure XEG_TemporalUpscaleDescription. Its value cannot be null.

[h2]HMS_XEG_CreateAdaptiveVRS()

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateAdaptiveVRS (VkDevice device, XEG_AdaptiveVRSCreateInfo * pXegAdaptiveVRSCreateInfo, XEG_AdaptiveVRS * pXegAdaptiveVRS)

Description

Creates an XEG_AdaptiveVRS object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pXegAdaptiveVRSCreateInfo

Pointer to the structure XEG_AdaptiveVRSCreateInfo. Its value cannot be null.

pXegAdaptiveVRS

Pointer to the handle. The created XEG_AdaptiveVRS is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]HMS_XEG_CreateSpatialUpscale()

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateSpatialUpscale (VkDevice device, const XEG_SpatialUpscaleCreateInfo * pXegSpatialUpscaleCreateInfo, XEG_SpatialUpscale * pXegSpatialUpscale)

Description

Creates an XEG_SpatialUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pXegSpatialUpscaleCreateInfo

Pointer to the structure XEG_SpatialUpscaleCreateInfo. Its value cannot be null.

pXegSpatialUpscale

Pointer to the handle. The created XEG_SpatialUpscale is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]HMS_XEG_CreateTemporalUpscale()

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_CreateTemporalUpscale (VkDevice device, XEG_TemporalUpscaleCreateInfo * pTemporalUpscaleInfo, XEG_TemporalUpscale * pTemporalUpscale)

Description

Creates an XEG_TemporalUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

device

Must be the VkDevice in use.

pTemporalUpscaleInfo

Pointer to the upscaling creation information structure XEG_TemporalUpscaleCreateInfo. Its value cannot be null.

pTemporalUpscale

Pointer to the handle. The created XEG_TemporalUpscale is returned in this handle.

Returns:

Returns an error code of the VkResult type. VK_SUCCESS indicates successful execution.

[h2]HMS_XEG_DestroyAdaptiveVRS()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroyAdaptiveVRS (XEG_AdaptiveVRS xegAdaptiveVRS)

Description

Destroys an XEG_AdaptiveVRS object.

Since: 5.0.0(12)

Parameters:

Name

Description

xegAdaptiveVRS

The XEG_AdaptiveVRS object that has been created.

[h2]HMS_XEG_DestroySpatialUpscale()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroySpatialUpscale (XEG_SpatialUpscale xegSpatialUpscale)

Description

Destroys an XEG_SpatialUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

xegSpatialUpscale

The XEG_SpatialUpscale object that has been created.

[h2]HMS_XEG_DestroyTemporalUpscale()

VKAPI_ATTR void VKAPI_CALL HMS_XEG_DestroyTemporalUpscale (XEG_TemporalUpscale temporalUpscale)

Description

Destroys an XEG_TemporalUpscale object.

Since: 5.0.0(12)

Parameters:

Name

Description

temporalUpscale

The XEG_TemporalUpscale object to destroy.

[h2]HMS_XEG_DispatchAdaptiveVRS()

GL_APICALL void GL_APIENTRY HMS_XEG_DispatchAdaptiveVRS (GLfloat * reprojectionMatrix, GLuint inputColorImage, GLuint inputDepthImage, GLuint shadingRateImage)

Description

Computes the shading rate image.

Since: 5.0.0(12)

Parameters:

Name

Description

reprojectionMatrix

Pointer to the result matrix of the computation between the current frame and the previous frame. The computation formula is as follows: (Projection matrix of the previous frame x Observation matrix of the previous frame) x (Inverse matrix of (Projection matrix of the current frame x Observation matrix of the current frame)). The matrix must be a 4 x 4 column major-order matrix. This parameter is optional, the image quality is better when it is not empty.

inputColorImage

Texture ID of the color attachment containing the final rendering result of the rendering pipeline of the previous frame.

inputDepthImage

Texture ID of the depth attachment containing the rendering result of the rendering pipeline of the current frame.

shadingRateImage

Texture ID used to generate the shading rate image information, which needs to be created and entered by the user.

[h2]HMS_XEG_EnumerateDeviceExtensionProperties()

VKAPI_ATTR VkResult VKAPI_CALL HMS_XEG_EnumerateDeviceExtensionProperties (VkPhysicalDevice physicalDevice, uint32_t * pPropertyCount, XEG_ExtensionProperties * pProperties)

Description

Vulkan API for querying extensions of XEngine.

Since: 5.0.0(12)

Parameters:

Name

Description

physicalDevice

Current Vulkan physical device.

pPropertyCount

Number of queried or passed extensions. If pProperties is nullptr, the number of currently supported XEngine extensions is returned. If the passed propertyCount is greater than or equal to the number of actually supported XEngine extensions, the query information is returned through the pProperties API and the return result is VK_SUCCESS. If the passed propertyCount is less than the number of actually supported XEngine extensions, the query information is returned through the pProperties API and the return result is VK_INCOMPLETE.

pProperties

Queried XEngine extensions, which are returned through the XEG_ExtensionProperties pointer of the structure.

Returns:

Result code of the VkResult type. If the query is successful, VK_SUCCESS is returned. If pProperties is not nullptr and the passed propertyCount is less than the number of actually supported XEngine extensions, VK_INCOMPLETE is returned, indicating that the queried features are incomplete.

[h2]HMS_XEG_GetString()

const GLubyte* HMS_XEG_GetString (GLenum name)

Description

GLES API for querying extensions of XEngine.

Since: 5.0.0(12)

Parameters:

Name

Description

name

Enumerated name of the input parameter. The value can be XEG_EXTENSIONS.

Returns:

If the parameter is XEG_EXTENSIONS, a list of extensions supported by XEngine is returned. Multiple extensions are separated by spaces. Note that the extension name does not contain any space. If the query fails, null pointer is returned.

[h2]HMS_XEG_NeuralUpscaleParameter()

GL_APICALL void GL_APIENTRY HMS_XEG_NeuralUpscaleParameter (GLenum pname, GLvoid * param)

Description

Sets the AI spatial upscaling input parameter.

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_NEURAL_UPSCALE_SCISSOR, XEG_NEURAL_UPSCALE_SHARPNESS, or XEG_NEURAL_UPSCALE_INPUT_HANDLE.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.

[h2]HMS_XEG_RenderNeuralUpscale()

GL_APICALL void GL_APIENTRY HMS_XEG_RenderNeuralUpscale (GLuint inputTexture)

Description

Executes the AI spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

inputTexture

The input texture. The texture type must be GL_TEXTURE_2D, and there is only 1 mipLevel. The valid value range of the input image width is [448, 1728], Otherwise, the AI inference result may be incorrect. The input texture must be created by OH_NativeBuffer. Before calling this API, you need to set the handle corresponding to OH_NativeBuffer as the upscaling input parameter. For details, see the HMS_XEG_NeuralUpscaleParameter API.

[h2]HMS_XEG_RenderSpatialUpscale()

GL_APICALL void GL_APIENTRY HMS_XEG_RenderSpatialUpscale (GLuint inputTexture)

Description

Executes the GPU spatial upscaling rendering command.

Since: 5.0.0(12)

Parameters:

Name

Description

inputTexture

Input texture. The texture type must be GL_TEXTURE_2D, and there is only 1 mipLevel. The texture must be created before this API is called. Otherwise, the rendering will fail, for example, a black screen occurs.

[h2]HMS_XEG_SpatialUpscaleParameter()

GL_APICALL void GL_APIENTRY HMS_XEG_SpatialUpscaleParameter (GLenum pname, GLvoid * param)

Description

Sets the GPU spatial upscaling input parameter.

Since: 5.0.0(12)

Parameters:

Name

Description

pname

Enumerated name of the input parameter. The value can be XEG_SPATIAL_UPSCALE_SCISSOR or XEG_SPATIAL_UPSCALE_SHARPNESS.

param

Input parameter value. For details, see the description of the enumerated names of the input parameters.