add hw fg

This commit is contained in:
StarBeats 2024-11-22 14:45:23 +08:00
parent cabe73b2c6
commit cfce0a877c
7 changed files with 175 additions and 17 deletions

View File

@ -1,31 +1,31 @@
[ [
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI.cpp.o", "RenderAPI.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI.cpp.o", "RenderAPI.cpp"],
"file": "RenderAPI.cpp" "file": "RenderAPI.cpp"
}, },
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D11.cpp.o", "RenderAPI_D3D11.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D11.cpp.o", "RenderAPI_D3D11.cpp"],
"file": "RenderAPI_D3D11.cpp" "file": "RenderAPI_D3D11.cpp"
}, },
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D12.cpp.o", "RenderAPI_D3D12.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_D3D12.cpp.o", "RenderAPI_D3D12.cpp"],
"file": "RenderAPI_D3D12.cpp" "file": "RenderAPI_D3D12.cpp"
}, },
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_OpenGLCoreES.cpp.o", "RenderAPI_OpenGLCoreES.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_OpenGLCoreES.cpp.o", "RenderAPI_OpenGLCoreES.cpp"],
"file": "RenderAPI_OpenGLCoreES.cpp" "file": "RenderAPI_OpenGLCoreES.cpp"
}, },
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_Vulkan.cpp.o", "RenderAPI_Vulkan.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderAPI_Vulkan.cpp.o", "RenderAPI_Vulkan.cpp"],
"file": "RenderAPI_Vulkan.cpp" "file": "RenderAPI_Vulkan.cpp"
}, },
{ {
"directory": "g:\\TJURP\\NativeRenderPlugin", "directory": "G:\\TJURP\\NativeRenderPlugin",
"arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderingPlugin.cpp.o", "RenderingPlugin.cpp"], "arguments": ["C:\\Users\\xinyt\\AppData\\Local\\OpenHarmony\\Sdk\\12\\native\\llvm\\bin\\clang.exe", "-c", "-Qunused-arguments", "-D__MUSL__", "--target=aarch64-linux-ohos", "--sysroot=C:/Users/xinyt/AppData/Local/OpenHarmony/Sdk/12/native/sysroot", "-fPIC", "-std=c++20", "-Igl3w", "-IUnity", "-DSUPPORT_VULKAN=1", "-DSUPPORT_OPENGL_UNIFIED=1", "-DSUPPORT_OPENGL_ES=1", "-DOHOS=1", "-IC:\\Program Files\\Huawei\\DevEco Studio\\sdk\\default\\hms\\native\\sysroot\\usr\\include", "-DMYCLANG", "-DOHOS_STL=c++_shared", "-o", "build\\.objs\\GfxPluginNativeRender\\harmonyos\\aarch64\\debug\\RenderingPlugin.cpp.o", "RenderingPlugin.cpp"],
"file": "RenderingPlugin.cpp" "file": "RenderingPlugin.cpp"
}] }]

View File

@ -17,7 +17,9 @@
"xmemory": "cpp", "xmemory": "cpp",
"__bit_reference": "cpp", "__bit_reference": "cpp",
"map": "cpp", "map": "cpp",
"unordered_map": "cpp" "unordered_map": "cpp",
"utility": "cpp",
"system_error": "cpp"
}, },
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"editor.lineHighlightBackground": "#1073cf2d", "editor.lineHighlightBackground": "#1073cf2d",

View File

@ -83,7 +83,7 @@ public:
virtual void enableVRS(int vrsEnum) {} virtual void enableVRS(int vrsEnum) {}
virtual void disableVRS() {} virtual void disableVRS() {}
virtual void enableFGExtrapolation() {} virtual void enableFGExtrapolation(void* data) {}
virtual void preFGExtrapolation() {} virtual void preFGExtrapolation() {}
// when renturn true present dst, data may matriaxs or texture // when renturn true present dst, data may matriaxs or texture
virtual bool doFGExtrapolation(void* src, void* data, void* dst) { return false;} virtual bool doFGExtrapolation(void* src, void* data, void* dst) { return false;}

