From 26d15a9f13c9178fe7f07585a6dac46661937062 Mon Sep 17 00:00:00 2001 From: Kyle Brenneman Date: Wed, 10 Feb 2021 15:52:11 -0700 Subject: [PATCH] EGL: Allow vendor's dispatch stubs to update the EGL device map. Export a new __EGLapiExports::setVendorForDevice function, which allows dispatch stubs to update the device hashtable when something returns an EGLDeviceEXT handle. Bumped the ABI version number to 1.2. --- include/glvnd/libeglabi.h | 10 +++++++++- src/EGL/libeglvendor.c | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/glvnd/libeglabi.h b/include/glvnd/libeglabi.h index d8857b9..b2f19c0 100644 --- a/include/glvnd/libeglabi.h +++ b/include/glvnd/libeglabi.h @@ -82,7 +82,7 @@ extern "C" { * will still work. */ #define EGL_VENDOR_ABI_MAJOR_VERSION ((uint32_t) 0) -#define EGL_VENDOR_ABI_MINOR_VERSION ((uint32_t) 1) +#define EGL_VENDOR_ABI_MINOR_VERSION ((uint32_t) 2) #define EGL_VENDOR_ABI_VERSION ((EGL_VENDOR_ABI_MAJOR_VERSION << 16) | EGL_VENDOR_ABI_MINOR_VERSION) static inline uint32_t EGL_VENDOR_ABI_GET_MAJOR_VERSION(uint32_t version) { @@ -191,6 +191,14 @@ typedef struct __EGLapiExportsRec { * Returns the EGL vendor for an EGLDeviceEXT handle. */ __EGLvendorInfo *(*getVendorFromDevice)(EGLDeviceEXT dev); + + /** + * Sets the EGL vendor for an EGLDeviceEXT handle. The dispatch stub for + * any function that returns an EGLDeviceEXT handle should call this. + * + * Supported since ABI version 1.2. + */ + EGLBoolean (* setVendorForDevice)(EGLDeviceEXT dev, __EGLvendorInfo *vendor); } __EGLapiExports; /***************************************************************************** diff --git a/src/EGL/libeglvendor.c b/src/EGL/libeglvendor.c index 8cb4ff5..05fc665 100644 --- a/src/EGL/libeglvendor.c +++ b/src/EGL/libeglvendor.c @@ -164,6 +164,7 @@ const __EGLapiExports __eglExportsTable = { __eglSetLastVendor, // setLastVendor __eglGetVendorFromDisplay, // getVendorFromDisplay __eglGetVendorFromDevice, // getVendorFromDevice + __eglAddDevice, // setVendorForDevice }; void TeardownVendor(__EGLvendorInfo *vendor)