Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 1 | // Copyright 2016 The SwiftShader Authors. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // main.cpp: DLL entry point and management of thread-local data. |
| 16 | |
| 17 | #include "main.h" |
| 18 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 19 | #include "Context.hpp" |
Chris Forbes | 1aae88c | 2018-09-11 17:31:52 -0700 | [diff] [blame] | 20 | #include "Display.h" |
Nicolas Capens | 45be1bc | 2021-04-07 12:34:21 -0400 | [diff] [blame] | 21 | #include "Surface.hpp" |
| 22 | #include "libEGL.hpp" |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 23 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 24 | #include "Common/SharedLibrary.hpp" |
Nicolas Capens | 45be1bc | 2021-04-07 12:34:21 -0400 | [diff] [blame] | 25 | #include "Common/Thread.hpp" |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 26 | #include "common/debug.h" |
Nicolas Capens | 45be1bc | 2021-04-07 12:34:21 -0400 | [diff] [blame] | 27 | #include "resource.h" |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 28 | |
| 29 | #include <EGL/eglext.h> |
| 30 | |
| 31 | static sw::Thread::LocalStorageKey currentTLS = TLS_OUT_OF_INDEXES; |
| 32 | |
| 33 | #if !defined(_MSC_VER) |
| 34 | #define CONSTRUCTOR __attribute__((constructor)) |
| 35 | #define DESTRUCTOR __attribute__((destructor)) |
| 36 | #else |
| 37 | #define CONSTRUCTOR |
| 38 | #define DESTRUCTOR |
| 39 | #endif |
| 40 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 41 | namespace egl |
| 42 | { |
David Rim | 10bcdb4 | 2018-04-06 17:48:41 +0900 | [diff] [blame] | 43 | void releaseCurrent(void *storage) |
| 44 | { |
| 45 | // This pthread destructor is called after the TLS is already reset to NULL, |
| 46 | // so we can't call EGL functions here to do the cleanup. |
| 47 | |
| 48 | Current *current = (Current*)storage; |
| 49 | |
| 50 | if(current) |
| 51 | { |
| 52 | if(current->drawSurface) |
| 53 | { |
| 54 | current->drawSurface->release(); |
| 55 | } |
| 56 | |
| 57 | if(current->readSurface) |
| 58 | { |
| 59 | current->readSurface->release(); |
| 60 | } |
| 61 | |
| 62 | if(current->context) |
| 63 | { |
| 64 | current->context->release(); |
| 65 | } |
| 66 | |
| 67 | free(current); |
| 68 | } |
| 69 | } |
| 70 | |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 71 | Current *attachThread() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 72 | { |
| 73 | TRACE("()"); |
| 74 | |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 75 | if(currentTLS == TLS_OUT_OF_INDEXES) |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 76 | { |
David Rim | 10bcdb4 | 2018-04-06 17:48:41 +0900 | [diff] [blame] | 77 | currentTLS = sw::Thread::allocateLocalStorageKey(releaseCurrent); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 78 | } |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 79 | |
Nicolas Capens | 4ad365b | 2017-09-12 16:39:42 -0400 | [diff] [blame] | 80 | Current *current = (Current*)sw::Thread::allocateLocalStorage(currentTLS, sizeof(Current)); |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 81 | |
| 82 | current->error = EGL_SUCCESS; |
| 83 | current->API = EGL_OPENGL_ES_API; |
| 84 | current->context = nullptr; |
| 85 | current->drawSurface = nullptr; |
| 86 | current->readSurface = nullptr; |
| 87 | |
| 88 | return current; |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 89 | } |
| 90 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 91 | void detachThread() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 92 | { |
| 93 | TRACE("()"); |
| 94 | |
Nicolas Capens | cc5c7d9 | 2016-06-13 14:35:11 -0400 | [diff] [blame] | 95 | eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_CONTEXT, EGL_NO_SURFACE, EGL_NO_SURFACE); |
| 96 | |
Nicolas Capens | 4ad365b | 2017-09-12 16:39:42 -0400 | [diff] [blame] | 97 | sw::Thread::freeLocalStorage(currentTLS); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 98 | } |
| 99 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 100 | CONSTRUCTOR void attachProcess() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 101 | { |
| 102 | TRACE("()"); |
| 103 | |
| 104 | #if !defined(ANGLE_DISABLE_TRACE) && defined(TRACE_OUTPUT_FILE) |
| 105 | FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt"); |
| 106 | |
| 107 | if(debug) |
| 108 | { |
| 109 | fclose(debug); |
| 110 | debug = fopen(TRACE_OUTPUT_FILE, "wt"); // Erase |
| 111 | fclose(debug); |
| 112 | } |
| 113 | #endif |
| 114 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 115 | attachThread(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 116 | } |
| 117 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 118 | DESTRUCTOR void detachProcess() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 119 | { |
| 120 | TRACE("()"); |
| 121 | |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 122 | detachThread(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 123 | sw::Thread::freeLocalStorageKey(currentTLS); |
| 124 | } |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 125 | } |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 126 | |
| 127 | #if defined(_WIN32) |
Alexis Hetu | 8e942eb | 2017-03-16 10:53:01 -0400 | [diff] [blame] | 128 | #ifdef DEBUGGER_WAIT_DIALOG |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 129 | static INT_PTR CALLBACK DebuggerWaitDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 130 | { |
| 131 | RECT rect; |
| 132 | |
| 133 | switch(uMsg) |
| 134 | { |
| 135 | case WM_INITDIALOG: |
| 136 | GetWindowRect(GetDesktopWindow(), &rect); |
| 137 | SetWindowPos(hwnd, HWND_TOP, rect.right / 2, rect.bottom / 2, 0, 0, SWP_NOSIZE); |
| 138 | SetTimer(hwnd, 1, 100, NULL); |
| 139 | return TRUE; |
| 140 | case WM_COMMAND: |
| 141 | if(LOWORD(wParam) == IDCANCEL) |
| 142 | { |
| 143 | EndDialog(hwnd, 0); |
| 144 | } |
| 145 | break; |
| 146 | case WM_TIMER: |
| 147 | if(IsDebuggerPresent()) |
| 148 | { |
| 149 | EndDialog(hwnd, 0); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | return FALSE; |
| 154 | } |
| 155 | |
| 156 | static void WaitForDebugger(HINSTANCE instance) |
| 157 | { |
| 158 | if(!IsDebuggerPresent()) |
| 159 | { |
| 160 | HRSRC dialog = FindResource(instance, MAKEINTRESOURCE(IDD_DIALOG1), RT_DIALOG); |
| 161 | DLGTEMPLATE *dialogTemplate = (DLGTEMPLATE*)LoadResource(instance, dialog); |
| 162 | DialogBoxIndirect(instance, dialogTemplate, NULL, DebuggerWaitDialogProc); |
| 163 | } |
| 164 | } |
Alexis Hetu | e97a31e | 2016-11-14 14:10:47 -0500 | [diff] [blame] | 165 | #endif |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 166 | |
| 167 | extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) |
| 168 | { |
| 169 | switch(reason) |
| 170 | { |
| 171 | case DLL_PROCESS_ATTACH: |
Alexis Hetu | 3818231 | 2017-03-16 11:46:16 -0400 | [diff] [blame] | 172 | #ifdef DEBUGGER_WAIT_DIALOG |
Nicolas Capens | e43cda5 | 2019-03-19 00:16:20 -0400 | [diff] [blame] | 173 | { |
| 174 | char disable_debugger_wait_dialog[] = "0"; |
| 175 | GetEnvironmentVariable("SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG", disable_debugger_wait_dialog, sizeof(disable_debugger_wait_dialog)); |
| 176 | |
| 177 | if(disable_debugger_wait_dialog[0] != '1') |
| 178 | { |
| 179 | WaitForDebugger(instance); |
| 180 | } |
| 181 | } |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 182 | #endif |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 183 | egl::attachProcess(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 184 | break; |
| 185 | case DLL_THREAD_ATTACH: |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 186 | egl::attachThread(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 187 | break; |
| 188 | case DLL_THREAD_DETACH: |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 189 | egl::detachThread(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 190 | break; |
| 191 | case DLL_PROCESS_DETACH: |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 192 | egl::detachProcess(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 193 | break; |
| 194 | default: |
| 195 | break; |
| 196 | } |
| 197 | |
| 198 | return TRUE; |
| 199 | } |
| 200 | #endif |
| 201 | |
| 202 | namespace egl |
| 203 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 204 | static Current *getCurrent(void) |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 205 | { |
| 206 | Current *current = (Current*)sw::Thread::getLocalStorage(currentTLS); |
| 207 | |
| 208 | if(!current) |
| 209 | { |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 210 | current = attachThread(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 211 | } |
| 212 | |
Nicolas Capens | 420b64d | 2017-07-07 17:01:16 -0400 | [diff] [blame] | 213 | return current; |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | void setCurrentError(EGLint error) |
| 217 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 218 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 219 | |
| 220 | current->error = error; |
| 221 | } |
| 222 | |
| 223 | EGLint getCurrentError() |
| 224 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 225 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 226 | |
| 227 | return current->error; |
| 228 | } |
| 229 | |
| 230 | void setCurrentAPI(EGLenum API) |
| 231 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 232 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 233 | |
| 234 | current->API = API; |
| 235 | } |
| 236 | |
| 237 | EGLenum getCurrentAPI() |
| 238 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 239 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 240 | |
| 241 | return current->API; |
| 242 | } |
| 243 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 244 | void setCurrentContext(egl::Context *ctx) |
| 245 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 246 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 247 | |
| 248 | if(ctx) |
| 249 | { |
| 250 | ctx->addRef(); |
| 251 | } |
| 252 | |
| 253 | if(current->context) |
| 254 | { |
| 255 | current->context->release(); |
| 256 | } |
| 257 | |
| 258 | current->context = ctx; |
| 259 | } |
| 260 | |
Nicolas Capens | 506cc5e | 2017-07-24 11:30:55 -0400 | [diff] [blame] | 261 | NO_SANITIZE_FUNCTION egl::Context *getCurrentContext() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 262 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 263 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 264 | |
| 265 | return current->context; |
| 266 | } |
| 267 | |
| 268 | void setCurrentDrawSurface(egl::Surface *surface) |
| 269 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 270 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 271 | |
| 272 | if(surface) |
| 273 | { |
| 274 | surface->addRef(); |
| 275 | } |
| 276 | |
| 277 | if(current->drawSurface) |
| 278 | { |
| 279 | current->drawSurface->release(); |
| 280 | } |
| 281 | |
| 282 | current->drawSurface = surface; |
| 283 | } |
| 284 | |
| 285 | egl::Surface *getCurrentDrawSurface() |
| 286 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 287 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 288 | |
| 289 | return current->drawSurface; |
| 290 | } |
| 291 | |
| 292 | void setCurrentReadSurface(egl::Surface *surface) |
| 293 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 294 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 295 | |
| 296 | if(surface) |
| 297 | { |
| 298 | surface->addRef(); |
| 299 | } |
| 300 | |
| 301 | if(current->readSurface) |
| 302 | { |
| 303 | current->readSurface->release(); |
| 304 | } |
| 305 | |
| 306 | current->readSurface = surface; |
| 307 | } |
| 308 | |
| 309 | egl::Surface *getCurrentReadSurface() |
| 310 | { |
Nicolas Capens | af93a42 | 2016-06-12 16:11:25 -0400 | [diff] [blame] | 311 | Current *current = getCurrent(); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 312 | |
| 313 | return current->readSurface; |
| 314 | } |
| 315 | |
| 316 | void error(EGLint errorCode) |
| 317 | { |
| 318 | egl::setCurrentError(errorCode); |
| 319 | |
| 320 | if(errorCode != EGL_SUCCESS) |
| 321 | { |
| 322 | switch(errorCode) |
| 323 | { |
| 324 | case EGL_NOT_INITIALIZED: TRACE("\t! Error generated: not initialized\n"); break; |
| 325 | case EGL_BAD_ACCESS: TRACE("\t! Error generated: bad access\n"); break; |
| 326 | case EGL_BAD_ALLOC: TRACE("\t! Error generated: bad alloc\n"); break; |
| 327 | case EGL_BAD_ATTRIBUTE: TRACE("\t! Error generated: bad attribute\n"); break; |
| 328 | case EGL_BAD_CONFIG: TRACE("\t! Error generated: bad config\n"); break; |
| 329 | case EGL_BAD_CONTEXT: TRACE("\t! Error generated: bad context\n"); break; |
| 330 | case EGL_BAD_CURRENT_SURFACE: TRACE("\t! Error generated: bad current surface\n"); break; |
| 331 | case EGL_BAD_DISPLAY: TRACE("\t! Error generated: bad display\n"); break; |
| 332 | case EGL_BAD_MATCH: TRACE("\t! Error generated: bad match\n"); break; |
| 333 | case EGL_BAD_NATIVE_PIXMAP: TRACE("\t! Error generated: bad native pixmap\n"); break; |
| 334 | case EGL_BAD_NATIVE_WINDOW: TRACE("\t! Error generated: bad native window\n"); break; |
| 335 | case EGL_BAD_PARAMETER: TRACE("\t! Error generated: bad parameter\n"); break; |
| 336 | case EGL_BAD_SURFACE: TRACE("\t! Error generated: bad surface\n"); break; |
| 337 | case EGL_CONTEXT_LOST: TRACE("\t! Error generated: context lost\n"); break; |
| 338 | default: TRACE("\t! Error generated: <0x%X>\n", errorCode); break; |
| 339 | } |
| 340 | } |
| 341 | } |
Chris Forbes | 1aae88c | 2018-09-11 17:31:52 -0700 | [diff] [blame] | 342 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 343 | } |
| 344 | |
| 345 | namespace egl |
| 346 | { |
Nicolas Capens | 38a9b3c | 2019-09-10 16:35:24 -0400 | [diff] [blame] | 347 | EGLint EGLAPIENTRY GetError(void); |
| 348 | EGLDisplay EGLAPIENTRY GetDisplay(EGLNativeDisplayType display_id); |
| 349 | EGLBoolean EGLAPIENTRY Initialize(EGLDisplay dpy, EGLint *major, EGLint *minor); |
| 350 | EGLBoolean EGLAPIENTRY Terminate(EGLDisplay dpy); |
| 351 | const char *EGLAPIENTRY QueryString(EGLDisplay dpy, EGLint name); |
| 352 | EGLBoolean EGLAPIENTRY GetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); |
| 353 | EGLBoolean EGLAPIENTRY ChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); |
| 354 | EGLBoolean EGLAPIENTRY GetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); |
| 355 | EGLSurface EGLAPIENTRY CreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType window, const EGLint *attrib_list); |
| 356 | EGLSurface EGLAPIENTRY CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); |
| 357 | EGLSurface EGLAPIENTRY CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); |
| 358 | EGLBoolean EGLAPIENTRY DestroySurface(EGLDisplay dpy, EGLSurface surface); |
| 359 | EGLBoolean EGLAPIENTRY QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); |
| 360 | EGLBoolean EGLAPIENTRY BindAPI(EGLenum api); |
| 361 | EGLenum EGLAPIENTRY QueryAPI(void); |
| 362 | EGLBoolean EGLAPIENTRY WaitClient(void); |
| 363 | EGLBoolean EGLAPIENTRY ReleaseThread(void); |
| 364 | EGLSurface EGLAPIENTRY CreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); |
| 365 | EGLBoolean EGLAPIENTRY SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); |
| 366 | EGLBoolean EGLAPIENTRY BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); |
| 367 | EGLBoolean EGLAPIENTRY ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); |
| 368 | EGLBoolean EGLAPIENTRY SwapInterval(EGLDisplay dpy, EGLint interval); |
| 369 | EGLContext EGLAPIENTRY CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); |
| 370 | EGLBoolean EGLAPIENTRY DestroyContext(EGLDisplay dpy, EGLContext ctx); |
| 371 | EGLBoolean EGLAPIENTRY MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); |
| 372 | EGLContext EGLAPIENTRY GetCurrentContext(void); |
| 373 | EGLSurface EGLAPIENTRY GetCurrentSurface(EGLint readdraw); |
| 374 | EGLDisplay EGLAPIENTRY GetCurrentDisplay(void); |
| 375 | EGLBoolean EGLAPIENTRY QueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); |
| 376 | EGLBoolean EGLAPIENTRY WaitGL(void); |
| 377 | EGLBoolean EGLAPIENTRY WaitNative(EGLint engine); |
| 378 | EGLBoolean EGLAPIENTRY SwapBuffers(EGLDisplay dpy, EGLSurface surface); |
| 379 | EGLBoolean EGLAPIENTRY CopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); |
| 380 | EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); |
| 381 | EGLImageKHR EGLAPIENTRY CreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); |
| 382 | EGLBoolean EGLAPIENTRY DestroyImageKHR(EGLDisplay dpy, EGLImageKHR image); |
| 383 | EGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list); |
| 384 | EGLDisplay EGLAPIENTRY GetPlatformDisplay(EGLenum platform, void *native_display, const EGLAttrib *attrib_list); |
| 385 | EGLSurface EGLAPIENTRY CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); |
| 386 | EGLSurface EGLAPIENTRY CreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); |
| 387 | EGLSurface EGLAPIENTRY CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list); |
| 388 | EGLSurface EGLAPIENTRY CreatePlatformPixmapSurface(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); |
| 389 | EGLSyncKHR EGLAPIENTRY CreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); |
| 390 | EGLSyncKHR EGLAPIENTRY CreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); |
| 391 | EGLBoolean EGLAPIENTRY DestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); |
| 392 | EGLint EGLAPIENTRY ClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); |
| 393 | EGLBoolean EGLAPIENTRY GetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); |
| 394 | EGLBoolean EGLAPIENTRY GetSyncAttrib(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLAttrib *value); |
| 395 | __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *procname); |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | extern "C" |
| 399 | { |
| 400 | EGLAPI EGLint EGLAPIENTRY eglGetError(void) |
| 401 | { |
| 402 | return egl::GetError(); |
| 403 | } |
| 404 | |
| 405 | EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id) |
| 406 | { |
| 407 | return egl::GetDisplay(display_id); |
| 408 | } |
| 409 | |
| 410 | EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) |
| 411 | { |
| 412 | return egl::Initialize(dpy, major, minor); |
| 413 | } |
| 414 | |
| 415 | EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy) |
| 416 | { |
| 417 | return egl::Terminate(dpy); |
| 418 | } |
| 419 | |
| 420 | EGLAPI const char *EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name) |
| 421 | { |
| 422 | return egl::QueryString(dpy, name); |
| 423 | } |
| 424 | |
| 425 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) |
| 426 | { |
| 427 | return egl::GetConfigs(dpy, configs, config_size, num_config); |
| 428 | } |
| 429 | |
| 430 | EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config) |
| 431 | { |
| 432 | return egl::ChooseConfig(dpy, attrib_list, configs, config_size, num_config); |
| 433 | } |
| 434 | |
| 435 | EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) |
| 436 | { |
| 437 | return egl::GetConfigAttrib(dpy, config, attribute, value); |
| 438 | } |
| 439 | |
| 440 | EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType window, const EGLint *attrib_list) |
| 441 | { |
| 442 | return egl::CreateWindowSurface(dpy, config, window, attrib_list); |
| 443 | } |
| 444 | |
| 445 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) |
| 446 | { |
| 447 | return egl::CreatePbufferSurface(dpy, config, attrib_list); |
| 448 | } |
| 449 | |
| 450 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list) |
| 451 | { |
| 452 | return egl::CreatePixmapSurface(dpy, config, pixmap, attrib_list); |
| 453 | } |
| 454 | |
| 455 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface) |
| 456 | { |
| 457 | return egl::DestroySurface(dpy, surface); |
| 458 | } |
| 459 | |
| 460 | EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) |
| 461 | { |
| 462 | return egl::QuerySurface(dpy, surface, attribute, value); |
| 463 | } |
| 464 | |
| 465 | EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api) |
| 466 | { |
| 467 | return egl::BindAPI(api); |
| 468 | } |
| 469 | |
| 470 | EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void) |
| 471 | { |
| 472 | return egl::QueryAPI(); |
| 473 | } |
| 474 | |
| 475 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void) |
| 476 | { |
| 477 | return egl::WaitClient(); |
| 478 | } |
| 479 | |
| 480 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void) |
| 481 | { |
| 482 | return egl::ReleaseThread(); |
| 483 | } |
| 484 | |
| 485 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list) |
| 486 | { |
| 487 | return egl::CreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list); |
| 488 | } |
| 489 | |
| 490 | EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) |
| 491 | { |
| 492 | return egl::SurfaceAttrib(dpy, surface, attribute, value); |
| 493 | } |
| 494 | |
| 495 | EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) |
| 496 | { |
| 497 | return egl::BindTexImage(dpy, surface, buffer); |
| 498 | } |
| 499 | |
| 500 | EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) |
| 501 | { |
| 502 | return egl::ReleaseTexImage(dpy, surface, buffer); |
| 503 | } |
| 504 | |
| 505 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval) |
| 506 | { |
| 507 | return egl::SwapInterval(dpy, interval); |
| 508 | } |
| 509 | |
| 510 | EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list) |
| 511 | { |
| 512 | return egl::CreateContext(dpy, config, share_context, attrib_list); |
| 513 | } |
| 514 | |
| 515 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx) |
| 516 | { |
| 517 | return egl::DestroyContext(dpy, ctx); |
| 518 | } |
| 519 | |
| 520 | EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) |
| 521 | { |
| 522 | return egl::MakeCurrent(dpy, draw, read, ctx); |
| 523 | } |
| 524 | |
| 525 | EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void) |
| 526 | { |
| 527 | return egl::GetCurrentContext(); |
| 528 | } |
| 529 | |
| 530 | EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw) |
| 531 | { |
| 532 | return egl::GetCurrentSurface(readdraw); |
| 533 | } |
| 534 | |
| 535 | EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void) |
| 536 | { |
| 537 | return egl::GetCurrentDisplay(); |
| 538 | } |
| 539 | |
| 540 | EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value) |
| 541 | { |
| 542 | return egl::QueryContext(dpy, ctx, attribute, value); |
| 543 | } |
| 544 | |
| 545 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void) |
| 546 | { |
| 547 | return egl::WaitClient(); |
| 548 | } |
| 549 | |
| 550 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine) |
| 551 | { |
| 552 | return egl::WaitNative(engine); |
| 553 | } |
| 554 | |
| 555 | EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) |
| 556 | { |
| 557 | return egl::SwapBuffers(dpy, surface); |
| 558 | } |
| 559 | |
| 560 | EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) |
| 561 | { |
| 562 | return egl::CopyBuffers(dpy, surface, target); |
| 563 | } |
| 564 | |
| 565 | EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list) |
| 566 | { |
| 567 | return egl::CreateImageKHR(dpy, ctx, target, buffer, attrib_list); |
| 568 | } |
| 569 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 570 | EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list) |
| 571 | { |
| 572 | return egl::CreateImage(dpy, ctx, target, buffer, attrib_list); |
| 573 | } |
| 574 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 575 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image) |
| 576 | { |
| 577 | return egl::DestroyImageKHR(dpy, image); |
| 578 | } |
| 579 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 580 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage(EGLDisplay dpy, EGLImageKHR image) |
| 581 | { |
| 582 | return egl::DestroyImageKHR(dpy, image); |
| 583 | } |
| 584 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 585 | EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list) |
| 586 | { |
| 587 | return egl::GetPlatformDisplayEXT(platform, native_display, attrib_list); |
| 588 | } |
| 589 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 590 | EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform, void *native_display, const EGLAttrib *attrib_list) |
| 591 | { |
| 592 | return egl::GetPlatformDisplay(platform, native_display, attrib_list); |
| 593 | } |
| 594 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 595 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list) |
| 596 | { |
| 597 | return egl::CreatePlatformWindowSurfaceEXT(dpy, config, native_window, attrib_list); |
| 598 | } |
| 599 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 600 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list) |
| 601 | { |
| 602 | return egl::CreatePlatformWindowSurface(dpy, config, native_window, attrib_list); |
| 603 | } |
| 604 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 605 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list) |
| 606 | { |
| 607 | return egl::CreatePlatformPixmapSurfaceEXT(dpy, config, native_pixmap, attrib_list); |
| 608 | } |
| 609 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 610 | EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list) |
| 611 | { |
| 612 | return egl::CreatePlatformPixmapSurface(dpy, config, native_pixmap, attrib_list); |
| 613 | } |
| 614 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 615 | EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list) |
| 616 | { |
| 617 | return egl::CreateSyncKHR(dpy, type, attrib_list); |
| 618 | } |
| 619 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 620 | EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list) |
| 621 | { |
| 622 | return egl::CreateSync(dpy, type, attrib_list); |
| 623 | } |
| 624 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 625 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) |
| 626 | { |
| 627 | return egl::DestroySyncKHR(dpy, sync); |
| 628 | } |
| 629 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 630 | EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync(EGLDisplay dpy, EGLSyncKHR sync) |
| 631 | { |
| 632 | return egl::DestroySyncKHR(dpy, sync); |
| 633 | } |
| 634 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 635 | EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) |
| 636 | { |
| 637 | return egl::ClientWaitSyncKHR(dpy, sync, flags, timeout); |
| 638 | } |
| 639 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 640 | EGLAPI EGLint EGLAPIENTRY eglClientWaitSync(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) |
| 641 | { |
| 642 | return egl::ClientWaitSyncKHR(dpy, sync, flags, timeout); |
| 643 | } |
| 644 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 645 | EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value) |
| 646 | { |
| 647 | return egl::GetSyncAttribKHR(dpy, sync, attribute, value); |
| 648 | } |
| 649 | |
Nicolas Capens | 48908cb | 2018-01-08 13:07:14 -0500 | [diff] [blame] | 650 | EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLAttrib *value) |
| 651 | { |
| 652 | return egl::GetSyncAttrib(dpy, sync, attribute, value); |
| 653 | } |
| 654 | |
| 655 | EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags) |
| 656 | { |
| 657 | return egl::ClientWaitSyncKHR(dpy, sync, flags, EGL_FOREVER_KHR); |
| 658 | } |
| 659 | |
| 660 | EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags) |
| 661 | { |
| 662 | return egl::ClientWaitSyncKHR(dpy, sync, flags, EGL_FOREVER_KHR); |
| 663 | } |
| 664 | |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 665 | EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname) |
| 666 | { |
| 667 | return egl::GetProcAddress(procname); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | LibEGLexports::LibEGLexports() |
| 672 | { |
| 673 | this->eglGetError = egl::GetError; |
| 674 | this->eglGetDisplay = egl::GetDisplay; |
| 675 | this->eglInitialize = egl::Initialize; |
| 676 | this->eglTerminate = egl::Terminate; |
| 677 | this->eglQueryString = egl::QueryString; |
| 678 | this->eglGetConfigs = egl::GetConfigs; |
| 679 | this->eglChooseConfig = egl::ChooseConfig; |
| 680 | this->eglGetConfigAttrib = egl::GetConfigAttrib; |
| 681 | this->eglCreateWindowSurface = egl::CreateWindowSurface; |
| 682 | this->eglCreatePbufferSurface = egl::CreatePbufferSurface; |
| 683 | this->eglCreatePixmapSurface = egl::CreatePixmapSurface; |
| 684 | this->eglDestroySurface = egl::DestroySurface; |
| 685 | this->eglQuerySurface = egl::QuerySurface; |
| 686 | this->eglBindAPI = egl::BindAPI; |
| 687 | this->eglQueryAPI = egl::QueryAPI; |
| 688 | this->eglWaitClient = egl::WaitClient; |
| 689 | this->eglReleaseThread = egl::ReleaseThread; |
| 690 | this->eglCreatePbufferFromClientBuffer = egl::CreatePbufferFromClientBuffer; |
| 691 | this->eglSurfaceAttrib = egl::SurfaceAttrib; |
| 692 | this->eglBindTexImage = egl::BindTexImage; |
| 693 | this->eglReleaseTexImage = egl::ReleaseTexImage; |
| 694 | this->eglSwapInterval = egl::SwapInterval; |
| 695 | this->eglCreateContext = egl::CreateContext; |
| 696 | this->eglDestroyContext = egl::DestroyContext; |
| 697 | this->eglMakeCurrent = egl::MakeCurrent; |
| 698 | this->eglGetCurrentContext = egl::GetCurrentContext; |
| 699 | this->eglGetCurrentSurface = egl::GetCurrentSurface; |
| 700 | this->eglGetCurrentDisplay = egl::GetCurrentDisplay; |
| 701 | this->eglQueryContext = egl::QueryContext; |
| 702 | this->eglWaitGL = egl::WaitGL; |
| 703 | this->eglWaitNative = egl::WaitNative; |
| 704 | this->eglSwapBuffers = egl::SwapBuffers; |
| 705 | this->eglCopyBuffers = egl::CopyBuffers; |
| 706 | this->eglCreateImageKHR = egl::CreateImageKHR; |
| 707 | this->eglDestroyImageKHR = egl::DestroyImageKHR; |
| 708 | this->eglGetProcAddress = egl::GetProcAddress; |
| 709 | this->eglCreateSyncKHR = egl::CreateSyncKHR; |
| 710 | this->eglDestroySyncKHR = egl::DestroySyncKHR; |
| 711 | this->eglClientWaitSyncKHR = egl::ClientWaitSyncKHR; |
| 712 | this->eglGetSyncAttribKHR = egl::GetSyncAttribKHR; |
| 713 | |
| 714 | this->clientGetCurrentContext = egl::getCurrentContext; |
| 715 | } |
| 716 | |
Alexis Hetu | 2a0def7 | 2018-05-14 08:16:05 -0400 | [diff] [blame] | 717 | extern "C" EGLAPI LibEGLexports *libEGL_swiftshader() |
Nicolas Capens | 0bac285 | 2016-05-07 06:09:58 -0400 | [diff] [blame] | 718 | { |
| 719 | static LibEGLexports libEGL; |
| 720 | return &libEGL; |
| 721 | } |
| 722 | |
Nicolas Capens | 5e1520f | 2018-07-03 16:13:28 -0400 | [diff] [blame] | 723 | LibGLESv2 libGLESv2; |