View File

@ -25,6 +25,8 @@
#include "xengine/xeg_gles_neural_upscale.h" #include "xengine/xeg_gles_neural_upscale.h"
#include <native_buffer/native_buffer.h> #include <native_buffer/native_buffer.h>
#include <native_window/external_window.h> #include <native_window/external_window.h>
#include <graphics_game_sdk/frame_generation_gles.h>
#endif #endif
#elif UNITY_OSX #elif UNITY_OSX
#include <OpenGL/gl3.h> #include <OpenGL/gl3.h>
@ -66,7 +68,7 @@ public:
virtual void enableVRS(int vrsEnum) override; virtual void enableVRS(int vrsEnum) override;
virtual void disableVRS() override; virtual void disableVRS() override;
virtual void enableFGExtrapolation() override; virtual void enableFGExtrapolation(void* data) override;
virtual void preFGExtrapolation() override; virtual void preFGExtrapolation() override;
virtual bool doFGExtrapolation(void *src, void *data, void *dst) override; virtual bool doFGExtrapolation(void *src, void *data, void *dst) override;
virtual void postFGExtrapolation() override; virtual void postFGExtrapolation() override;
@ -81,6 +83,9 @@ private:
PFNGLSHADINGRATE gl_shadingrate_fn = nullptr; PFNGLSHADINGRATE gl_shadingrate_fn = nullptr;
PFNGLQCOMFRAMEEXTRAPOLATION gl_extrapolate_qcom_fn; PFNGLQCOMFRAMEEXTRAPOLATION gl_extrapolate_qcom_fn;
#if OHOS
FG_Context_GLES* hw_fg_context;
#endif
}; };
// 重新定义 vrs rate // 重新定义 vrs rate
@ -117,6 +122,10 @@ static GLenum vrs_argment_size_table[] =
// SHADING_RATE_4X1_PIXELS_EXT,// (此硬件原生不支持) // SHADING_RATE_4X1_PIXELS_EXT,// (此硬件原生不支持)
}; };
#define GL_DRAWCALL_HINT 0x8193
#define GL_START 0x8194
#define GL_END 0x8195
RenderAPI *CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer api_type) RenderAPI *CreateRenderAPI_OpenGLCoreES(UnityGfxRenderer api_type)
{ {
return new RenderAPI_OpenGLCoreES(api_type); return new RenderAPI_OpenGLCoreES(api_type);
@ -230,16 +239,134 @@ void RenderAPI_OpenGLCoreES::disableVRS()
gl_shadingrate_fn(vrs_argment_size_table[0]); gl_shadingrate_fn(vrs_argment_size_table[0]);
} }
void RenderAPI_OpenGLCoreES::enableFGExtrapolation() void RenderAPI_OpenGLCoreES::enableFGExtrapolation(void* data)
{ {
#if OHOS
struct RenderResultion
{
uint32_t width;
uint32_t heigh;
};
auto resultion_param = static_cast<RenderResultion*>(data);
hw_fg_context = HMS_FG_CreateContext_GLES();
// 初始化超帧接口调用错误码
FG_ErrorCode error_code = FG_SUCCESS;
// 超帧算法模式
FG_AlgorithmModeInfo algorith_info{};
algorith_info.predictionMode = FG_PREDICTION_MODE_EXTRAPOLATION; // 外插模式
algorith_info.meMode = FG_ME_MODE_BASIC; // 运动估计基础模式
error_code = HMS_FG_SetAlgorithmMode_GLES(hw_fg_context, &algorith_info); // [必选] 设置超帧算法模式
if (error_code != FG_SUCCESS)
{
return;
}
// 超帧输入输出图像分辨率
FG_ResolutionInfo resolution_info{};
resolution_info.inputColorResolution = FG_Dimension2D{resultion_param->width,resultion_param->heigh};
resolution_info.inputDepthStencilResolution = FG_Dimension2D{resultion_param->width,resultion_param->heigh};
resolution_info.outputColorResolution = FG_Dimension2D{resultion_param->width,resultion_param->heigh};
error_code = HMS_FG_SetResolution_GLES(hw_fg_context, &resolution_info); // [必选] 设置超帧输入输出图像分辨率
if (error_code != FG_SUCCESS)
{
return;
}
// [可选] 设置齐次裁剪空间Z/W范围及深度测试模式接口不调用时默认为FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z
error_code = HMS_FG_SetCvvZSemantic_GLES(hw_fg_context, FG_CVV_Z_SEMANTIC_MINUS_ONE_TO_ONE_FORWARD_Z);
if (error_code != FG_SUCCESS)
{
return;
}
// [可选] 设置真实渲染帧颜色缓冲区图像格式接口不调用时默认为FG_FORMAT_R8G8B8A8_UNORM
error_code = HMS_FG_SetImageFormat_GLES(hw_fg_context, FG_FORMAT_R8G8B8A8_UNORM);
if (error_code != FG_SUCCESS)
{
return;
}
// [可选] 当颜色缓冲区相对深度模板缓冲区基于y轴翻转180度时设置第二个参数为true接口不调用时默认为无翻转
error_code = HMS_FG_SetDepthStencilYDirectionInverted_GLES(hw_fg_context, true);
if (error_code != FG_SUCCESS)
{
return;
}
#endif
} }
void RenderAPI_OpenGLCoreES::preFGExtrapolation() void RenderAPI_OpenGLCoreES::preFGExtrapolation()
{ {
#if OHOS
HMS_FG_Activate_GLES(hw_fg_context);
// glHint(GL_DRAWCALL_HINT, GL_START); // 绘制动态物体前,开始记录顶点数据
#endif
} }
bool RenderAPI_OpenGLCoreES::doFGExtrapolation(void *src, void *data, void *dst) bool RenderAPI_OpenGLCoreES::doFGExtrapolation(void *src, void *data, void *dst)
{ {
#if OHOS
struct HWFGExtrapolationParam
{
FG_Mat4x4 pre_view_proj;
FG_Mat4x4 pre_in_view_proj;
void* depth_stencil_tex;
};
FG_DispatchDescription_GLES dispatch_description_data {
.inputColor = 0U,
.inputDepthStencil = 0U,
.viewProj{},
.invViewProj{},
.outputColor = 0U
};
auto param = static_cast<HWFGExtrapolationParam*>(data);
GLuint gl_srctex = (GLuint)(size_t)(src);
GLuint gl_dsttex = (GLuint)(size_t)(dst);
GLuint gl_depth_stencil_tex = (GLuint)(size_t)(param->depth_stencil_tex);
// 传入上一帧真实渲染帧颜色缓冲区索引
dispatch_description_data.inputColor = gl_srctex;
// 传入上一帧真实渲染帧深度模板缓冲区索引
dispatch_description_data.inputDepthStencil = gl_depth_stencil_tex;
// 传入预测帧缓冲区索引
dispatch_description_data.outputColor = gl_dsttex;
// 传入上一帧真实渲染帧视图投影矩阵
dispatch_description_data.viewProj = param->pre_view_proj;
// 传入上一帧真实渲染帧视图投影逆矩阵
dispatch_description_data.invViewProj = param->pre_in_view_proj;
// // [可选] 当视图投影矩阵的平移分量非常大时,可提供相机扩展属性信息以获得更加准确的超帧效果。
// FG_PerFrameExtendedCameraInfo info;
// auto error_code = HMS_FG_SetExtendedCameraInfo_GLES(hw_fg_context, &info);
// 生成预测帧,更新预测帧缓冲区的内存
auto error_code = HMS_FG_Dispatch_GLES(hw_fg_context, &dispatch_description_data);
switch (error_code)
{
case FG_SUCCESS:
{
// 绘制预测帧
// ...
// 绘制UI
// ...
// 送显预测帧
// ...
break;
}
case FG_COLLECTING_PREVIOUS_FRAMES:
// 传入真实帧数量未达到固定阈值,无预测帧生成,基础外插模式传入真实帧数量<3时返回该状态码增强外插模式传入真实帧数量<2时返回该状态码此时不要将预测帧送显
break;
default:
// 预测帧生成失败
return false;
}
return true;
#else
GLuint gl_src0tex = (GLuint)(size_t)(src); GLuint gl_src0tex = (GLuint)(size_t)(src);
GLuint gl_src1tex = (GLuint)(size_t)(data); GLuint gl_src1tex = (GLuint)(size_t)(data);
GLuint gl_dsttex = (GLuint)(size_t)(dst); GLuint gl_dsttex = (GLuint)(size_t)(dst);
@ -248,14 +375,25 @@ bool RenderAPI_OpenGLCoreES::doFGExtrapolation(void *src, void *data, void *dst)
auto err = glGetError(); auto err = glGetError();
return err == GL_NO_ERROR; return err == GL_NO_ERROR;
#endif
} }
void RenderAPI_OpenGLCoreES::postFGExtrapolation() void RenderAPI_OpenGLCoreES::postFGExtrapolation()
{ {
#if OHOS
// glHint(GL_DRAWCALL_HINT, GL_END); // 绘制动态物体后,结束记录顶点数据
#endif
} }
void RenderAPI_OpenGLCoreES::disableFGExtrapolation() void RenderAPI_OpenGLCoreES::disableFGExtrapolation()
{ {
#if OHOS
auto error_code = HMS_FG_DestroyContext_GLES(&hw_fg_context);
if (error_code != FG_SUCCESS)
{
return;
}
#endif
} }
void RenderAPI_OpenGLCoreES::spatialUpScale(void *src, void *data, void *dst) void RenderAPI_OpenGLCoreES::spatialUpScale(void *src, void *data, void *dst)

