目录

GraphicsAccelerate

Overview

The module provides APIs related to the graphics rendering acceleration capabilities of Graphics Accelerate Kit.

System capability: SystemCapability.GraphicsGame.RenderAccelerate

Start version: 5.0.0(12)

Summary

[h2]Files

Name

Description

abr_base.h

Declares ABR APIs used for different graphics APIs.

abr_gles.h

Declares ABR APIs used for the OpenGL ES graphics API.

frame_generation_base.h

Declares frame generation APIs used for different graphics APIs.

frame_generation_gles.h

Declares frame generation APIs used for the OpenGL ES graphics API.

frame_generation_vk.h

Declares frame generation APIs used for the Vulkan graphics API.

opengtx_base.h

Declares OpenGTX APIs used for both the OpenGL ES and Vulkan graphics APIs.

[h2]Structs

Name

Description

struct ABR_Vector3

Describes an ABR 3D vector.

struct ABR_CameraData

Describes the camera motion data of a game app's each frame. The ABR capability adaptively adjusts the buffer resolution factor according to the camera motion data.

struct FG_Mat4x4

Describes a 4x4 matrix in column-major order.

struct FG_AlgorithmModeInfo

Describes the frame generation algorithm mode information.

struct FG_Dimension2D

Describes the 2D image resolution, in pixels.

struct FG_ResolutionInfo

Describes the resolutions of input and output images for frame generation.

struct FG_Vec3D

Describes a frame generation 3D vector.

struct FG_PerFrameExtendedCameraInfo

Describes extended camera information. When the translation component of the view projection matrix is very large, more detailed camera information can be provided for more accurate frame prediction.

struct FG_DispatchDescription_GLES

Describes the parameter information required by HMS_FG_Dispatch_GLES. The parameter information needs to be updated for each frame. This API applies only to the OpenGL ES graphics API.

struct FG_ContextDescription_VK

Describes the attribute information required for creating a frame generation context instance FG_Context_VK.

struct FG_ImageFormat_VK

Describes the input and output image format information for frame generation. This API applies only to the Vulkan graphics API.

struct FG_ImageSync_VK

Describes the synchronization status information about the input and output images for frame generation. It is used to create a memory barrier for the images. This API applies only to the Vulkan graphics API.

struct FG_ImageInfo_VK

Describes the input and output image information for frame generation. This API applies only to the Vulkan graphics API.

struct FG_DispatchDescription_VK

Describes the parameter information required by HMS_FG_Dispatch_VK. The parameter information needs to be updated for each frame. This API applies only to the Vulkan graphics API.

struct OpenGTX_ConfigDescription

Describes the OpenGTX attribute settings.

struct OpenGTX_GameSceneInfo

Describes the game scene information. This struct is passed by a game app after obtaining the scene information.

struct OpenGTX_FrameRenderInfo

Describes the frame rendering information. This struct is passed by a game app after obtaining the frame attributes.

struct OpenGTX_NetworkInfo

Describes the current device network information. This struct is passed by a game app after obtaining the network information.

struct OpenGTX_ResolutionValue

Describes the resolution of a game app.

struct OpenGTX_Vector3

Describes an OpenGTX 3D vector.

struct OpenGTX_NetworkLatency

Describes the current device network latency information. This struct is passed by a game app after obtaining the network latency information.

[h2]Type Definitions

Name

Description

typedef struct ABR_Context ABR_Context

Describes the ABR context.

typedef enum ABR_RenderAPI_Type ABR_RenderAPI_Type

Describes the graphics API types supported by the ABR capability.

typedef struct ABR_Vector3 ABR_Vector3

Describes an ABR 3D vector.

typedef struct ABR_CameraData ABR_CameraData

Describes the camera motion data of a game app's each frame. The ABR capability adaptively adjusts the buffer resolution factor according to the camera motion data.

typedef enum ABR_ErrorCode ABR_ErrorCode

Describes the error codes of ABR API calls.

typedef struct FG_Mat4x4 FG_Mat4x4

Describes a 4x4 matrix in column-major order.

typedef enum FG_PredictionMode FG_PredictionMode

Describes the frame prediction algorithm modes for frame generation.

typedef enum FG_MeMode FG_MeMode

Describes the motion estimation algorithm modes. The basic mode and enhanced mode are supported.

typedef struct FG_AlgorithmModeInfo FG_AlgorithmModeInfo

Describes the frame generation algorithm mode information.

typedef struct FG_Vec3D FG_Vec3D

Describes a frame generation 3D vector.

typedef struct FG_PerFrameExtendedCameraInfo FG_PerFrameExtendedCameraInfo

Describes extended camera information. When the translation component of the view projection matrix is very large, more detailed camera information can be provided for more accurate frame prediction.

typedef enum FG_ErrorCode FG_ErrorCode

Describes the error codes of frame generation API calls.

typedef enum FG_CvvZSemantic FG_CvvZSemantic

Describes the homogeneous clip space Z/W ranges and depth functions after camera projection transformation.

typedef struct FG_Dimension2D FG_Dimension2D

Describes the 2D image resolution, in pixels.

typedef struct FG_ResolutionInfo FG_ResolutionInfo

Describes the resolutions of input and output images for frame generation.

typedef struct FG_Context_GLES FG_Context_GLES

Describes the frame generation context. This API applies only to the OpenGL ES graphics API.

typedef struct FG_DispatchDescription_GLES FG_DispatchDescription_GLES

Describes the parameter information required by HMS_FG_Dispatch_GLES. The parameter information needs to be updated for each frame. This API applies only to the OpenGL ES graphics API.

typedef enum FG_ImageFormat_GLES FG_ImageFormat_GLES

Describes the image formats of the real frame color buffer and the predicted frame buffer. This API applies only to the OpenGL ES graphics API.

typedef struct FG_Context_VK FG_Context_VK

Describes the frame generation context. This API applies only to the Vulkan graphics API.

typedef struct FG_Image_VK FG_Image_VK

Describes the input and output images for frame generation. This API applies only to the Vulkan graphics API.

typedef struct FG_ContextDescription_VK FG_ContextDescription_VK

Describes the attribute information required for creating a frame generation context instance FG_Context_VK.

typedef struct FG_ImageFormat_VK FG_ImageFormat_VK

Describes the input and output image format information for frame generation. This API applies only to the Vulkan graphics API.

typedef struct FG_ImageSync_VK FG_ImageSync_VK

Describes the synchronization status information about the input and output images for frame generation. It is used to create a memory barrier for the images. This API applies only to the Vulkan graphics API.

typedef struct FG_ImageInfo_VK FG_ImageInfo_VK

Describes the input and output image information for frame generation. This API applies only to the Vulkan graphics API.

typedef struct FG_DispatchDescription_VK FG_DispatchDescription_VK

Describes the parameter information required by HMS_FG_Dispatch_VK. The parameter information needs to be updated for each frame. This API applies only to the Vulkan graphics API.

typedef enum OpenGTX_ErrorCode OpenGTX_ErrorCode

Describes the error codes of OpenGTX API calls.

typedef enum OpenGTX_LTPO_Mode OpenGTX_LTPO_Mode

Describes the OpenGTX_LTPO modes for controlling the game frame rate.

