1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
4 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
5 * Copyright 2010-2011 LunarG, Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the
10 * "Software"), to deal in the Software without restriction, including
11 * without limitation the rights to use, copy, modify, merge, publish,
12 * distribute, sub license, and/or sell copies of the Software, and to
13 * permit persons to whom the Software is furnished to do so, subject to
14 * the following conditions:
16 * The above copyright notice and this permission notice (including the
17 * next paragraph) shall be included in all copies or substantial portions
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 * DEALINGS IN THE SOFTWARE.
28 **************************************************************************/
31 #ifndef EGLAPI_INCLUDED
32 #define EGLAPI_INCLUDED
40 * A generic function ptr type
42 typedef void (*_EGLProc
)(void);
45 struct mesa_glinterop_device_info
;
46 struct mesa_glinterop_export_in
;
47 struct mesa_glinterop_export_out
;
50 * The API dispatcher jumps through these functions
55 EGLBoolean (*Initialize
)(_EGLDriver
*, _EGLDisplay
*dpy
);
56 EGLBoolean (*Terminate
)(_EGLDriver
*, _EGLDisplay
*dpy
);
59 EGLBoolean (*GetConfigs
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
60 EGLConfig
*configs
, EGLint config_size
,
62 EGLBoolean (*ChooseConfig
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
63 const EGLint
*attrib_list
, EGLConfig
*configs
,
64 EGLint config_size
, EGLint
*num_config
);
65 EGLBoolean (*GetConfigAttrib
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
66 _EGLConfig
*config
, EGLint attribute
,
70 _EGLContext
*(*CreateContext
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
71 _EGLConfig
*config
, _EGLContext
*share_list
,
72 const EGLint
*attrib_list
);
73 EGLBoolean (*DestroyContext
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
75 /* this is the only function (other than Initialize) that may be called
76 * with an uninitialized display
78 EGLBoolean (*MakeCurrent
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
79 _EGLSurface
*draw
, _EGLSurface
*read
,
81 EGLBoolean (*QueryContext
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
82 _EGLContext
*ctx
, EGLint attribute
,
86 _EGLSurface
*(*CreateWindowSurface
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
87 _EGLConfig
*config
, void *native_window
,
88 const EGLint
*attrib_list
);
89 _EGLSurface
*(*CreatePixmapSurface
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
90 _EGLConfig
*config
, void *native_pixmap
,
91 const EGLint
*attrib_list
);
92 _EGLSurface
*(*CreatePbufferSurface
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
94 const EGLint
*attrib_list
);
95 EGLBoolean (*DestroySurface
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
96 _EGLSurface
*surface
);
97 EGLBoolean (*QuerySurface
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
98 _EGLSurface
*surface
, EGLint attribute
,
100 EGLBoolean (*SurfaceAttrib
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
101 _EGLSurface
*surface
, EGLint attribute
,
103 EGLBoolean (*BindTexImage
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
104 _EGLSurface
*surface
, EGLint buffer
);
105 EGLBoolean (*ReleaseTexImage
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
106 _EGLSurface
*surface
, EGLint buffer
);
107 EGLBoolean (*SwapInterval
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
108 _EGLSurface
*surf
, EGLint interval
);
109 EGLBoolean (*SwapBuffers
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
111 EGLBoolean (*CopyBuffers
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
112 _EGLSurface
*surface
, void *native_pixmap_target
);
113 EGLBoolean (*SetDamageRegion
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
114 _EGLSurface
*surface
, EGLint
*rects
, EGLint n_rects
);
117 EGLBoolean (*WaitClient
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
119 EGLBoolean (*WaitNative
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
122 /* this function may be called from multiple threads at the same time */
123 _EGLProc (*GetProcAddress
)(_EGLDriver
*drv
, const char *procname
);
125 _EGLSurface
*(*CreatePbufferFromClientBuffer
)(_EGLDriver
*drv
,
128 EGLClientBuffer buffer
,
130 const EGLint
*attrib_list
);
132 _EGLImage
*(*CreateImageKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
133 _EGLContext
*ctx
, EGLenum target
,
134 EGLClientBuffer buffer
,
135 const EGLint
*attr_list
);
136 EGLBoolean (*DestroyImageKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
139 _EGLSync
*(*CreateSyncKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
, EGLenum type
,
140 const EGLAttrib
*attrib_list
);
141 EGLBoolean (*DestroySyncKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
143 EGLint (*ClientWaitSyncKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
144 _EGLSync
*sync
, EGLint flags
, EGLTime timeout
);
145 EGLint (*WaitSyncKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
, _EGLSync
*sync
);
146 EGLBoolean (*SignalSyncKHR
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
147 _EGLSync
*sync
, EGLenum mode
);
148 EGLBoolean (*GetSyncAttrib
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
149 _EGLSync
*sync
, EGLint attribute
,
151 EGLint (*DupNativeFenceFDANDROID
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
154 EGLBoolean (*SwapBuffersRegionNOK
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
155 _EGLSurface
*surf
, EGLint numRects
,
156 const EGLint
*rects
);
158 _EGLImage
*(*CreateDRMImageMESA
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
159 const EGLint
*attr_list
);
160 EGLBoolean (*ExportDRMImageMESA
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
161 _EGLImage
*img
, EGLint
*name
,
162 EGLint
*handle
, EGLint
*stride
);
164 EGLBoolean (*BindWaylandDisplayWL
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
165 struct wl_display
*display
);
166 EGLBoolean (*UnbindWaylandDisplayWL
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
167 struct wl_display
*display
);
168 EGLBoolean (*QueryWaylandBufferWL
)(_EGLDriver
*drv
, _EGLDisplay
*displ
,
169 struct wl_resource
*buffer
,
170 EGLint attribute
, EGLint
*value
);
172 struct wl_buffer
*(*CreateWaylandBufferFromImageWL
)(_EGLDriver
*drv
,
176 EGLBoolean (*SwapBuffersWithDamageEXT
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
177 _EGLSurface
*surface
,
178 const EGLint
*rects
, EGLint n_rects
);
180 EGLBoolean (*PostSubBufferNV
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
181 _EGLSurface
*surface
, EGLint x
, EGLint y
,
182 EGLint width
, EGLint height
);
184 EGLint (*QueryBufferAge
)(_EGLDriver
*drv
,
185 _EGLDisplay
*dpy
, _EGLSurface
*surface
);
186 EGLBoolean (*GetSyncValuesCHROMIUM
)(_EGLDisplay
*dpy
, _EGLSurface
*surface
,
187 EGLuint64KHR
*ust
, EGLuint64KHR
*msc
,
190 EGLBoolean (*ExportDMABUFImageQueryMESA
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
191 _EGLImage
*img
, EGLint
*fourcc
,
193 EGLuint64KHR
*modifiers
);
194 EGLBoolean (*ExportDMABUFImageMESA
)(_EGLDriver
*drv
, _EGLDisplay
*disp
,
195 _EGLImage
*img
, EGLint
*fds
,
196 EGLint
*strides
, EGLint
*offsets
);
198 int (*GLInteropQueryDeviceInfo
)(_EGLDisplay
*dpy
, _EGLContext
*ctx
,
199 struct mesa_glinterop_device_info
*out
);
200 int (*GLInteropExportObject
)(_EGLDisplay
*dpy
, _EGLContext
*ctx
,
201 struct mesa_glinterop_export_in
*in
,
202 struct mesa_glinterop_export_out
*out
);
204 EGLBoolean (*QueryDmaBufFormatsEXT
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
,
205 EGLint max_formats
, EGLint
*formats
,
206 EGLint
*num_formats
);
207 EGLBoolean (*QueryDmaBufModifiersEXT
) (_EGLDriver
*drv
, _EGLDisplay
*dpy
,
208 EGLint format
, EGLint max_modifiers
,
209 EGLuint64KHR
*modifiers
,
210 EGLBoolean
*external_only
,
211 EGLint
*num_modifiers
);
218 #endif /* EGLAPI_INCLUDED */