Intercept obsolete form of EGL surface creation functions. Closes #3924

This commit is contained in:
baldurk committed 2026-10-26 10:27:14 +00:00
1 parent e99d699ccd
commit 0a91fea828
2 files changed
+34 -14

No files matched your search

+22 -14
View File
@@ -31,6 +31,8 @@ typedef EGLenum(EGLAPIENTRY *PFN_eglQueryAPI)();
typedef EGLDisplay(EGLAPIENTRY *PFN_eglGetDisplay)(EGLNativeDisplayType display_id);
typedef EGLDisplay(EGLAPIENTRY *PFN_eglGetPlatformDisplay)(EGLenum platform, void *native_display,
const EGLAttrib *attrib_list);
typedef EGLDisplay(EGLAPIENTRY *PFN_eglGetPlatformDisplayEXT)(EGLenum platform, void *native_display,
const EGLAttrib *attrib_list);
typedef EGLContext(EGLAPIENTRY *PFN_eglCreateContext)(EGLDisplay dpy, EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list);
@@ -49,6 +51,10 @@ typedef EGLSurface(EGLAPIENTRY *PFN_eglCreateWindowSurface)(EGLDisplay dpy, EGLC
typedef EGLSurface(EGLAPIENTRY *PFN_eglCreatePlatformWindowSurface)(EGLDisplay dpy, EGLConfig config,
void *native_window,
const EGLAttrib *attrib_list);
typedef EGLSurface(EGLAPIENTRY *PFN_eglCreatePlatformWindowSurfaceEXT)(EGLDisplay dpy,
EGLConfig config,
void *native_window,
const EGLAttrib *attrib_list);
typedef EGLBoolean(EGLAPIENTRY *PFN_eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list,
EGLConfig *configs, EGLint config_size,
EGLint *num_config);
@@ -68,20 +74,22 @@ typedef PFNEGLPOSTSUBBUFFERNVPROC PFN_eglPostSubBufferNV;
typedef PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC PFN_eglSwapBuffersWithDamageEXT;
typedef PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC PFN_eglSwapBuffersWithDamageKHR;
#define EGL_HOOKED_SYMBOLS(FUNC) \
FUNC(BindAPI, false, true); \
FUNC(GetProcAddress, false, true); \
FUNC(GetDisplay, false, true); \
FUNC(GetPlatformDisplay, false, false); \
FUNC(CreateContext, false, true); \
FUNC(DestroyContext, false, true); \
FUNC(CreateWindowSurface, false, true); \
FUNC(CreatePlatformWindowSurface, false, false); \
FUNC(MakeCurrent, false, true); \
FUNC(SwapBuffers, false, true); \
FUNC(QueryString, false, true); \
FUNC(PostSubBufferNV, true, false); \
FUNC(SwapBuffersWithDamageEXT, true, false); \
#define EGL_HOOKED_SYMBOLS(FUNC) \
FUNC(BindAPI, false, true); \
FUNC(GetProcAddress, false, true); \
FUNC(GetDisplay, false, true); \
FUNC(GetPlatformDisplay, false, false); \
FUNC(CreateContext, false, true); \
FUNC(DestroyContext, false, true); \
FUNC(CreateWindowSurface, false, true); \
FUNC(CreatePlatformWindowSurface, false, false); \
FUNC(MakeCurrent, false, true); \
FUNC(SwapBuffers, false, true); \
FUNC(QueryString, false, true); \
FUNC(PostSubBufferNV, true, false); \
FUNC(GetPlatformDisplayEXT, true, false); \
FUNC(CreatePlatformWindowSurfaceEXT, true, false); \
FUNC(SwapBuffersWithDamageEXT, true, false); \
FUNC(SwapBuffersWithDamageKHR, true, false);
#define EGL_NONHOOKED_SYMBOLS(FUNC) \
+12
View File
@@ -226,6 +226,12 @@ HOOK_EXPORT EGLDisplay EGLAPIENTRY eglGetPlatformDisplay_renderdoc_hooked(EGLenu
return EGL.GetPlatformDisplay(platform, native_display, attrib_list);
}
HOOK_EXPORT EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT_renderdoc_hooked(
EGLenum platform, void *native_display, const EGLAttrib *attrib_list)
{
return eglGetPlatformDisplay_renderdoc_hooked(platform, native_display, attrib_list);
}
HOOK_EXPORT EGLBoolean EGLAPIENTRY eglBindAPI_renderdoc_hooked(EGLenum api)
{
if(RenderDoc::Inst().IsReplayApp())
@@ -461,6 +467,12 @@ HOOK_EXPORT EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface_renderdoc_hook
return ret;
}
HOOK_EXPORT EGLDisplay EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT_renderdoc_hooked(
EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list)
{
return eglCreatePlatformWindowSurface_renderdoc_hooked(dpy, config, native_window, attrib_list);
}
HOOK_EXPORT EGLBoolean EGLAPIENTRY eglMakeCurrent_renderdoc_hooked(EGLDisplay display,
EGLSurface draw, EGLSurface read,
EGLContext ctx)