typedef enum OpenGTX_EngineType OpenGTX_EngineType

Describes the underlying game engine types used by game apps.

typedef enum OpenGTX_GameType OpenGTX_GameType

Describes the game types.

typedef enum OpenGTX_SceneID OpenGTX_SceneID

Describes the OpenGTX game scene types.

typedef enum OpenGTX_PictureQualityMaxLevel OpenGTX_PictureQualityMaxLevel

Describes the game app image quality levels.

typedef enum OpenGTX_TempLevel OpenGTX_TempLevel

Describes the device temperature levels.

typedef struct OpenGTX_Context OpenGTX_Context

Describes the OpenGTX context.

typedef struct OpenGTX_ConfigDescription OpenGTX_ConfigDescription

Describes the OpenGTX attribute settings.

typedef struct OpenGTX_GameSceneInfo OpenGTX_GameSceneInfo

Describes the game scene information. This struct is passed by a game app after obtaining the scene information.

typedef struct OpenGTX_FrameRenderInfo OpenGTX_FrameRenderInfo

Describes the frame rendering information. This struct is passed by a game app after obtaining the frame attributes.

typedef struct OpenGTX_NetworkInfo OpenGTX_NetworkInfo

Describes the current device network information. This struct is passed by a game app after obtaining the network information.

typedef struct OpenGTX_ResolutionValue OpenGTX_ResolutionValue

Describes the resolution of a game app.

typedef struct OpenGTX_Vector3 OpenGTX_Vector3

Describes an OpenGTX 3D vector.

typedef struct OpenGTX_NetworkLatency OpenGTX_NetworkLatency

Describes the current device network latency information. This struct is passed by a game app after obtaining the network latency information.

typedef void(* OpenGTX_DeviceInfoCallback) (OpenGTX_TempLevel)

Callback for device temperature information.

[h2]Enumerations

Name

Description

ABR_RenderAPI_Type {

RENDER_API_GLES = 0

}

Describes the graphics API types supported by the ABR capability.

ABR_ErrorCode {

ABR_SUCCESS = 0,

ABR_INVALID_PARAMETER = 401,

ABR_CONTEXT_CONFIG_AFTER_ACTIVE = 1009501001,

ABR_CONTEXT_NOT_CONFIG = 1009501002,

ABR_CONTEXT_NOT_ACTIVE = 1009501003,

ABR_METADATA_INVALID = 1009501004,

ABR_FRAMEBUFFER_INVALID = 1009501005

}

Describes the error codes of ABR API calls.

FG_PredictionMode {

FG_PREDICTION_MODE_INTERPOLATION = 0,

FG_PREDICTION_MODE_EXTRAPOLATION = 1

}

Describes the frame prediction algorithm modes for frame generation.

FG_MeMode {

FG_ME_MODE_BASIC = 0,

FG_ME_MODE_ENHANCED = 1

}

Describes the motion estimation algorithm modes. The basic mode and enhanced mode are supported.

FG_ErrorCode {

FG_SUCCESS = 0,

FG_INVALID_PARAMETER = 401,

FG_CONTEXT_NOT_CONFIG = 1009500001,

FG_CONTEXT_NOT_ACTIVE = 1009500002,

FG_COLLECTING_PREVIOUS_FRAMES = 1009500003

}

Describes the error codes of frame generation API calls.

FG_CvvZSemantic {

FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z = 0,

FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_REVERSE_Z = 1,

FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_REVERSE_Z = 2,

FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_FORWARD_Z = 3 }

Describes the homogeneous clip space Z/W ranges and depth functions after camera projection transformation.

FG_ImageFormat_GLES {

FG_FORMAT_R8G8B8A8_UNORM = 0,

FG_FORMAT_R11G11B10_SFLOAT = 1,

FG_FORMAT_R16G16B16A16_SFLOAT = 2

}

Describes the image formats of the real frame color buffer and the predicted frame buffer. This API applies only to the OpenGL ES graphics API.

OpenGTX_ErrorCode {

OPENGTX_SUCCESS = 0,

OPENGTX_INVALID_PARAMETER = 401,

OPENGTX_CONTEXT_NOT_CONFIG = 1009502001,

OPENGTX_CONTEXT_NOT_ACTIVE = 1009502002

}

Describes the error codes of OpenGTX API calls.

OpenGTX_LTPO_Mode {

SCENE_MODE = 0x0001,

TOUCH_MODE = 0x0010,

ADAPTIVE_MODE = 0x0100

}

Describes the OpenGTX_LTPO modes for controlling the game frame rate.

OpenGTX_EngineType {

UNITY = 1,

UNREAL = 2,

MESSIAH = 3,

COCOS = 4,

OTHERS_ENGINE = 100

}

Describes the underlying game engine types used by game apps.

OpenGTX_GameType {

MOBA = 1,

RPG = 2,

FPS = 3,

RAC = 4,

OTHERS_TYPE = 100

}

Describes the game types.

OpenGTX_SceneID {

LOGIN = 1,

GAME_INTERFACE = 2,

LOADING = 3,

PLAYING = 4,

SPECTATOR = 5,

DEATH = 6,

HEAVY_LOAD = 7,

OTHERS_SCENE = 100

}

Describes the OpenGTX game scene types.

OpenGTX_PictureQualityMaxLevel {

SD = 1,

HD = 2,

FHD = 3,

QHD = 4,

UHD = 5

}

Describes the game app image quality levels.

OpenGTX_TempLevel {

TEMP_LEVEL1 = 1,

TEMP_LEVEL2 = 2,

TEMP_LEVEL3 = 3,

TEMP_LEVEL4 = 4,

TEMP_LEVEL5 = 5,

TEMP_LEVEL6 = 6

}

Describes the device temperature levels.

[h2]Functions

Name

Description

ABR_Context* HMS_ABR_CreateContext(ABR_RenderAPI_Type type)

Creates an ABR context instance. Each time this API is successfully called, an ABR_Context object is created and a pointer to the ABR_Context object is returned.

ABR_ErrorCode HMS_ABR_SetTargetFps(ABR_Context* context, const uint32_t targetFps)

Sets the target frame rate of an ABR context instance.

ABR_ErrorCode HMS_ABR_SetScaleRange(ABR_Context* context, const float minValue, const float maxValue)

Sets the buffer resolution factor range of an ABR context instance.

ABR_ErrorCode HMS_ABR_Activate(ABR_Context* context)

Activates an ABR context instance. Before the activation, the HMS_ABR_SetTargetFps and HMS_ABR_SetScaleRange APIs must be called to set instance attributes.

ABR_ErrorCode HMS_ABR_IsActive(ABR_Context* context, bool* isActive)

Checks whether an ABR context instance is activated.

ABR_ErrorCode HMS_ABR_Deactivate(ABR_Context* context)

Deactivates an ABR context instance. To activate the instance again, call the HMS_ABR_Activate API.

ABR_ErrorCode HMS_ABR_UpdateCameraData(ABR_Context* context, ABR_CameraData* data)

Updates the camera motion data of each frame. Before the update, the HMS_ABR_Activate API must be called to activate the ABR context instance.

ABR_ErrorCode HMS_ABR_GetScale(ABR_Context* context, float* scale)

