Skip to content

Commit

Permalink
Add EGL_WL_bind_wayland_display and EGL_WL_create_wayland_buffer_from…
Browse files Browse the repository at this point in the history
…_image (#95)

These extensions were developed by the Wayland project several years
ago, but never proposed for inclusion in the primary Khronos repository.

Unfortunately this includes tokens which alias with already-defined
values for the EGL platform extensions. Downstream implementations also
offered non-standard typedefs (e.g. PFNEGLBINDWAYLANDDISPLAYWL instead
of PFNEGLBINDWAYLANDDISPLAYWLPROC) which will have to be accounted for
in those implementations.
  • Loading branch information
fooishbar authored and oddhack committed Jan 6, 2020
1 parent 7e7b22f commit aa9b63f
Show file tree
Hide file tree
Showing 7 changed files with 443 additions and 6 deletions.
4 changes: 2 additions & 2 deletions api/EGL/egl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $
** Khronos $Git commit SHA1: 0f3a3945bf $ on $Git commit date: 2019-11-13 13:25:18 +0000 $
*/

#include <EGL/eglplatform.h>
Expand All @@ -42,7 +42,7 @@ extern "C" {
#define EGL_EGL_PROTOTYPES 1
#endif

/* Generated on date 20190808 */
/* Generated on date 20191212 */

/* Generated C header for:
* API: egl
Expand Down
38 changes: 36 additions & 2 deletions api/EGL/eglext.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $
** Khronos $Git commit SHA1: 0f3a3945bf $ on $Git commit date: 2019-11-13 13:25:18 +0000 $
*/

#include <EGL/eglplatform.h>

#define EGL_EGLEXT_VERSION 20190808
#define EGL_EGLEXT_VERSION 20191212

/* Generated C header for:
* API: egl
Expand Down Expand Up @@ -1362,6 +1362,40 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
#define EGL_NATIVE_SURFACE_TIZEN 0x32A1
#endif /* EGL_TIZEN_image_native_surface */

#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC
#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC
#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC
struct wl_display;
struct wl_resource;
#define EGL_WAYLAND_BUFFER_WL 0x31D5
#define EGL_WAYLAND_PLANE_WL 0x31D6
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
#define EGL_TEXTURE_Y_UV_WL 0x31D8
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
#define EGL_TEXTURE_EXTERNAL_WL 0x31DA
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
#endif /* EGL_WL_bind_wayland_display */

#ifndef EGL_WL_create_wayland_buffer_from_image
#define EGL_WL_create_wayland_buffer_from_image 1
#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC
struct wl_buffer;
typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image);
#endif
#endif /* EGL_WL_create_wayland_buffer_from_image */

#ifdef __cplusplus
}
#endif
Expand Down
73 changes: 72 additions & 1 deletion api/egl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<type name="NativePixmapType" requires="eglplatform"/>
<type name="NativeWindowType" requires="eglplatform"/>
<type>struct <name>AHardwareBuffer</name>;</type>
<type>struct <name>wl_buffer</name>;</type>
<type>struct <name>wl_display</name>;</type>
<type>struct <name>wl_resource</name>;</type>
<!-- Dummy placeholders for non-EGL types -->
<type name="Bool"/>
<!-- These are actual EGL types. -->
Expand Down Expand Up @@ -89,7 +92,13 @@
EGLint iHeight;
EGLint iStride;
};</type>
<!-- Backwards-compatibility hack: Downstream implementations shipped
incorrect function pointer names for some years. -->
<type>typedef void (<apientry/> *<name>EGLDEBUGPROCKHR</name>)(EGLenum error,const char *command,EGLint messageType,EGLLabelKHR threadLabel,EGLLabelKHR objectLabel,const char* message);</type>
<type>#define <name>PFNEGLBINDWAYLANDDISPLAYWL</name> PFNEGLBINDWAYLANDDISPLAYWLPROC</type>
<type>#define <name>PFNEGLUNBINDWAYLANDDISPLAYWL</name> PFNEGLUNBINDWAYLANDDISPLAYWLPROC</type>
<type>#define <name>PFNEGLQUERYWAYLANDBUFFERWL</name> PFNEGLQUERYWAYLANDBUFFERWLPROC</type>
<type>#define <name>PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL</name> PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC</type>
</types>