View File

@ -273,7 +273,7 @@ public:
virtual void enableVRS(int vrsEnum) override; virtual void enableVRS(int vrsEnum) override;
virtual void disableVRS() override; virtual void disableVRS() override;
virtual void enableFGExtrapolation() override; virtual void enableFGExtrapolation(void* data) override;
virtual void preFGExtrapolation() override; virtual void preFGExtrapolation() override;
virtual bool doFGExtrapolation(void *src, void *data, void *dst) override; virtual bool doFGExtrapolation(void *src, void *data, void *dst) override;
virtual void postFGExtrapolation() override; virtual void postFGExtrapolation() override;

View File

@ -100,11 +100,11 @@ enum NativeRenderingEvent
{ {
EnableVRS = 1, EnableVRS = 1,
DisableVRS, DisableVRS,
// EnableFGExtrapolation, EnableFGExtrapolation,
// PreFGExtrapolation, PreFGExtrapolation,
DoFGExtrapolation, DoFGExtrapolation,
// PostFGExtrapolation, PostFGExtrapolation,
// DisableFGExtrapolation, DisableFGExtrapolation,
// SpatialUpScale, // SpatialUpScale,
}; };
@ -126,9 +126,26 @@ static void UNITY_INTERFACE_API OnRenderEventAndData(int eventID, void *data)
s_current_api->disableVRS(); s_current_api->disableVRS();
break; break;
} }
case NativeRenderingEvent::EnableFGExtrapolation:
{
s_current_api->enableFGExtrapolation();
break;
}
case NativeRenderingEvent::DisableFGExtrapolation:
{
break;
}
case NativeRenderingEvent::PreFGExtrapolation:
{
break;
}
case NativeRenderingEvent::PostFGExtrapolation:
{
break;
}
case NativeRenderingEvent::DoFGExtrapolation: case NativeRenderingEvent::DoFGExtrapolation:
{ {
AFMEParam* param = (AFMEParam*)data; AFMEParam *param = (AFMEParam *)data;
s_current_api->doFGExtrapolation(param->src, param->data, param->dst); s_current_api->doFGExtrapolation(param->src, param->data, param->dst);
break; break;
} }

View File

@ -68,6 +68,7 @@ target("GfxPluginNativeRender")
if is_plat("harmonyos") then if is_plat("harmonyos") then
add_links("xengine") add_links("xengine")
add_links("framegeneration")
add_defines("OHOS=1") add_defines("OHOS=1")
end end