Obtains the buffer resolution factor for adaptive resolution adjustment.

ABR_ErrorCode HMS_ABR_GetNextScale(ABR_Context* context, float* scale)

Obtains the ABR buffer resolution factor of the next frame.

ABR_ErrorCode HMS_ABR_DestroyContext(ABR_Context** context)

Destroys an ABR context instance and releases memory resources.

ABR_ErrorCode HMS_ABR_MarkFrameBuffer_GLES(ABR_Context* context)

Marks a GLES buffer for adaptive rendering. This API must be called before the rendering is started.

ABR_ErrorCode HMS_ABR_GetScaledTexture_GLES(ABR_Context* context, uint32_t originTexture, uint32_t* scaledTexture)

Obtains the GLES texture index after adaptive buffer resolution adjustment based on the GLES texture index corresponding to the original resolution.

FG_Context_GLES* HMS_FG_CreateContext_GLES(void)

Creates a frame generation context instance. If the call is successful, a pointer to the FG_Context_GLES object will be returned. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetAlgorithmMode_GLES(FG_Context_GLES* context, const FG_AlgorithmModeInfo* predictionModeInfo)

Sets the frame prediction algorithm mode and motion estimation mode for frame generation. This API is mandatory. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetResolution_GLES(FG_Context_GLES* context, const FG_ResolutionInfo* resolutionInfo)

Sets the resolutions of input and output images for frame generation. This API is mandatory. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetCvvZSemantic_GLES(FG_Context_GLES* context, FG_CvvZSemantic semantic)

Sets the homogeneous clip space Z/W range and depth function. This API is optional. If it is not called, the default value FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z will be used. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetImageFormat_GLES(FG_Context_GLES* context, FG_ImageFormat_GLES format)

Sets the image format of the real frame color buffer and the predicted frame buffer. This API is optional. If it is not called, the default value FG_FORMAT_R8G8B8A8_UNORM will be used. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetDepthStencilYDirectionInverted_GLES(FG_Context_GLES* context, bool inverted)

Sets the flag bit for flipping the color buffer around the Y axis relative to the depth stencil buffer. This API is optional. If it is not called, no flipping is performed by default. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_Activate_GLES(FG_Context_GLES* context)

Activates a frame generation context instance. Before the activation, the instance attributes must be set. For an activated frame generation context instance, the HMS_FG_Dispatch_GLES API can be called to generate a predicted frame. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_Deactivate_GLES(FG_Context_GLES* context)

Deactivates a frame generation context instance. To activate the instance again, call the HMS_FG_Activate_GLES API.

FG_ErrorCode HMS_FG_IsActive_GLES(FG_Context_GLES* context, bool* isActive)

Checks whether a frame generation context instance is activated. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_Dispatch_GLES(FG_Context_GLES* context, const FG_DispatchDescription_GLES* desc)

Sets the parameter information required for frame prediction to generate a predicted frame. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_SetExtendedCameraInfo_GLES(FG_Context_GLES* context, const FG_PerFrameExtendedCameraInfo* info)

Sets the extended camera attribute information. When the translation component of the view projection matrix is very large, this information is provided for more accurate frame generation. This API is optional. This API applies only to the OpenGL ES graphics API.

FG_ErrorCode HMS_FG_DestroyContext_GLES(FG_Context_GLES** context)

Destroys a frame generation context instance and releases memory resources. This API applies only to the OpenGL ES graphics API.

FG_Context_VK* HMS_FG_CreateContext_VK(const FG_ContextDescription_VK* contextDescription)

Creates a frame generation context instance. If the call is successful, a pointer to the FG_Context_VK object will be returned. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_SetAlgorithmMode_VK(FG_Context_VK* context, const FG_AlgorithmModeInfo* predictionModeInfo)

Sets the frame generation algorithm mode, including the prediction algorithm mode and motion estimation mode. This API is mandatory. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_SetResolution_VK(FG_Context_VK* context, const FG_ResolutionInfo* resolutionInfo)

Sets the resolutions of input and output images for frame generation. This API is mandatory. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_SetCvvZSemantic_VK(FG_Context_VK* context, FG_CvvZSemantic semantic)

Sets the homogeneous clip space Z/W range and depth function. This API is optional. If it is not called, the default value FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_FORWARD_Z will be used. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_SetImageFormat_VK(FG_Context_VK* context, const FG_ImageFormat_VK* format)

Sets the input and output image formats for frame generation. This API is optional. If it is not called, the default value VK_FORMAT_R8G8B8A8_UNORM will be used for the real frame color buffer and predicted frame buffer, and VK_FORMAT_D24_UNORM_S8_UINT will be used for the depth stencil buffer. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_SetDepthStencilYDirectionInverted_VK(FG_Context_VK* context, bool inverted)

Sets the flag bit for flipping the color buffer around the Y axis relative to the depth stencil buffer. This API is optional. If it is not called, no flipping is performed by default. This API applies only to the Vulkan graphics API. If flipping occurs but inverted is not set to true, the predicted frame effect may be abnormal.

FG_Image_VK* HMS_FG_CreateImage_VK(FG_Context_VK* context, VkImage image, VkImageView view)

Creates input and output image instances for frame generation. An image instance must be created through this API for the real frame color buffer, depth stencil buffer, and predicted frame buffer, respectively. Then, the created image instances are passed to the HMS_FG_Dispatch_VK API to generate a predicted frame. This API is used to associate the image resources in a game app with the frame generation algorithm implementation.

FG_ErrorCode HMS_FG_DestroyImage_VK(FG_Context_VK* context, FG_Image_VK* image)

Destroys input and output image instances for frame generation and cancels the corresponding association.

FG_ErrorCode HMS_FG_Activate_VK(FG_Context_VK* context)

Activates a frame generation context instance. Before the activation, the instance attributes must be set. For an activated frame generation context instance, the HMS_FG_Dispatch_VK API can be called to generate a predicted frame. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_Deactivate_VK(FG_Context_VK* context)

Deactivates a frame generation context instance. To activate the instance again, call the HMS_FG_Activate_VK API.

FG_ErrorCode HMS_FG_IsActive_VK(FG_Context_VK* context, bool* isActive)

Checks whether a frame generation context instance is activated. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_Dispatch_VK(FG_Context_VK* context, const FG_DispatchDescription_VK* desc)

Sets the parameter information required for frame prediction to generate a predicted frame. This API applies only to the Vulkan graphics API.

FG_ErrorCode HMS_FG_DestroyContext_VK(FG_Context_VK** context)

Destroys a frame generation context instance and releases memory resources. This API applies only to the Vulkan graphics API.

OpenGTX_Context* HMS_OpenGTX_CreateContext(OpenGTX_DeviceInfoCallback deviceInfoCallback)

Creates an OpenGTX context instance. Each time this API is successfully called, an OpenGTX_Context object is created and a pointer to the OpenGTX_Context object is returned.

OpenGTX_ErrorCode HMS_OpenGTX_Activate(OpenGTX_Context* context)

Activates an OpenGTX context instance. Before using an OpenGTX context instance, you need to activate it.

OpenGTX_ErrorCode HMS_OpenGTX_Deactivate(OpenGTX_Context* context)