<!-- SECTION: EGL enumerant (token) definitions. -->
Expand Down Expand Up @@ -581,11 +590,27 @@
<enum value="0x31D7" name="EGL_PLATFORM_GBM_MESA" alias="EGL_PLATFORM_GBM_KHR"/>
<enum value="0x31D8" name="EGL_PLATFORM_WAYLAND_KHR"/>
<enum value="0x31D8" name="EGL_PLATFORM_WAYLAND_EXT" alias="EGL_PLATFORM_WAYLAND_KHR"/>
<unused start="0x31D9" end="0x31DC"/>
<unused start="0x31DC" end="0x31DC"/>
<enum value="0x31DD" name="EGL_PLATFORM_SURFACELESS_MESA"/>
<unused start="0x31DE" end="0x31DF"/>
</enums>

<!-- Due to an oversight in development, these enums alias the above MESA
vendor range for EGL the X11/GBM/Wayland/surfaceless platforms.
They are both currently in wide use and cannot be changed, however
the tokens cannot be used in the same contexts and the aliasing is
therefore harmless. Future Wayland tokens should not create further
aliasing in this range.-->
<enums namespace="EGL" start="0x31D5" end="0x31DB" vendor="WL" comment="EGL_WL_bind_wayland_display">
<enum value="0x31D5" name="EGL_WAYLAND_BUFFER_WL"/>
<enum value="0x31D6" name="EGL_WAYLAND_PLANE_WL"/>
<enum value="0x31D7" name="EGL_TEXTURE_Y_U_V_WL"/>
<enum value="0x31D8" name="EGL_TEXTURE_Y_UV_WL"/>
<enum value="0x31D9" name="EGL_TEXTURE_Y_XUXV_WL"/>
<enum value="0x31DA" name="EGL_TEXTURE_EXTERNAL_WL"/>
<enum value="0x31DB" name="EGL_WAYLAND_Y_INVERTED_WL"/>
</enums>

<enums namespace="EGL" start="0x31E0" end="0x31EF" vendor="HI" comment="Reserved for Mark Callow (Khronos bug 6799)">
<unused start="0x31E0" end="0x31EF"/>
</enums>
Expand Down Expand Up @@ -1903,6 +1928,28 @@
<param><ptype>EGLint</ptype> <name>external_win_id</name></param>
<param><ptype>EGLint</ptype> <name>policy</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglBindWaylandDisplayWL</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param>struct <ptype>wl_display</ptype> *<name>display</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglUnbindWaylandDisplayWL</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param>struct <ptype>wl_display</ptype> *<name>display</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglQueryWaylandBufferWL</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param>struct <ptype>wl_resource</ptype> *<name>buffer</name></param>
<param><ptype>EGLint</ptype> <name>attribute</name></param>
<param><ptype>EGLint</ptype> *<name>value</name></param>
</command>
<command>
<proto>struct <ptype>wl_buffer</ptype> *<name>eglCreateWaylandBufferFromImageWL</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLImageKHR</ptype> <name>image</name></param>
</command>
</commands>

<!-- SECTION: EGL API interface definitions. -->
Expand Down Expand Up @@ -3281,5 +3328,29 @@
<enum name="EGL_Y_AXIS_NV"/>
</require>
</extension>
<extension name="EGL_WL_bind_wayland_display" supported="egl">
<require>
<enum name="EGL_WAYLAND_BUFFER_WL"/>
<enum name="EGL_WAYLAND_PLANE_WL"/>
<enum name="EGL_TEXTURE_Y_U_V_WL"/>
<enum name="EGL_TEXTURE_Y_UV_WL"/>
<enum name="EGL_TEXTURE_Y_XUXV_WL"/>
<enum name="EGL_TEXTURE_EXTERNAL_WL"/>
<enum name="EGL_WAYLAND_Y_INVERTED_WL"/>

<command name="eglBindWaylandDisplayWL"/>
<command name="eglUnbindWaylandDisplayWL"/>
<command name="eglQueryWaylandBufferWL"/>
<type name="PFNEGLBINDWAYLANDDISPLAYWL"/>
<type name="PFNEGLUNBINDWAYLANDDISPLAYWL"/>
<type name="PFNEGLQUERYWAYLANDBUFFERWL"/>
</require>
</extension>
<extension name="EGL_WL_create_wayland_buffer_from_image" supported="egl">
<require>
<command name="eglCreateWaylandBufferFromImageWL"/>
<type name="PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL"/>
</require>
</extension>
</extensions>
</registry>

0 comments on commit aa9b63f

Please sign in to comment.