Deactivates an OpenGTX context instance. To activate the instance again, call the HMS_OpenGTX_Activate API.

OpenGTX_ErrorCode HMS_OpenGTX_SetConfiguration(OpenGTX_Context* context, const OpenGTX_ConfigDescription* config)

Initializes an OpenGTX context instance and sets the OpenGTX context instance attributes.

OpenGTX_ErrorCode HMS_OpenGTX_DispatchFrameRenderInfo(OpenGTX_Context* context, const OpenGTX_FrameRenderInfo* frameRenderInfo)

Sets the frame rendering information required for OpenGTX running. The information needs to be updated after each change to a frame.

OpenGTX_ErrorCode HMS_OpenGTX_DispatchGameSceneInfo(OpenGTX_Context* context, const OpenGTX_GameSceneInfo* gameSceneInfo)

Sets the game scene information required for OpenGTX running.

OpenGTX_ErrorCode HMS_OpenGTX_DispatchNetworkInfo(OpenGTX_Context* context, const OpenGTX_NetworkInfo* networkInfo)

Sets the network latency information required for OpenGTX running.

OpenGTX_ErrorCode HMS_OpenGTX_DestroyContext(OpenGTX_Context** context)

Destroys an OpenGTX context instance and releases memory resources.

Type Definition Description

[h2]ABR_CameraData

typedef struct ABR_CameraData ABR_CameraData

Description

Describes the camera motion data of a game app's each frame. The ABR capability adaptively adjusts the buffer resolution factor according to the camera motion data.

Start version: 5.0.0(12)

[h2]ABR_Context

typedef struct ABR_Context ABR_Context

Description

Describes the ABR context.

Start version: 5.0.0(12)

[h2]ABR_ErrorCode

typedef enum ABR_ErrorCode ABR_ErrorCode

Description

Describes the error codes of ABR API calls.

Start version: 5.0.0(12)

[h2]ABR_RenderAPI_Type

typedef enum ABR_RenderAPI_Type ABR_RenderAPI_Type

Description

Describes the graphics API types supported by the ABR capability.

Start version: 5.0.0(12)

[h2]ABR_Vector3

typedef struct ABR_Vector3 ABR_Vector3

Description

Describes an ABR 3D vector.

Start version: 5.0.0(12)

[h2]FG_AlgorithmModeInfo

typedef struct FG_AlgorithmModeInfo FG_AlgorithmModeInfo

Description

Describes the frame generation algorithm mode information.

Start version: 5.0.0(12)

[h2]FG_Context_GLES

typedef struct FG_Context_GLES FG_Context_GLES

Description

Describes the frame generation context. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

[h2]FG_Context_VK

typedef struct FG_Context_VK FG_Context_VK

Description

Describes the frame generation context. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

[h2]FG_ContextDescription_VK

typedef struct FG_ContextDescription_VK FG_ContextDescription_VK

Description

Describes the attribute information required for creating a frame generation context instance FG_Context_VK.

Start version: 5.0.0(12)

[h2]FG_CvvZSemantic

typedef enum FG_CvvZSemantic FG_CvvZSemantic

Description

Describes the homogeneous clip space Z/W ranges and depth functions after camera projection transformation.

Start version: 5.0.0(12)

[h2]FG_Dimension2D

typedef struct FG_Dimension2D FG_Dimension2D

Description

Describes the 2D image resolution, in pixels.

Start version: 5.0.0(12)

[h2]FG_DispatchDescription_GLES

typedef struct FG_DispatchDescription_GLES FG_DispatchDescription_GLES

Description

Describes the parameter information required by HMS_FG_Dispatch_GLES. The parameter information needs to be updated for each frame. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

[h2]FG_DispatchDescription_VK

typedef struct FG_DispatchDescription_VK FG_DispatchDescription_VK

Description

Describes the parameter information required by HMS_FG_Dispatch_VK. The parameter information needs to be updated for each frame. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

[h2]FG_ErrorCode

typedef enum FG_ErrorCode FG_ErrorCode

Description

Describes the error codes of frame generation API calls.

Start version: 5.0.0(12)

[h2]FG_Image_VK

typedef struct FG_Image_VK FG_Image_VK

Description

Describes the input and output images for frame generation. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

[h2]FG_ImageFormat_GLES

typedef enum FG_ImageFormat_GLES FG_ImageFormat_GLES

Description

Describes the image formats of the real frame color buffer and the predicted frame buffer. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

[h2]FG_ImageFormat_VK

typedef struct FG_ImageFormat_VK FG_ImageFormat_VK

Description

Describes the input and output image format information for frame generation. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

[h2]FG_ImageInfo_VK

typedef struct FG_ImageInfo_VK FG_ImageInfo_VK

Description

Describes the input and output image information for frame generation.

Start version: 5.0.0(12)

[h2]FG_ImageSync_VK

typedef struct FG_ImageSync_VK FG_ImageSync_VK

Description

Describes the synchronization status information about the input and output images for frame generation. It is used to create a memory barrier for the images.

Start version: 5.0.0(12)

[h2]FG_Mat4x4

typedef struct FG_Mat4x4 FG_Mat4x4

Description

Describes a 4x4 matrix in column-major order.

Start version: 5.0.0(12)

[h2]FG_MeMode

typedef enum FG_MeMode FG_MeMode

Description

Describes the motion estimation algorithm modes. The basic mode and enhanced mode are supported.

Start version: 5.0.0(12)

[h2]FG_PredictionMode

typedef enum FG_PredictionMode FG_PredictionMode

Description

Describes the frame prediction algorithm modes for frame generation.

Start version: 5.0.0(12)

[h2]FG_ResolutionInfo

typedef struct FG_ResolutionInfo FG_ResolutionInfo

Description

Describes the resolutions of input and output images for frame generation.

Start version: 5.0.0(12)

[h2]FG_Vec3D

typedef struct FG_Vec3D FG_Vec3D

Description

Describes a frame generation 3D vector.

Start version: 5.0.0(12)

[h2]FG_PerFrameExtendedCameraInfo

typedef struct FG_PerFrameExtendedCameraInfo FG_PerFrameExtendedCameraInfo

Description

Describes extended camera information. When the translation component of the view projection matrix is very large, more detailed camera information can be provided for more accurate frame prediction.

Start version: 5.0.0(12)

[h2]OpenGTX_ConfigDescription

typedef struct OpenGTX_ConfigDescription OpenGTX_ConfigDescription

Description

Describes the OpenGTX attribute settings.

Start version: 5.0.0(12)

[h2]OpenGTX_Context

typedef struct OpenGTX_Context OpenGTX_Context

Description

Describes the OpenGTX context.

Start version: 5.0.0(12)

[h2]OpenGTX_DeviceInfoCallback

typedef void(* OpenGTX_DeviceInfoCallback) (OpenGTX_TempLevel)

Description

Callback for device temperature information.

Start version: 5.0.0(12)

Parameters:

Name

Description

OpenGTX_TempLevel

Device temperature level (OpenGTX_TempLevel).

[h2]OpenGTX_EngineType

typedef enum OpenGTX_EngineType OpenGTX_EngineType

Description

Describes the underlying game engine types used by game apps.

Start version: 5.0.0(12)

[h2]OpenGTX_ErrorCode

typedef enum OpenGTX_ErrorCode OpenGTX_ErrorCode

Description

Describes the error codes of OpenGTX API calls.

Start version: 5.0.0(12)

[h2]OpenGTX_FrameRenderInfo

typedef struct OpenGTX_FrameRenderInfo OpenGTX_FrameRenderInfo

Description

Describes the frame rendering information. This struct is passed by a game app after obtaining the frame attributes.

Start version: 5.0.0(12)

[h2]OpenGTX_GameSceneInfo

typedef struct OpenGTX_GameSceneInfo OpenGTX_GameSceneInfo

Description

Describes the game scene information. This struct is passed by a game app after obtaining the scene information.

Start version: 5.0.0(12)

[h2]OpenGTX_GameType

typedef enum OpenGTX_GameType OpenGTX_GameType

Description

Describes the game types.

Start version: 5.0.0(12)

[h2]OpenGTX_LTPO_Mode

typedef enum OpenGTX_LTPO_Mode OpenGTX_LTPO_Mode

Description

Describes the OpenGTX_LTPO modes for controlling the game frame rate.

Start version: 5.0.0(12)

[h2]OpenGTX_NetworkInfo

typedef struct OpenGTX_NetworkInfo OpenGTX_NetworkInfo

Description

Describes the current device network information. This struct is passed by a game app after obtaining the network information.

Start version: 5.0.0(12)

[h2]OpenGTX_NetworkLatency

typedef struct OpenGTX_NetworkLatency OpenGTX_NetworkLatency

Description

Describes the current device network latency information. This struct is passed by a game app after obtaining the network latency information.

Start version: 5.0.0(12)

[h2]OpenGTX_PictureQualityMaxLevel

typedef enum OpenGTX_PictureQualityMaxLevel OpenGTX_PictureQualityMaxLevel

Description

Describes the game app image quality levels.

Start version: 5.0.0(12)

[h2]OpenGTX_ResolutionValue

typedef struct OpenGTX_ResolutionValue OpenGTX_ResolutionValue

Description

Describes the resolution of a game app.

Start version: 5.0.0(12)

[h2]OpenGTX_SceneID

typedef enum OpenGTX_SceneID OpenGTX_SceneID

Description

Describes the OpenGTX game scene types.

Start version: 5.0.0(12)

[h2]OpenGTX_TempLevel

typedef enum OpenGTX_TempLevel OpenGTX_TempLevel

Description

Describes the device temperature levels.

Start version: 5.0.0(12)

[h2]OpenGTX_Vector3

typedef struct OpenGTX_Vector3 OpenGTX_Vector3

Description

Describes an OpenGTX 3D vector.

Start version: 5.0.0(12)

Enumeration Description

[h2]ABR_ErrorCode

enum ABR_ErrorCode

Description

Describes the error codes of ABR API calls.

Start version: 5.0.0(12)

Enumerated Value

Description

ABR_SUCCESS

The API execution is successful.

ABR_INVALID_PARAMETER

Invalid parameters, including a missing mandatory parameter, an incorrect parameter type, and an invalid parameter value.

ABR_CONTEXT_CONFIG_AFTER_ACTIVE

The attributes of an ABR context instance are to be set after the instance is activated. This error code is returned if an ABR context instance has been activated before attribute setting.

ABR_CONTEXT_NOT_CONFIG

The ABR context instance attributes are not set. This error code is returned if the ABR context instance attributes are not set or fail to be set when HMS_ABR_Activate is called.

ABR_CONTEXT_NOT_ACTIVE

The ABR context instance is not activated. This error code is returned if the ABR context instance is not activated when HMS_ABR_MarkFrameBuffer_GLES or an ABR update-related function is called.

ABR_METADATA_INVALID

Invalid ABR metadata. This error code is returned if invalid metadata is detected during ABR context instance attribute setting.

ABR_FRAMEBUFFER_INVALID

Invalid buffer. This error code is returned if an invalid buffer is detected when HMS_ABR_MarkFrameBuffer_GLES is called.

[h2]ABR_RenderAPI_Type

enum ABR_RenderAPI_Type

Description

Describes the graphics API types supported by the ABR capability.

Start version: 5.0.0(12)

Enumerated Value

Description

RENDER_API_GLES

OpenGL ES API

[h2]FG_CvvZSemantic

enum FG_CvvZSemantic

Description

Describes the homogeneous clip space Z/W ranges and depth functions after camera projection transformation.

Start version: 5.0.0(12)

Enumerated Value

Description

FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z

After projection transformation, the homogeneous clip space Z/W range is [-1, 1] and the depth function is less equal, which are usually used by the OpenGL ES graphics API.

FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_REVERSE_Z

After projection transformation, the homogeneous clip space Z/W range is [0, 1] and the depth function is greater equal, which are usually used by the DirectX or Vulkan graphics API.

FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_REVERSE_Z

After projection transformation, the homogeneous clip space Z/W range is [-1, 1] and the depth function is greater equal.

FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_FORWARD_Z

After projection transformation, the homogeneous clip space Z/W range is [0, 1] and the depth function is less equal.

[h2]FG_ErrorCode

enum FG_ErrorCode

Description

Describes the error codes of frame generation API calls.

Start version: 5.0.0(12)

Enumerated Value

Description

FG_SUCCESS

The API execution is successful.

FG_INVALID_PARAMETER

Invalid parameters, including a missing mandatory parameter, an incorrect parameter type, and an invalid parameter value.

FG_CONTEXT_NOT_CONFIG

The frame generation context instance attributes are not set. This error code is returned if the frame generation context instance attributes are not set or fail to be set when HMS_FG_Activate_GLES is called.

FG_CONTEXT_NOT_ACTIVE

The frame generation context instance is not activated. This error code is returned if the frame generation context instance is not activated when HMS_FG_Dispatch_GLES is called.

FG_COLLECTING_PREVIOUS_FRAMES

Multiple historical frames need to be passed for motion estimation during frame generation. This error code is returned and no predicted frame will be generated if the number of passed frames is less than a fixed threshold when HMS_FG_Dispatch_GLES is called. The threshold value is 2 for the following modes: GLES basic interpolation mode, GLES enhanced interpolation mode, and GLES enhanced extrapolation mode. The threshold value is 3 for the following modes: GLES basic extrapolation mode, Vulkan basic interpolation mode, and Vulkan basic extrapolation mode. When the number of passed frames reaches the fixed threshold, the call will be successful and FG_SUCCESS is returned.

[h2]FG_ImageFormat_GLES

enum FG_ImageFormat_GLES

Description

Describes the image formats of the real frame color buffer and the predicted frame buffer. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Enumerated Value

Description

FG_FORMAT_R8G8B8A8_UNORM

GL_RGBA8.

FG_FORMAT_R11G11B10_SFLOAT

GL_R11F_G11F_B10F.

FG_FORMAT_R16G16B16A16_SFLOAT

GL_RGBA16F.

[h2]FG_MeMode

enum FG_MeMode

Description

Describes the motion estimation algorithm modes. The basic mode and enhanced mode are supported.

Start version: 5.0.0(12)

Enumerated Value

Description

FG_ME_MODE_BASIC

Basic mode. Motion estimation is performed by using the color, depth, and camera matrix information about historical frames.

FG_ME_MODE_ENHANCED

Enhanced mode. The geometric vertex information about historical frames is used for more accurate motion estimation to draw predicted frames with higher quality. In this mode, you need to mark the draw calls for drawing vertices.

[h2]FG_PredictionMode

enum FG_PredictionMode

Description

Describes the frame prediction algorithm modes for frame generation.

Start version: 5.0.0(12)

Enumerated Value

Description

FG_PREDICTION_MODE_INTERPOLATION

Interpolation mode. A predicted frame (frame N-0.5) is generated between two adjacent real frames (frame N-1 and frame N). This mode applies to role-playing games, racing games, and other games that have high requirements on rendering quality and running smoothness.

FG_PREDICTION_MODE_EXTRAPOLATION

Extrapolation mode. A future predicted frame (frame N+0.5) is generated based on two adjacent real frames (frame N-1 and frame N). This mode applies to action games, shooting games, and other games that have high requirements on response latency and operation sensitivity.

[h2]OpenGTX_EngineType

enum OpenGTX_EngineType

Description

Describes the underlying game engine types used by game apps.

Start version: 5.0.0(12)

Enumerated Value

Description

UNITY

Unity.

UNREAL

Unreal.

MESSIAH

Messiah.

COCOS

Cocos.

OTHERS_ENGINE

Other engines.

[h2]OpenGTX_ErrorCode

enum OpenGTX_ErrorCode

Description

Describes the error codes of OpenGTX API calls.

Start version: 5.0.0(12)

Enumerated Value

Description

OPENGTX_SUCCESS

The API execution is successful.

OPENGTX_INVALID_PARAMETER

Invalid parameters, including a missing mandatory parameter, an incorrect parameter type, and an invalid parameter value.

OPENGTX_CONTEXT_NOT_CONFIG

The OpenGTX context instance attributes are not set. This error code is returned if the OpenGTX context instance attributes are not set when functions such as HMS_OpenGTX_DispatchFrameRenderInfo are called.

OPENGTX_CONTEXT_NOT_ACTIVE

The OpenGTX context instance is not activated. This error code is returned if the OpenGTX context instance is not activated when functions such as HMS_OpenGTX_DispatchFrameRenderInfo are called.

[h2]OpenGTX_GameType

enum OpenGTX_GameType

Description

Describes the game types.

Start version: 5.0.0(12)

Enumerated Value

Description

MOBA

Multiplayer online battle arena (MOBA).

RPG

Role-playing game (RPG).

FPS

First-person shooter (FPS).

RAC

Racing (RAC).

OTHERS_TYPE

Other game types.

[h2]OpenGTX_LTPO_Mode

enum OpenGTX_LTPO_Mode

Description

Describes the OpenGTX_LTPO modes for controlling the game frame rate.

Start version: 5.0.0(12)

Enumerated Value

Description

SCENE_MODE

Scene mode.

TOUCH_MODE

Touch mode.

ADAPTIVE_MODE

Adaptive mode.

[h2]OpenGTX_PictureQualityMaxLevel

enum OpenGTX_PictureQualityMaxLevel

Description

Describes the game app image quality levels.

Start version: 5.0.0(12)

Enumerated Value

Description

SD

SD, for example, 480p.

HD

HD, for example, 720p.

FHD

FHD, for example, 1080p.

QHD

QHD, for example, 2K.

UHD

UHD, for example, 4K.

[h2]OpenGTX_SceneID

enum OpenGTX_SceneID

Description

Describes the OpenGTX game scene types.

Start version: 5.0.0(12)

Enumerated Value

Description

LOGIN

Login.

GAME_INTERFACE

Game hall.

LOADING

Loading a game.

PLAYING

Playing a game.

SPECTATOR

Spectating a game.

DEATH

Preparing for a combat.

HEAVY_LOAD

Heavy load.

OTHERS_SCENE

Other scenes.

[h2]OpenGTX_TempLevel

enum OpenGTX_TempLevel

Description

Describes the device temperature levels.

Start version: 5.0.0(12)

Enumerated Value

Description

TEMP_LEVEL1

Temperature level 1. The game can retain the current settings.

TEMP_LEVEL2

Temperature level 2. The game should reduce unnecessary services, such as background updates.

TEMP_LEVEL3

Temperature level 3. The game should stop non-key services.

TEMP_LEVEL4

Temperature level 4. The game should lower its gaming effect.

TEMP_LEVEL5

Temperature level 5. The game should lower its scene settings, such as the frame resolution, frame rate, and image quality.

TEMP_LEVEL6

Temperature level 6. The game should maintain the minimum settings.

Function Description

[h2]HMS_ABR_Activate()

ABR_ErrorCode HMS_ABR_Activate(ABR_Context* context)

Description

Activates an ABR context instance. Before the activation, the HMS_ABR_SetTargetFps and HMS_ABR_SetScaleRange APIs must be called to set instance attributes.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_CreateContext()

ABR_Context* HMS_ABR_CreateContext(ABR_RenderAPI_Type type)

Description

Creates an ABR context instance. Each time this API is successfully called, an ABR_Context object is created and a pointer to the ABR_Context object is returned.

Start version: 5.0.0(12)

Parameters:

Name

Description

type

Graphics API type. The options are specified by ABR_RenderAPI_Type.

Returns:

If the call is successful, a pointer to ABR_Context is returned. If the call fails, a null pointer is returned.

[h2]HMS_ABR_Deactivate()

ABR_ErrorCode HMS_ABR_Deactivate(ABR_Context* context)

Description

Deactivates an ABR context instance. To activate the instance again, call the HMS_ABR_Activate API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_DestroyContext()

ABR_ErrorCode HMS_ABR_DestroyContext(ABR_Context** context)

Description

Destroys an ABR context instance and releases memory resources.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Level-2 pointer to a created ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_GetScale()

ABR_ErrorCode HMS_ABR_GetScale(ABR_Context* context, float* scale )

Description

Obtains the buffer resolution factor for adaptive resolution adjustment.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

scale

Points to a variable used to specify the ABR resolution factor. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_GetNextScale()

ABR_ErrorCode HMS_ABR_GetNextScale(ABR_Context* context, float* scale)

Description

Obtains the ABR buffer resolution factor of the next frame.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

scale

Points to a variable used to specify the ABR resolution factor. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_IsActive()

ABR_ErrorCode HMS_ABR_IsActive(ABR_Context* context, bool* isActive )

Description

Checks whether an ABR context instance is activated.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

isActive

Indicates whether an ABR context instance is activated.

  • true: yes
  • false: no

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_MarkFrameBuffer_GLES()

ABR_ErrorCode HMS_ABR_MarkFrameBuffer_GLES(ABR_Context* context)

Description

Marks a GLES buffer for adaptive rendering. This API must be called before the rendering is started.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_GetScaledTexture_GLES()

ABR_ErrorCode HMS_ABR_GetScaledTexture_GLES(ABR_Context* context, uint32_t originTexture, uint32_t* scaledTexture)

Description

Obtains the GLES texture index after adaptive buffer resolution adjustment based on the GLES texture index corresponding to the original resolution.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

originTexture

GLES texture index of the original resolution.

scaledTexture

GLES texture index after adaptive buffer resolution adjustment.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_SetScaleRange()

ABR_ErrorCode HMS_ABR_SetScaleRange(ABR_Context* context, const float minValue, const float maxValue )

Description

Sets the buffer resolution factor range of an ABR context instance.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

minValue

Minimum buffer resolution factor of an ABR context instance. The value range is [0.5, 1.0].

maxValue

Maximum buffer resolution factor of an ABR context instance. The value range is [0.5, 1.0].

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_SetTargetFps()

ABR_ErrorCode HMS_ABR_SetTargetFps(ABR_Context* context, const uint32_t targetFps )

Description

Sets the target frame rate of an ABR context instance.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

targetFps

Target frame rate of an ABR context instance. The value range is [30, 120].

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_ABR_UpdateCameraData()

ABR_ErrorCode HMS_ABR_UpdateCameraData(ABR_Context* context, ABR_CameraData* data )

Description

Updates the camera motion data of each frame. Before the update, the HMS_ABR_Activate API must be called to activate the ABR context instance.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created ABR context instance, that is, a pointer to the ABR_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

data

Camera motion data of a game app's each frame, that is, a pointer to ABR_CameraData. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, ABR_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to ABR_ErrorCode.

[h2]HMS_FG_Activate_GLES()

FG_ErrorCode HMS_FG_Activate_GLES(FG_Context_GLES* context)

Description

Activates a frame generation context instance. Before the activation, the instance attributes must be set. For an activated frame generation context instance, the HMS_FG_Dispatch_GLES API can be called to generate a predicted frame. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_CreateContext_GLES()

FG_Context_GLES* HMS_FG_CreateContext_GLES(void )

Description

Creates a frame generation context instance. If the call is successful, a pointer to the FG_Context_GLES object will be returned. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Returns:

If the call is successful, a pointer to FG_Context_GLES is returned. If the call fails, a null pointer is returned.

[h2]HMS_FG_CreateContext_VK()

FG_Context_VK* HMS_FG_CreateContext_VK(const FG_ContextDescription_VK* contextDescription)

Description

Creates a frame generation context instance. If the call is successful, a pointer to the FG_Context_VK object will be returned. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

contextDescription

Pointer to an FG_ContextDescription_VK object. The pointer should not be null.

Returns:

If the call is successful, a pointer to FG_Context_VK is returned. If the call fails, a null pointer is returned.

[h2]HMS_FG_CreateImage_VK()

FG_Image_VK* HMS_FG_CreateImage_VK(FG_Context_VK* context, VkImage image, VkImageView view )

Description

Creates input and output image instances for frame generation. An image instance must be created through this API for the real frame color buffer, depth stencil buffer, and predicted frame buffer, respectively. Then, the created image instances are passed to the HMS_FG_Dispatch_VK API to generate a predicted frame. This API is used to associate the image resources in a game app with the frame generation algorithm implementation.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

image

VkImage object.

view

VkImageView object.

Returns:

Input and output image instances for frame generation.

[h2]HMS_FG_Deactivate_GLES()

FG_ErrorCode HMS_FG_Deactivate_GLES(FG_Context_GLES* context)

Description

Deactivates a frame generation context instance. To activate the instance again, call the HMS_FG_Activate_GLES API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_Deactivate_VK()

FG_ErrorCode HMS_FG_Deactivate_VK(FG_Context_VK* context)

Description

Deactivates a frame generation context instance. To activate the instance again, call the HMS_FG_Activate_VK API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_DestroyContext_GLES()

FG_ErrorCode HMS_FG_DestroyContext_GLES(FG_Context_GLES** context)

Description

Destroys a frame generation context instance and releases memory resources. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Level-2 pointer to a created FG_Context_GLES object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_DestroyContext_VK()

FG_ErrorCode HMS_FG_DestroyContext_VK(FG_Context_VK** context)

Description

Destroys a frame generation context instance and releases memory resources. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Level-2 pointer to a created FG_Context_VK object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_DestroyImage_VK()

FG_ErrorCode HMS_FG_DestroyImage_VK(FG_Context_VK* context, FG_Image_VK* image )

Description

Destroys input and output image instances for frame generation and cancels the corresponding association.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

image

Pointer to an FG_Image_VK object.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_Dispatch_GLES()

FG_ErrorCode HMS_FG_Dispatch_GLES(FG_Context_GLES* context, const FG_DispatchDescription_GLES* desc )

Description

Sets the parameter information required for frame prediction to generate a predicted frame. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

desc

Pointer to FG_DispatchDescription_GLES. The pointer should not be null. The parameter information needs to be updated for each frame.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the number of input historical frames does not reach the fixed threshold (which is 2 for the basic interpolation mode, enhanced interpolation mode, and enhanced extrapolation mode, and 3 for the basic extrapolation mode), FG_COLLECTING_PREVIOUS_FRAMES is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetExtendedCameraInfo_GLES()

FG_ErrorCode HMS_FG_SetExtendedCameraInfo_GLES(FG_Context_GLES* context, const FG_PerFrameExtendedCameraInfo* info)

Description

Sets the extended camera attribute information. When the translation component of the view projection matrix is very large, this information is provided for more accurate frame generation. This API is optional. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

info

Pointer to an FG_PerFrameExtendedCameraInfo object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_Dispatch_VK()

FG_ErrorCode HMS_FG_Dispatch_VK(FG_Context_VK* context, const FG_DispatchDescription_VK* desc )

Description

Sets the parameter information required for frame prediction to generate a predicted frame. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

desc

Pointer to FG_DispatchDescription_VK. The pointer should not be null. The parameter information needs to be updated for each frame.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the number of input historical frames does not reach the fixed threshold (which is 3 for both the interpolation and extrapolation modes), FG_COLLECTING_PREVIOUS_FRAMES is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_IsActive_GLES()

FG_ErrorCode HMS_FG_IsActive_GLES(FG_Context_GLES* context, bool* isActive )

Description

Checks whether a frame generation context instance is activated. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

isActive

Indicates whether a frame generation context instance is activated.

true: yes

false: no

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_IsActive_VK()

FG_ErrorCode HMS_FG_IsActive_VK(FG_Context_VK* context, bool* isActive )

Description

Checks whether a frame generation context instance is activated. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

isActive

Indicates whether a frame generation context instance is activated.

true: yes

false: no

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetAlgorithmMode_GLES()

FG_ErrorCode HMS_FG_SetAlgorithmMode_GLES(FG_Context_GLES* context, const FG_AlgorithmModeInfo* predictionModeInfo )

Description

Sets the frame prediction algorithm mode and motion estimation mode for frame generation. This API is mandatory. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

predictionModeInfo

Pointer to an FG_AlgorithmModeInfo object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetCvvZSemantic_GLES()

FG_ErrorCode HMS_FG_SetCvvZSemantic_GLES(FG_Context_GLES* context, FG_CvvZSemantic semantic )

Description

Sets the homogeneous clip space Z/W range and depth function. This API is optional. If it is not called, the default value FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z will be used. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

semantic

Enumerated values of the homogeneous clip space Z/W range and depth function.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetCvvZSemantic_VK()

FG_ErrorCode HMS_FG_SetCvvZSemantic_VK(FG_Context_VK* context, FG_CvvZSemantic semantic )

Description

Sets the homogeneous clip space Z/W range and depth function. This API is optional. If it is not called, the default value FG_CVV_Z_SEMANTIC_ZERO_TO_ONE_FORWARD_Z will be used. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

semantic

Enumerated values of the homogeneous clip space Z/W range and depth function.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetDepthStencilYDirectionInverted_GLES()

FG_ErrorCode HMS_FG_SetDepthStencilYDirectionInverted_GLES(FG_Context_GLES* context, bool inverted )

Description

Sets the flag bit for flipping the color buffer around the Y axis relative to the depth stencil buffer. This API is optional. If it is not called, no flipping is performed by default. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

inverted

Flag bit indicating whether the color buffer is flipped around the Y axis relative to the depth stencil buffer.

true: The color buffer is flipped 180 degrees around the Y axis relative to the depth stencil buffer.

false: The color buffer is not flipped relative to the depth stencil buffer.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetDepthStencilYDirectionInverted_VK()

FG_ErrorCode HMS_FG_SetDepthStencilYDirectionInverted_VK(FG_Context_VK* context, bool inverted )

Description

Sets the flag bit for flipping the color buffer around the Y axis relative to the depth stencil buffer. This API is optional. If it is not called, no flipping is performed by default. This API applies only to the Vulkan graphics API. If flipping occurs but inverted is not set to true, the predicted frame effect may be abnormal.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

inverted

Flag bit indicating whether the color buffer is flipped around the Y axis relative to the depth stencil buffer.

true: The color buffer is flipped 180 degrees around the Y axis relative to the depth stencil buffer.

false: The color buffer is not flipped relative to the depth stencil buffer.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetImageFormat_GLES()

FG_ErrorCode HMS_FG_SetImageFormat_GLES(FG_Context_GLES* context, FG_ImageFormat_GLES format )

Description

Sets the image format of the real frame color buffer and the predicted frame buffer. This API is optional. If it is not called, the default value FG_FORMAT_R8G8B8A8_UNORM will be used. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

format

Enumerated values of the image formats of the real frame color buffer and the predicted frame buffer.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetImageFormat_VK()

FG_ErrorCode HMS_FG_SetImageFormat_VK(FG_Context_VK* context, const FG_ImageFormat_VK* format )

Description

Sets the input and output image formats for frame generation. This API is optional. If it is not called, the default value VK_FORMAT_R8G8B8A8_UNORM will be used for the real frame color buffer and predicted frame buffer, and VK_FORMAT_D24_UNORM_S8_UINT will be used for the depth stencil buffer. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

format

Pointer to an FG_ImageFormat_VK object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetResolution_GLES()

FG_ErrorCode HMS_FG_SetResolution_GLES(FG_Context_GLES* context, const FG_ResolutionInfo* resolutionInfo )

Description

Sets the resolutions of input and output images for frame generation. This API is mandatory. This API applies only to the OpenGL ES graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_GLES object. The pointer should not be null.

resolutionInfo

Pointer to an FG_ResolutionInfo object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_FG_SetResolution_VK()

FG_ErrorCode HMS_FG_SetResolution_VK(FG_Context_VK* context, const FG_ResolutionInfo* resolutionInfo )

Description

Sets the resolutions of input and output images for frame generation. This API is mandatory. This API applies only to the Vulkan graphics API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created frame generation context instance, that is, a pointer to the FG_Context_VK object. The pointer should not be null.

resolutionInfo

Pointer to an FG_ResolutionInfo object. The pointer should not be null.

Returns:

Execution result of the function. If the execution is successful, FG_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to FG_ErrorCode.

[h2]HMS_OpenGTX_Activate()

OpenGTX_ErrorCode HMS_OpenGTX_Activate(OpenGTX_Context* context)

Description

Activates an OpenGTX context instance. Before using an OpenGTX context instance, you need to activate it.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_CreateContext()

OpenGTX_Context* HMS_OpenGTX_CreateContext(OpenGTX_DeviceInfoCallback deviceInfoCallback)

Description

Creates an OpenGTX context instance. Each time this API is successfully called, an OpenGTX_Context object is created and a pointer to the OpenGTX_Context object is returned.

Start version: 5.0.0(12)

Parameters:

Name

Description

deviceInfoCallback

Callback for device temperature information, corresponding to OpenGTX_DeviceInfoCallback.

Returns:

If the call is successful, a pointer to OpenGTX_Context is returned. If the call fails, a null pointer is returned.

[h2]HMS_OpenGTX_Deactivate()

OpenGTX_ErrorCode HMS_OpenGTX_Deactivate(OpenGTX_Context* context)

Description

Deactivates an OpenGTX context instance. To activate the instance again, call the HMS_OpenGTX_Activate API.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_DestroyContext()

OpenGTX_ErrorCode HMS_OpenGTX_DestroyContext(OpenGTX_Context** context)

Description

Destroys an OpenGTX context instance and releases memory resources.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_DispatchFrameRenderInfo()

OpenGTX_ErrorCode HMS_OpenGTX_DispatchFrameRenderInfo(OpenGTX_Context* context, const OpenGTX_FrameRenderInfo* frameRenderInfo )

Description

Sets the frame rendering information required for OpenGTX running. The information needs to be updated after each change to a frame.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

frameRenderInfo

Frame rendering information struct, that is, a pointer to OpenGTX_FrameRenderInfo. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_DispatchGameSceneInfo()

OpenGTX_ErrorCode HMS_OpenGTX_DispatchGameSceneInfo(OpenGTX_Context* context, const OpenGTX_GameSceneInfo* gameSceneInfo )

Description

Sets the game scene information required for OpenGTX running.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

gameSceneInfo

Game scene information, that is, a pointer to OpenGTX_GameSceneInfo. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_DispatchNetworkInfo()

OpenGTX_ErrorCode HMS_OpenGTX_DispatchNetworkInfo(OpenGTX_Context* context, const OpenGTX_NetworkInfo* networkInfo )

Description

Sets the network latency information required for OpenGTX running.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

networkInfo

Network information, that is, a pointer to OpenGTX_NetworkInfo. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.

[h2]HMS_OpenGTX_SetConfiguration()

OpenGTX_ErrorCode HMS_OpenGTX_SetConfiguration (OpenGTX_Context* context, const OpenGTX_ConfigDescription* config )

Description

Initializes an OpenGTX context instance and sets the OpenGTX context instance attributes.

Start version: 5.0.0(12)

Parameters:

Name

Description

context

Created OpenGTX context instance, that is, a pointer to the OpenGTX_Context instance. The pointer should not be null. Otherwise, an error code indicating failure is returned.

config

Initialization parameters of an OpenGTX context instance, that is, a pointer to OpenGTX_ConfigDescription. The pointer should not be null. Otherwise, an error code indicating failure is returned.

Returns:

Execution result of the function. If the execution is successful, OPENGTX_SUCCESS is returned. If the execution fails, an error code is returned. For details about the error codes, please refer to OpenGTX_ErrorCode.