Commit 4638dc9d by Jamie Madill Committed by Commit Bot

Re-land "Load correct libGLESv2 on Linux and Mac."

Re-land fixes build to ensure commit_id is built before libEGL. libEGL was implicitly loading libGLESv2 on startup. This is bad because on platforms like Linux and Mac we could sometimes use the incorrect rpath. This in turn meant we needed workarounds like using "_angle" extensions to our shared objects to get the correct loading behaviour. Fix this by loading libGLESv2 dynamically in libEGL. We build the loader automatically from egl.xml. The loader itself is lazily initialized on every EGL entry point call. This is necessary because on Linux, etc, there is no equivalent to Windows' DLLMain. We also use an EGL.h with different generation options so we have the proper function pointer types. A README is included for instructions on how to regenerate EGL.h. The entry point generation script is refactored into a helper class that is used in the loader generator. Also adds the libGLESv2 versions of the EGL entry points in the DEF file on Windows. This allows them to be imported properly in 32-bit configurations. Also fixes up some errors in ANGLE's entry point definitions. Also includes a clang-format disable rule for the Khronos headers. This CL will help us to run ANGLE tests against native drivers. Bug: angleproject:2871 Bug: chromium:915731 Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab Reviewed-on: https://chromium-review.googlesource.com/c/1380511Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 720ca449
...@@ -59,6 +59,23 @@ config("external_config") { ...@@ -59,6 +59,23 @@ config("external_config") {
include_dirs = [ "include" ] include_dirs = [ "include" ]
} }
# Prevent the GL headers from redeclaring ANGLE entry points.
config("no_gl_prototypes") {
defines = [
"GL_GLES_PROTOTYPES=0",
"EGL_EGL_PROTOTYPES=0",
]
}
config("gl_prototypes") {
defines = [
"GL_GLES_PROTOTYPES=1",
"EGL_EGL_PROTOTYPES=1",
"GL_GLEXT_PROTOTYPES",
"EGL_EGLEXT_PROTOTYPES",
]
}
# This config is applied to internal Angle targets (not pushed to dependents). # This config is applied to internal Angle targets (not pushed to dependents).
config("internal_config") { config("internal_config") {
include_dirs = [ include_dirs = [
...@@ -66,11 +83,7 @@ config("internal_config") { ...@@ -66,11 +83,7 @@ config("internal_config") {
"src", "src",
] ]
# Prevent the GL headers from redeclaring ANGLE entry points. defines = []
defines = [
"GL_GLEXT_PROTOTYPES",
"EGL_EGLEXT_PROTOTYPES",
]
if (angle_64bit_current_cpu) { if (angle_64bit_current_cpu) {
defines += [ "ANGLE_IS_64_BIT_CPU" ] defines += [ "ANGLE_IS_64_BIT_CPU" ]
...@@ -182,20 +195,18 @@ config("angle_common_config") { ...@@ -182,20 +195,18 @@ config("angle_common_config") {
} }
} }
static_library("angle_common") { source_set("angle_system_utils") {
sources = libangle_common_sources sources = angle_system_utils_sources
if (is_linux || is_android || is_fuchsia) {
sources += libangle_common_linux_sources
}
if (is_mac) { configs -= angle_undefine_configs
sources += libangle_common_mac_sources configs += [
} ":extra_warnings",
":internal_config",
]
}
if (is_win) { static_library("angle_common") {
sources += libangle_common_win_sources sources = libangle_common_sources
}
configs -= angle_undefine_configs configs -= angle_undefine_configs
configs += [ configs += [
...@@ -206,7 +217,8 @@ static_library("angle_common") { ...@@ -206,7 +217,8 @@ static_library("angle_common") {
] ]
public_deps = [ public_deps = [
":commit_id", ":angle_system_utils",
":angle_version",
":includes", ":includes",
] ]
public_configs = [ ":angle_common_config" ] public_configs = [ ":angle_common_config" ]
...@@ -386,12 +398,6 @@ config("commit_id_config") { ...@@ -386,12 +398,6 @@ config("commit_id_config") {
visibility = [ ":commit_id" ] visibility = [ ":commit_id" ]
} }
source_set("angle_version") {
sources = [
"src/common/version.h",
]
}
commit_id_output_file = "$root_gen_dir/angle/id/commit.h" commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
if (angle_use_commit_id) { if (angle_use_commit_id) {
action("commit_id") { action("commit_id") {
...@@ -412,9 +418,6 @@ if (angle_use_commit_id) { ...@@ -412,9 +418,6 @@ if (angle_use_commit_id) {
] ]
public_configs = [ ":commit_id_config" ] public_configs = [ ":commit_id_config" ]
public_deps = [
":angle_version",
]
} }
} else { } else {
copy("commit_id") { copy("commit_id") {
...@@ -428,6 +431,16 @@ if (angle_use_commit_id) { ...@@ -428,6 +431,16 @@ if (angle_use_commit_id) {
} }
} }
source_set("angle_version") {
sources = [
"src/common/version.h",
]
public_deps = [
":commit_id",
]
}
config("libANGLE_config") { config("libANGLE_config") {
cflags = [] cflags = []
defines = [] defines = []
...@@ -511,7 +524,7 @@ static_library("libANGLE") { ...@@ -511,7 +524,7 @@ static_library("libANGLE") {
public_deps = [ public_deps = [
":angle_common", ":angle_common",
":angle_gpu_info_util", ":angle_gpu_info_util",
":commit_id", ":angle_version",
":translator", ":translator",
] ]
deps = [ deps = [
...@@ -640,6 +653,13 @@ config("shared_library_public_config") { ...@@ -640,6 +653,13 @@ config("shared_library_public_config") {
} }
} }
config("library_name_config") {
defines = [
"ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"",
"ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"",
]
}
# This config controls export definitions on ANGLE API calls. # This config controls export definitions on ANGLE API calls.
config("angle_static") { config("angle_static") {
defines = [ defines = [
...@@ -676,6 +696,7 @@ shared_library("libGLESv2${angle_libs_suffix}") { ...@@ -676,6 +696,7 @@ shared_library("libGLESv2${angle_libs_suffix}") {
":angle_gl_visibility_config", ":angle_gl_visibility_config",
":debug_annotations_config", ":debug_annotations_config",
":extra_warnings", ":extra_warnings",
":gl_prototypes",
":internal_config", ":internal_config",
] ]
...@@ -687,7 +708,7 @@ shared_library("libGLESv2${angle_libs_suffix}") { ...@@ -687,7 +708,7 @@ shared_library("libGLESv2${angle_libs_suffix}") {
] ]
public_deps = [ public_deps = [
":commit_id", ":angle_version",
] ]
} }
...@@ -762,6 +783,28 @@ static_library("libGLESv1_CM_static") { ...@@ -762,6 +783,28 @@ static_library("libGLESv1_CM_static") {
] ]
} }
config("libEGL_egl_loader_config") {
defines = [ "ANGLE_USE_EGL_LOADER" ]
}
source_set("libEGL_egl_loader") {
sources = [
"src/libEGL/egl_loader_autogen.cpp",
"src/libEGL/egl_loader_autogen.h",
]
public_configs = [
":libEGL_egl_loader_config",
":gl_prototypes",
":extra_warnings",
":internal_config",
]
deps = [
":includes",
]
}
shared_library("libEGL${angle_libs_suffix}") { shared_library("libEGL${angle_libs_suffix}") {
sources = libegl_sources sources = libegl_sources
...@@ -774,6 +817,7 @@ shared_library("libEGL${angle_libs_suffix}") { ...@@ -774,6 +817,7 @@ shared_library("libEGL${angle_libs_suffix}") {
":debug_annotations_config", ":debug_annotations_config",
":extra_warnings", ":extra_warnings",
":internal_config", ":internal_config",
":library_name_config",
] ]
defines = [ "LIBEGL_IMPLEMENTATION" ] defines = [ "LIBEGL_IMPLEMENTATION" ]
...@@ -796,12 +840,18 @@ shared_library("libEGL${angle_libs_suffix}") { ...@@ -796,12 +840,18 @@ shared_library("libEGL${angle_libs_suffix}") {
} }
deps = [ deps = [
":libGLESv2${angle_libs_suffix}", ":angle_system_utils",
":angle_version",
":libEGL_egl_loader",
] ]
public_deps = [ public_deps = [
":includes", ":includes",
] ]
data_deps = [
":libGLESv2${angle_libs_suffix}",
]
} }
static_library("libEGL_static") { static_library("libEGL_static") {
...@@ -812,6 +862,7 @@ static_library("libEGL_static") { ...@@ -812,6 +862,7 @@ static_library("libEGL_static") {
":debug_annotations_config", ":debug_annotations_config",
":extra_warnings", ":extra_warnings",
":internal_config", ":internal_config",
":library_name_config",
] ]
public_configs = [ ":angle_static" ] public_configs = [ ":angle_static" ]
...@@ -896,6 +947,7 @@ foreach(is_shared_library, ...@@ -896,6 +947,7 @@ foreach(is_shared_library,
configs += [ configs += [
":debug_annotations_config", ":debug_annotations_config",
":extra_warnings", ":extra_warnings",
":gl_prototypes",
] ]
public_configs = [ public_configs = [
......
DisableFormat: true
# ANGLE EGL Headers
The EGL headers ANGLE uses are generated using the Khronos tools but modified to include function pointer types and function prototype guards.
### Regenerating EGL.h
1. Install **Python 3** (not 2) with the **lxml** addon. You can do this using `pip install lxml` from your Python's Scripts folder.
1. Clone [https://github.com/KhronosGroup/EGL-Registry.git](https://github.com/KhronosGroup/EGL-Registry.git).
1. Edit `EGL-Registry/api/genheaders.py`:
1. Look for the section titled `# EGL API - EGL/egl.h (no function pointers, yet @@@)`
1. Change `genFuncPointers = False,` to `genFuncPointers = True,`
1. Change `protectProto = False,` to `protectProto = 'nonzero',`
1. Change `protectProtoStr = 'EGL_EGLEXT_PROTOTYPES',` to `protectProtoStr = 'EGL_EGL_PROTOTYPES',`
1. Set your working directory to `EGL-Registry/api/`.
1. Run `python genheaders.py -registry egl.xml EGL/egl.h`
1. The generated header will now be in `EGL-Registry/api/EGL/egl.h`. You can copy the header over to this folder.
1. Also update `egl.xml` with the latest version from `EGL-Registry/api/`.
...@@ -28,17 +28,17 @@ extern "C" { ...@@ -28,17 +28,17 @@ extern "C" {
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/ */
/* /*
** This header is generated from the Khronos OpenGL / OpenGL ES XML ** This header is generated from the Khronos EGL XML API Registry.
** API Registry. The current version of the Registry, generator scripts ** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at ** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl ** http://www.khronos.org/registry/egl
** **
** Khronos $Git commit SHA1: bae3518c48 $ on $Git commit date: 2018-05-17 10:56:57 -0700 $ ** Khronos $Git commit SHA1: 4136522c4d $ on $Git commit date: 2018-12-06 03:51:22 -0800 $
*/ */
#include <EGL/eglplatform.h> #include <EGL/eglplatform.h>
/* Generated on date 20180517 */ /* Generated on date 20181214 */
/* Generated C header for: /* Generated C header for:
* API: egl * API: egl
...@@ -53,8 +53,8 @@ extern "C" { ...@@ -53,8 +53,8 @@ extern "C" {
#define EGL_VERSION_1_0 1 #define EGL_VERSION_1_0 1
typedef unsigned int EGLBoolean; typedef unsigned int EGLBoolean;
typedef void *EGLDisplay; typedef void *EGLDisplay;
#include <KHR/khrplatform.h>
#include <EGL/eglplatform.h> #include <EGL/eglplatform.h>
#include <KHR/khrplatform.h>
typedef void *EGLConfig; typedef void *EGLConfig;
typedef void *EGLSurface; typedef void *EGLSurface;
typedef void *EGLContext; typedef void *EGLContext;
...@@ -118,6 +118,31 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void); ...@@ -118,6 +118,31 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void);
#define EGL_VERSION 0x3054 #define EGL_VERSION 0x3054
#define EGL_WIDTH 0x3057 #define EGL_WIDTH 0x3057
#define EGL_WINDOW_BIT 0x0004 #define EGL_WINDOW_BIT 0x0004
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void);
typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw);
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id);
typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void);
typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine);
#if EGL_EGL_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
...@@ -142,6 +167,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface ...@@ -142,6 +167,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy); EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
#endif
#endif /* EGL_VERSION_1_0 */ #endif /* EGL_VERSION_1_0 */
#ifndef EGL_VERSION_1_1 #ifndef EGL_VERSION_1_1
...@@ -160,10 +186,16 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine); ...@@ -160,10 +186,16 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
#define EGL_TEXTURE_RGB 0x305D #define EGL_TEXTURE_RGB 0x305D
#define EGL_TEXTURE_RGBA 0x305E #define EGL_TEXTURE_RGBA 0x305E
#define EGL_TEXTURE_TARGET 0x3081 #define EGL_TEXTURE_TARGET 0x3081
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval);
#if EGL_EGL_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval); EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
#endif
#endif /* EGL_VERSION_1_1 */ #endif /* EGL_VERSION_1_1 */
#ifndef EGL_VERSION_1_2 #ifndef EGL_VERSION_1_2
...@@ -199,11 +231,18 @@ typedef void *EGLClientBuffer; ...@@ -199,11 +231,18 @@ typedef void *EGLClientBuffer;
#define EGL_SWAP_BEHAVIOR 0x3093 #define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_UNKNOWN EGL_CAST(EGLint,-1) #define EGL_UNKNOWN EGL_CAST(EGLint,-1)
#define EGL_VERTICAL_RESOLUTION 0x3091 #define EGL_VERTICAL_RESOLUTION 0x3091
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api);
typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void);
#if EGL_EGL_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api); EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void); EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
#endif
#endif /* EGL_VERSION_1_2 */ #endif /* EGL_VERSION_1_2 */
#ifndef EGL_VERSION_1_3 #ifndef EGL_VERSION_1_3
...@@ -232,7 +271,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void); ...@@ -232,7 +271,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
#define EGL_OPENGL_API 0x30A2 #define EGL_OPENGL_API 0x30A2
#define EGL_OPENGL_BIT 0x0008 #define EGL_OPENGL_BIT 0x0008
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void);
#if EGL_EGL_PROTOTYPES
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void); EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
#endif
#endif /* EGL_VERSION_1_4 */ #endif /* EGL_VERSION_1_4 */
#ifndef EGL_VERSION_1_5 #ifndef EGL_VERSION_1_5
...@@ -284,6 +326,17 @@ typedef void *EGLImage; ...@@ -284,6 +326,17 @@ typedef void *EGLImage;
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
#define EGL_IMAGE_PRESERVED 0x30D2 #define EGL_IMAGE_PRESERVED 0x30D2
#define EGL_NO_IMAGE EGL_CAST(EGLImage,0) #define EGL_NO_IMAGE EGL_CAST(EGLImage,0)
typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync);
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image);
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags);
#if EGL_EGL_PROTOTYPES
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
...@@ -294,6 +347,7 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *nat ...@@ -294,6 +347,7 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *nat
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags); EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
#endif
#endif /* EGL_VERSION_1_5 */ #endif /* EGL_VERSION_1_5 */
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -162,7 +162,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device); ...@@ -162,7 +162,7 @@ EGLAPI EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device);
#define EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE 0x3459 #define EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE 0x3459
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHEGETATTRIBANGLEPROC) (EGLDisplay dpy, EGLenum attrib); typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHEGETATTRIBANGLEPROC) (EGLDisplay dpy, EGLenum attrib);
typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEQUERYANGLEPROC) (EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize); typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEQUERYANGLEPROC) (EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize);
typedef void (EGLAPIENTRYP PFNEGPROGRAMCACHELPOPULATEANGLEPROC) (EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize); typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEPOPULATEANGLEPROC) (EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize);
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHERESIZEANGLEPROC) (EGLDisplay dpy, EGLint limit, EGLenum mode); typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHERESIZEANGLEPROC) (EGLDisplay dpy, EGLint limit, EGLenum mode);
#ifdef EGL_EGLEXT_PROTOTYPES #ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib); EGLAPI EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib);
...@@ -186,6 +186,22 @@ EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limi ...@@ -186,6 +186,22 @@ EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limi
#define EGL_EXTENSIONS_ENABLED_ANGLE 0x345F #define EGL_EXTENSIONS_ENABLED_ANGLE 0x345F
#endif /* EGL_ANGLE_create_context_extensions_enabled */ #endif /* EGL_ANGLE_create_context_extensions_enabled */
#ifndef EGL_CHROMIUM_get_sync_values
#define EGL_CHROMIUM_get_sync_values 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC) (EGLDisplay dpy,
EGLSurface surface,
EGLuint64KHR *ust,
EGLuint64KHR *msc,
EGLuint64KHR *sbc);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
EGLSurface surface,
EGLuint64KHR *ust,
EGLuint64KHR *msc,
EGLuint64KHR *sbc);
#endif
#endif /* EGL_CHROMIUM_get_sync_values */
// clang-format on // clang-format on
#endif // INCLUDE_EGL_EGLEXT_ANGLE_ #endif // INCLUDE_EGL_EGLEXT_ANGLE_
DisableFormat: true
DisableFormat: true
...@@ -36,7 +36,10 @@ static_library("sample_util") { ...@@ -36,7 +36,10 @@ static_library("sample_util") {
public_deps = [ public_deps = [
"../:angle_common", "../:angle_common",
] ]
public_configs = [ ":sample_util_config" ] public_configs = [
":sample_util_config",
"../:gl_prototypes",
]
} }
template("angle_sample") { template("angle_sample") {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<comment>
Copyright 2018 The ANGLE Project Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
egl_angle_ext.xml
Includes data used to auto-generate ANGLE classes.
</comment>
<!-- SECTION: EGL command definitions. -->
<commands namespace="EGL">
<command>
<proto><ptype>EGLDeviceEXT</ptype> <name>eglCreateDeviceANGLE</name></proto>
<param><ptype>EGLint</ptype> <name>device_type</name></param>
<param>void *<name>native_device</name></param>
<param>const <ptype>EGLattrib</ptype> *<name>attrib_list</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglReleaseDeviceANGLE</name></proto>
<param><ptype>EGLDeviceEXT</ptype> <name>device</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglCreateStreamProducerD3DTextureANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLStreamKHR</ptype> <name>stream</name></param>
<param>const <ptype>EGLAttrib</ptype> *<name>attrib_list</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglStreamPostD3DTextureANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLStreamKHR</ptype> <name>stream</name></param>
<param>void *<name>texture</name></param>
<param>const <ptype>EGLAttrib</ptype> *<name>attrib_list</name></param>
</command>
<command>
<proto><ptype>EGLBoolean</ptype> <name>eglGetSyncValuesCHROMIUM</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLSurface</ptype> <name>surface</name></param>
<param><ptype>EGLuint64KHR</ptype> *<name>ust</name></param>
<param><ptype>EGLuint64KHR</ptype> *<name>msc</name></param>
<param><ptype>EGLuint64KHR</ptype> *<name>sbc</name></param>
</command>
<command>
<proto><ptype>EGLint</ptype> <name>eglProgramCacheGetAttribANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLenum</ptype> <name>attrib</name></param>
</command>
<command>
<proto>void <name>eglProgramCacheQueryANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLint</ptype> <name>index</name></param>
<param>void *<name>key</name></param>
<param><ptype>EGLint</ptype> *<name>keysize</name></param>
<param>void *<name>binary</name></param>
<param><ptype>EGLint</ptype> *<name>binarysize</name></param>
</command>
<command>
<proto>void <name>eglProgramCachePopulateANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param>const void *<name>key</name></param>
<param><ptype>EGLint</ptype> <name>keysize</name></param>
<param>const void *<name>binary</name></param>
<param><ptype>EGLint</ptype> <name>binarysize</name></param>
</command>
<command>
<proto><ptype>EGLint</ptype> <name>eglProgramCacheResizeANGLE</name></proto>
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
<param><ptype>EGLint</ptype> <name>limit</name></param>
<param><ptype>EGLint</ptype> <name>mode</name></param>
</command>
</commands>
<!-- SECTION: ANGLE extension interface definitions -->
<extensions>
<extension name="EGL_ANGLE_device_creation" supported="egl">
<require>
<command name="eglCreateDeviceANGLE"/>
<command name="eglReleaseDeviceANGLE"/>
</require>
</extension>
<extension name="EGL_ANGLE_stream_producer_d3d_texture" supported="egl">
<require>
<command name="eglCreateStreamProducerD3DTextureANGLE"/>
<command name="eglStreamPostD3DTextureANGLE"/>
</require>
</extension>
<extension name="EGL_CHROMIUM_get_sync_values" supported="egl">
<require>
<command name="eglGetSyncValuesCHROMIUM"/>
</require>
</extension>
<extension name="EGL_ANGLE_program_cache_control" supported="egl">
<require>
<command name="eglProgramCacheGetAttribANGLE"/>
<command name="eglProgramCacheQueryANGLE"/>
<command name="eglProgramCachePopulateANGLE"/>
<command name="eglProgramCacheResizeANGLE"/>
</require>
</extension>
</extensions>
</registry>
#!/usr/bin/python2
#
# Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# generate_loader.py:
# Generates dynamic loaders for various binding interfaces.
import sys, os, pprint, json
from datetime import date
import registry_xml
# Handle inputs/outputs for run_code_generation.py's auto_script
if len(sys.argv) == 2 and sys.argv[1] == 'inputs':
inputs = [
'egl.xml',
'egl_angle_ext.xml',
'registry_xml.py',
]
print(",".join(inputs))
sys.exit(0)
def write_header(data_source_name, all_cmds, api, preamble, path, ns = "", prefix = None):
file_name = "%s_loader_autogen.h" % api
header_path = registry_xml.path_to(path, file_name)
if prefix == None:
prefix = api
def pre(cmd):
return prefix + cmd[len(api):]
with open(header_path, "w") as out:
var_protos = ["extern PFN%sPROC %s%s;" % (cmd.upper(), ns, pre(cmd)) for cmd in all_cmds]
loader_header = template_loader_h.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = data_source_name,
year = date.today().year,
function_pointers = "\n".join(var_protos),
api_upper = api.upper(),
api_lower = api,
preamble = preamble)
out.write(loader_header)
out.close()
def write_source(data_source_name, all_cmds, api, path, ns = "", prefix = None):
file_name = "%s_loader_autogen.cpp" % api
source_path = registry_xml.path_to(path, file_name)
if prefix == None:
prefix = api
def pre(cmd):
return prefix + cmd[len(api):]
with open(source_path, "w") as out:
var_defs = ["PFN%sPROC %s%s;" % (cmd.upper(), ns, pre(cmd)) for cmd in all_cmds]
setter = " %s%s = reinterpret_cast<PFN%sPROC>(loadProc(\"%s\"));"
setters = [setter % (ns, pre(cmd), cmd.upper(), pre(cmd)) for cmd in all_cmds]
loader_source = template_loader_cpp.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = data_source_name,
year = date.today().year,
function_pointers = "\n".join(var_defs),
set_pointers = "\n".join(setters),
api_upper = api.upper(),
api_lower = api)
out.write(loader_source)
out.close()
def gen_libegl_loader():
data_source_name = "egl.xml and egl_angle_ext.xml"
xml = registry_xml.RegistryXML("egl.xml", "egl_angle_ext.xml")
for major_version, minor_version in [[1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5]]:
annotation = "{}_{}".format(major_version, minor_version)
name_prefix = "EGL_VERSION_"
feature_name = "{}{}".format(name_prefix, annotation)
xml.AddCommands(feature_name, annotation)
xml.AddExtensionCommands(registry_xml.supported_egl_extensions, ['egl'])
all_cmds = xml.all_cmd_names.get_all_commands()
path = os.path.join("..", "src", "libEGL")
write_header(data_source_name, all_cmds, "egl", egl_preamble, path, "", "EGL_")
write_source(data_source_name, all_cmds, "egl", path, "", "EGL_")
# Generate simple function loader for the tests.
def main():
gen_libegl_loader()
gles_preamble = """#if defined(GL_GLES_PROTOTYPES)
#undef GL_GLES_PROTOTYPES
#endif // defined(GL_GLES_PROTOTYPES)
#if defined(GL_GLEXT_PROTOTYPES)
#undef GL_GLEXT_PROTOTYPES
#endif // defined(GL_GLEXT_PROTOTYPES)
#define GL_GLES_PROTOTYPES 0
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
#include <GLES3/gl31.h>
#include <GLES3/gl32.h>
"""
egl_preamble = """#include <EGL/egl.h>
#include <EGL/eglext.h>
"""
template_loader_h = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright {year} The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// {api_lower}_loader_autogen.h:
// Simple {api_upper} function loader.
#ifndef LIBEGL_{api_upper}_LOADER_AUTOGEN_H_
#define LIBEGL_{api_upper}_LOADER_AUTOGEN_H_
{preamble}
{function_pointers}
namespace angle
{{
using GenericProc = void (*)();
using LoadProc = GenericProc (KHRONOS_APIENTRY *)(const char *);
void Load{api_upper}(LoadProc loadProc);
}} // namespace angle
#endif // LIBEGL_{api_upper}_LOADER_AUTOGEN_H_
"""
template_loader_cpp = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
// Copyright {year} The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// {api_lower}_loader_autogen.cpp:
// Simple {api_upper} function loader.
#include "{api_lower}_loader_autogen.h"
{function_pointers}
namespace angle
{{
void Load{api_upper}(LoadProc loadProc)
{{
{set_pointers}
}}
}} // namespace angle
"""
if __name__ == '__main__':
sys.exit(main())
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
found in the LICENSE file. found in the LICENSE file.
gl_angle_ext.xml gl_angle_ext.xml
Includes data used to generate ANGLE extension entry points using generate_entry_points.py Includes data used to auto-generate ANGLE classes.
</comment> </comment>
<!-- SECTION: GL command definitions. --> <!-- SECTION: GL command definitions. -->
<commands namespace="GL"> <commands namespace="GL">
...@@ -917,19 +917,19 @@ ...@@ -917,19 +917,19 @@
</commands> </commands>
<!-- SECTION: ANGLE extension interface definitions --> <!-- SECTION: ANGLE extension interface definitions -->
<extensions> <extensions>
<extension name="GL_CHROMIUM_bind_uniform_location" supported='gl'> <extension name="GL_CHROMIUM_bind_uniform_location" supported='gles2'>
<require> <require>
<command name="glBindUniformLocationCHROMIUM"/> <command name="glBindUniformLocationCHROMIUM"/>
</require> </require>
</extension> </extension>
<extension name="GL_CHROMIUM_framebuffer_mixed_samples" supported='gl'> <extension name="GL_CHROMIUM_framebuffer_mixed_samples" supported='gles2'>
<require> <require>
<command name="glMatrixLoadfCHROMIUM"/> <command name="glMatrixLoadfCHROMIUM"/>
<command name="glMatrixLoadIdentityCHROMIUM"/> <command name="glMatrixLoadIdentityCHROMIUM"/>
<command name="glCoverageModulationCHROMIUM"/> <command name="glCoverageModulationCHROMIUM"/>
</require> </require>
</extension> </extension>
<extension name="GL_CHROMIUM_path_rendering" supported='gl'> <extension name="GL_CHROMIUM_path_rendering" supported='gles2'>
<require> <require>
<command name="glGenPathsCHROMIUM"/> <command name="glGenPathsCHROMIUM"/>
<command name="glDeletePathsCHROMIUM"/> <command name="glDeletePathsCHROMIUM"/>
...@@ -956,23 +956,23 @@ ...@@ -956,23 +956,23 @@
<command name="glProgramPathFragmentInputGenCHROMIUM"/> <command name="glProgramPathFragmentInputGenCHROMIUM"/>
</require> </require>
</extension> </extension>
<extension name="GL_CHROMIUM_copy_texture" supported='gl'> <extension name="GL_CHROMIUM_copy_texture" supported='gles2'>
<require> <require>
<command name="glCopyTextureCHROMIUM"/> <command name="glCopyTextureCHROMIUM"/>
<command name="glCopySubTextureCHROMIUM"/> <command name="glCopySubTextureCHROMIUM"/>
</require> </require>
</extension> </extension>
<extension name="GL_CHROMIUM_copy_compressed_texture" supported='gl'> <extension name="GL_CHROMIUM_copy_compressed_texture" supported='gles2'>
<require> <require>
<command name="glCompressedCopyTextureCHROMIUM"/> <command name="glCompressedCopyTextureCHROMIUM"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_request_extension" supported='gl'> <extension name="GL_ANGLE_request_extension" supported='gles2'>
<require> <require>
<command name="glRequestExtensionANGLE"/> <command name="glRequestExtensionANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_robust_client_memory" supported='gl'> <extension name="GL_ANGLE_robust_client_memory" supported='gles2'>
<require> <require>
<command name="glGetBooleanvRobustANGLE"/> <command name="glGetBooleanvRobustANGLE"/>
<command name="glGetBufferParameterivRobustANGLE"/> <command name="glGetBufferParameterivRobustANGLE"/>
...@@ -1040,19 +1040,19 @@ ...@@ -1040,19 +1040,19 @@
<command name="glGetQueryObjectui64vRobustANGLE"/> <command name="glGetQueryObjectui64vRobustANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_multiview" supported='gl'> <extension name="GL_ANGLE_multiview" supported='gles2'>
<require> <require>
<command name="glFramebufferTextureMultiviewSideBySideANGLE"/> <command name="glFramebufferTextureMultiviewSideBySideANGLE"/>
<command name="glFramebufferTextureMultiviewLayeredANGLE"/> <command name="glFramebufferTextureMultiviewLayeredANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_copy_texture_3d" supported='gl'> <extension name="GL_ANGLE_copy_texture_3d" supported='gles2'>
<require> <require>
<command name="glCopyTexture3DANGLE"/> <command name="glCopyTexture3DANGLE"/>
<command name="glCopySubTexture3DANGLE"/> <command name="glCopySubTexture3DANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_texture_multisample" supported='gl'> <extension name="GL_ANGLE_texture_multisample" supported='gles2'>
<require> <require>
<command name="glTexStorage2DMultisampleANGLE"/> <command name="glTexStorage2DMultisampleANGLE"/>
<command name="glGetTexLevelParameterivANGLE"/> <command name="glGetTexLevelParameterivANGLE"/>
...@@ -1061,7 +1061,7 @@ ...@@ -1061,7 +1061,7 @@
<command name="glSampleMaskiANGLE"/> <command name="glSampleMaskiANGLE"/>
</require> </require>
</extension> </extension>
<extension name="GL_ANGLE_multi_draw" supported='gl|gles2'> <extension name="GL_ANGLE_multi_draw" supported='gles2'>
<require> <require>
<command name="glMultiDrawArraysANGLE"/> <command name="glMultiDrawArraysANGLE"/>
<command name="glMultiDrawArraysInstancedANGLE"/> <command name="glMultiDrawArraysInstancedANGLE"/>
......
#!/usr/bin/python2
#
# Copyright 2018 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# registry_xml.py:
# Parses information from Khronos registry files..
# List of supported extensions. Add to this list to enable new extensions
# available in gl.xml.
import sys, os
import xml.etree.ElementTree as etree
angle_extensions = [
# ANGLE extensions
"GL_CHROMIUM_bind_uniform_location",
"GL_CHROMIUM_framebuffer_mixed_samples",
"GL_CHROMIUM_path_rendering",
"GL_CHROMIUM_copy_texture",
"GL_CHROMIUM_copy_compressed_texture",
"GL_ANGLE_request_extension",
"GL_ANGLE_robust_client_memory",
"GL_ANGLE_multiview",
"GL_ANGLE_copy_texture_3d",
]
gles1_extensions = [
# ES1 (Possibly the min set of extensions needed by Android)
"GL_OES_draw_texture",
"GL_OES_framebuffer_object",
"GL_OES_matrix_palette",
"GL_OES_point_size_array",
"GL_OES_query_matrix",
"GL_OES_texture_cube_map",
]
supported_extensions = sorted(angle_extensions + gles1_extensions + [
# ES2+
"GL_ANGLE_framebuffer_blit",
"GL_ANGLE_framebuffer_multisample",
"GL_ANGLE_instanced_arrays",
"GL_ANGLE_texture_multisample",
"GL_ANGLE_translated_shader_source",
"GL_EXT_blend_func_extended",
"GL_EXT_debug_marker",
"GL_EXT_discard_framebuffer",
"GL_EXT_disjoint_timer_query",
"GL_EXT_draw_buffers",
"GL_EXT_geometry_shader",
"GL_EXT_map_buffer_range",
"GL_EXT_occlusion_query_boolean",
"GL_EXT_robustness",
"GL_EXT_texture_storage",
"GL_KHR_debug",
"GL_NV_fence",
"GL_OES_EGL_image",
"GL_OES_get_program_binary",
"GL_OES_mapbuffer",
"GL_OES_texture_border_clamp",
"GL_OES_texture_storage_multisample_2d_array",
"GL_OES_vertex_array_object",
"GL_KHR_parallel_shader_compile",
"GL_ANGLE_multi_draw",
])
supported_egl_extensions = [
"EGL_ANDROID_blob_cache",
"EGL_ANDROID_get_frame_timestamps",
"EGL_ANDROID_presentation_time",
"EGL_ANGLE_d3d_share_handle_client_buffer",
"EGL_ANGLE_device_creation",
"EGL_ANGLE_device_d3d",
"EGL_ANGLE_program_cache_control",
"EGL_ANGLE_query_surface_pointer",
"EGL_ANGLE_stream_producer_d3d_texture",
"EGL_ANGLE_surface_d3d_texture_2d_share_handle",
"EGL_ANGLE_window_fixed_size",
"EGL_CHROMIUM_get_sync_values",
"EGL_EXT_create_context_robustness",
"EGL_EXT_device_query",
"EGL_EXT_platform_base",
"EGL_EXT_platform_device",
"EGL_KHR_debug",
"EGL_KHR_image",
"EGL_KHR_stream",
"EGL_KHR_stream_consumer_gltexture",
"EGL_KHR_swap_buffers_with_damage",
"EGL_NV_post_sub_buffer",
"EGL_NV_stream_consumer_gltexture_yuv",
]
# Strip these suffixes from Context entry point names. NV is excluded (for now).
strip_suffixes = ["ANGLE", "EXT", "KHR", "OES", "CHROMIUM"]
# The EGL_ANGLE_explicit_context extension is generated differently from other extensions.
# Toggle generation here.
support_EGL_ANGLE_explicit_context = True
def script_relative(path):
return os.path.join(os.path.dirname(sys.argv[0]), path)
def path_to(folder, file):
return os.path.join(script_relative(".."), "src", folder, file)
class GLCommandNames:
def __init__(self):
self.command_names = {}
def get_commands(self, version):
return self.command_names[version]
def get_all_commands(self):
cmd_names = []
# Combine all the version lists into a single list
for version, version_cmd_names in sorted(self.command_names.iteritems()):
cmd_names += version_cmd_names
return cmd_names
def add_commands(self, version, commands):
# Add key if it doesn't exist
if version not in self.command_names:
self.command_names[version] = []
# Add the commands that aren't duplicates
self.command_names[version] += commands
class RegistryXML:
def __init__(self, xml_file, ext_file = None):
tree = etree.parse(script_relative(xml_file))
self.root = tree.getroot()
if (ext_file):
self._AppendANGLEExts(ext_file)
self.all_commands = self.root.findall('commands/command')
self.all_cmd_names = GLCommandNames()
self.commands = {}
def _AppendANGLEExts(self, ext_file):
angle_ext_tree = etree.parse(script_relative(ext_file))
angle_ext_root = angle_ext_tree.getroot()
insertion_point = self.root.findall("./commands")[0]
for command in angle_ext_root.iter('commands'):
insertion_point.extend(command)
insertion_point = self.root.findall("./extensions")[0]
for extension in angle_ext_root.iter('extensions'):
insertion_point.extend(extension)
def AddCommands(self, feature_name, annotation):
xpath = ".//feature[@name='%s']//command" % feature_name
commands = [cmd.attrib['name'] for cmd in self.root.findall(xpath)]
# Remove commands that have already been processed
current_cmds = self.all_cmd_names.get_all_commands()
commands = [cmd for cmd in commands if cmd not in current_cmds]
self.all_cmd_names.add_commands(annotation, commands)
self.commands[annotation] = commands
def _ClassifySupport(self, supported):
if 'gles2' in supported:
return 'gl2ext'
elif 'gles1' in supported:
return 'glext'
elif 'egl' in supported:
return 'eglext'
elif 'wgl' in supported:
return 'wglext'
else:
assert False
return 'unknown'
def AddExtensionCommands(self, supported_extensions, apis):
# Use a first step to run through the extensions so we can generate them
# in sorted order.
self.ext_data = {}
self.ext_dupes = {}
ext_annotations = {}
for extension in self.root.findall("extensions/extension"):
extension_name = extension.attrib['name']
if not extension_name in supported_extensions:
continue
ext_annotations[extension_name] = self._ClassifySupport(extension.attrib['supported'])
ext_cmd_names = []
# There's an extra step here to filter out 'api=gl' extensions. This
# is necessary for handling KHR extensions, which have separate entry
# point signatures (without the suffix) for desktop GL. Note that this
# extra step is necessary because of Etree's limited Xpath support.
for require in extension.findall('require'):
if 'api' in require.attrib and require.attrib['api'] not in apis:
continue
# A special case for EXT_texture_storage
filter_out_comment = "Supported only if GL_EXT_direct_state_access is supported"
if 'comment' in require.attrib and require.attrib['comment'] == filter_out_comment:
continue
extension_commands = require.findall('command')
ext_cmd_names += [command.attrib['name'] for command in extension_commands]
self.ext_data[extension_name] = sorted(ext_cmd_names)
for extension_name, ext_cmd_names in sorted(self.ext_data.iteritems()):
# Detect and filter duplicate extensions.
dupes = []
for ext_cmd in ext_cmd_names:
if ext_cmd in self.all_cmd_names.get_all_commands():
dupes.append(ext_cmd)
for dupe in dupes:
ext_cmd_names.remove(dupe)
self.ext_data[extension_name] = sorted(ext_cmd_names)
self.ext_dupes[extension_name] = dupes
self.all_cmd_names.add_commands(ext_annotations[extension_name], ext_cmd_names)
...@@ -89,20 +89,16 @@ generators = { ...@@ -89,20 +89,16 @@ generators = {
], ],
'script': 'src/libANGLE/renderer/d3d/d3d11/gen_dxgi_support_tables.py', 'script': 'src/libANGLE/renderer/d3d/d3d11/gen_dxgi_support_tables.py',
}, },
'GL/EGL/WGL loader':
auto_script('scripts/generate_loader.py'),
'GL/EGL entry points':
auto_script('scripts/generate_entry_points.py'),
'GL copy conversion table': { 'GL copy conversion table': {
'inputs': [ 'inputs': [
'src/libANGLE/es3_copy_conversion_formats.json', 'src/libANGLE/es3_copy_conversion_formats.json',
], ],
'script': 'src/libANGLE/gen_copy_conversion_table.py', 'script': 'src/libANGLE/gen_copy_conversion_table.py',
}, },
'GL entry point': {
'inputs': [
'scripts/entry_point_packed_gl_enums.json',
'scripts/gl.xml',
'scripts/gl_angle_ext.xml',
],
'script': 'scripts/generate_entry_points.py',
},
'GL format map': { 'GL format map': {
'inputs': [ 'inputs': [
'src/libANGLE/es3_format_type_combinations.json', 'src/libANGLE/es3_format_type_combinations.json',
......
...@@ -49,20 +49,34 @@ ...@@ -49,20 +49,34 @@
"54608f6f7d9aa7c59a8458ccf3ab9935", "54608f6f7d9aa7c59a8458ccf3ab9935",
"GL copy conversion table:src/libANGLE/gen_copy_conversion_table.py": "GL copy conversion table:src/libANGLE/gen_copy_conversion_table.py":
"ac1afe23d9578bd1d2ef74f4a7aa927a", "ac1afe23d9578bd1d2ef74f4a7aa927a",
"GL entry point:scripts/entry_point_packed_gl_enums.json":
"0554a67f70407e82c872010014721099",
"GL entry point:scripts/generate_entry_points.py":
"460bbd980ec533628c5866142d22214d",
"GL entry point:scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708",
"GL entry point:scripts/gl_angle_ext.xml":
"9fd7020b8c63816320df0bdcd4582741",
"GL format map:src/libANGLE/es3_format_type_combinations.json": "GL format map:src/libANGLE/es3_format_type_combinations.json":
"a232823cd6430f14e28793ccabb968ee", "a232823cd6430f14e28793ccabb968ee",
"GL format map:src/libANGLE/format_map_data.json": "GL format map:src/libANGLE/format_map_data.json":
"779798d4879e5f73a5a108e3e3fd3095", "779798d4879e5f73a5a108e3e3fd3095",
"GL format map:src/libANGLE/gen_format_map.py": "GL format map:src/libANGLE/gen_format_map.py":
"a383ee79a7bf929d145165f3e76c1079", "a383ee79a7bf929d145165f3e76c1079",
"GL/EGL entry points:scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292",
"GL/EGL entry points:scripts/egl_angle_ext.xml":
"745534010f31fbe8e1a1fcddce15ed2d",
"GL/EGL entry points:scripts/entry_point_packed_gl_enums.json":
"0554a67f70407e82c872010014721099",
"GL/EGL entry points:scripts/generate_entry_points.py":
"9fc8f8bd28f5511108b9046d9066774c",
"GL/EGL entry points:scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708",
"GL/EGL entry points:scripts/gl_angle_ext.xml":
"35df932f522cd92fe1d4127bb9ab2c04",
"GL/EGL entry points:scripts/registry_xml.py":
"fcc6e75568f9c25b70f6692b9080a447",
"GL/EGL/WGL loader:scripts/egl.xml":
"842e24514c4cfe09fba703c17a0fd292",
"GL/EGL/WGL loader:scripts/egl_angle_ext.xml":
"745534010f31fbe8e1a1fcddce15ed2d",
"GL/EGL/WGL loader:scripts/generate_loader.py":
"408e48ccb03f7a92bcd49cd376943474",
"GL/EGL/WGL loader:scripts/registry_xml.py":
"fcc6e75568f9c25b70f6692b9080a447",
"OpenGL dispatch table:scripts/gl.xml": "OpenGL dispatch table:scripts/gl.xml":
"b470cb06b06cbbe7adb2c8129ec85708", "b470cb06b06cbbe7adb2c8129ec85708",
"OpenGL dispatch table:src/libANGLE/renderer/gl/generate_gl_dispatch_table.py": "OpenGL dispatch table:src/libANGLE/renderer/gl/generate_gl_dispatch_table.py":
...@@ -100,7 +114,7 @@ ...@@ -100,7 +114,7 @@
"packed enum:src/common/packed_gl_enums.json": "packed enum:src/common/packed_gl_enums.json":
"b54346c106ab4a7b0acb69eb65123c1a", "b54346c106ab4a7b0acb69eb65123c1a",
"proc table:src/libGLESv2/gen_proc_table.py": "proc table:src/libGLESv2/gen_proc_table.py":
"027bfd5a8a8dffe91f492bf199029cde", "ee265eada3dd238646010dd03874d242",
"proc table:src/libGLESv2/proc_table_data.json": "proc table:src/libGLESv2/proc_table_data.json":
"bcb5dbd7b57c0d56d5e8849c46d9c36e", "bcb5dbd7b57c0d56d5e8849c46d9c36e",
"uniform type:src/common/gen_uniform_type_table.py": "uniform type:src/common/gen_uniform_type_table.py":
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
namespace angle namespace angle
{ {
const char *GetExecutablePath(); const char *GetExecutablePath();
const char *GetExecutableDirectory(); const char *GetExecutableDirectory();
const char *GetSharedLibraryExtension(); const char *GetSharedLibraryExtension();
...@@ -26,6 +25,14 @@ std::string GetEnvironmentVar(const char *variableName); ...@@ -26,6 +25,14 @@ std::string GetEnvironmentVar(const char *variableName);
const char *GetPathSeparator(); const char *GetPathSeparator();
bool PrependPathToEnvironmentVar(const char *variableName, const char *path); bool PrependPathToEnvironmentVar(const char *variableName, const char *path);
class Library : angle::NonCopyable
{
public:
virtual ~Library() {}
virtual void *getSymbol(const char *symbolName) = 0;
};
Library *OpenSharedLibrary(const char *libraryName);
} // namespace angle } // namespace angle
#endif // COMMON_SYSTEM_UTILS_H_ #endif // COMMON_SYSTEM_UTILS_H_
...@@ -64,42 +64,4 @@ const char *GetSharedLibraryExtension() ...@@ -64,42 +64,4 @@ const char *GetSharedLibraryExtension()
{ {
return "so"; return "so";
} }
Optional<std::string> GetCWD()
{
std::array<char, 4096> pathBuf;
char *result = getcwd(pathBuf.data(), pathBuf.size());
if (result == nullptr)
{
return Optional<std::string>::Invalid();
}
return std::string(pathBuf.data());
}
bool SetCWD(const char *dirName)
{
return (chdir(dirName) == 0);
}
bool UnsetEnvironmentVar(const char *variableName)
{
return (unsetenv(variableName) == 0);
}
bool SetEnvironmentVar(const char *variableName, const char *value)
{
return (setenv(variableName, value, 1) == 0);
}
std::string GetEnvironmentVar(const char *variableName)
{
const char *value = getenv(variableName);
return (value == nullptr ? std::string() : std::string(value));
}
const char *GetPathSeparator()
{
return ":";
}
} // namespace angle } // namespace angle
...@@ -69,42 +69,4 @@ const char *GetSharedLibraryExtension() ...@@ -69,42 +69,4 @@ const char *GetSharedLibraryExtension()
{ {
return "dylib"; return "dylib";
} }
Optional<std::string> GetCWD()
{
std::array<char, 4096> pathBuf;
char *result = getcwd(pathBuf.data(), pathBuf.size());
if (result == nullptr)
{
return Optional<std::string>::Invalid();
}
return std::string(pathBuf.data());
}
bool SetCWD(const char *dirName)
{
return (chdir(dirName) == 0);
}
bool UnsetEnvironmentVar(const char *variableName)
{
return (unsetenv(variableName) == 0);
}
bool SetEnvironmentVar(const char *variableName, const char *value)
{
return (setenv(variableName, value, 1) == 0);
}
std::string GetEnvironmentVar(const char *variableName)
{
const char *value = getenv(variableName);
return (value == nullptr ? std::string() : std::string(value));
}
const char *GetPathSeparator()
{
return ":";
}
} // namespace angle } // namespace angle
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// system_utils_posix.cpp: Implementation of POSIX OS-specific functions.
#include "system_utils.h"
#include <array>
#include <dlfcn.h>
#include <unistd.h>
namespace angle
{
Optional<std::string> GetCWD()
{
std::array<char, 4096> pathBuf;
char *result = getcwd(pathBuf.data(), pathBuf.size());
if (result == nullptr)
{
return Optional<std::string>::Invalid();
}
return std::string(pathBuf.data());
}
bool SetCWD(const char *dirName)
{
return (chdir(dirName) == 0);
}
bool UnsetEnvironmentVar(const char *variableName)
{
return (unsetenv(variableName) == 0);
}
bool SetEnvironmentVar(const char *variableName, const char *value)
{
return (setenv(variableName, value, 1) == 0);
}
std::string GetEnvironmentVar(const char *variableName)
{
const char *value = getenv(variableName);
return (value == nullptr ? std::string() : std::string(value));
}
const char *GetPathSeparator()
{
return ":";
}
class PosixLibrary : public Library
{
public:
PosixLibrary(const char *libraryName)
{
char buffer[1000];
int ret = snprintf(buffer, 1000, "%s.%s", libraryName, GetSharedLibraryExtension());
if (ret > 0 && ret < 1000)
{
mModule = dlopen(buffer, RTLD_NOW);
}
}
~PosixLibrary() override
{
if (mModule)
{
dlclose(mModule);
}
}
void *getSymbol(const char *symbolName) override
{
if (!mModule)
{
return nullptr;
}
return dlsym(mModule, symbolName);
}
private:
void *mModule = nullptr;
};
Library *OpenSharedLibrary(const char *libraryName)
{
return new PosixLibrary(libraryName);
}
} // namespace angle
...@@ -101,4 +101,43 @@ const char *GetPathSeparator() ...@@ -101,4 +101,43 @@ const char *GetPathSeparator()
return ";"; return ";";
} }
class Win32Library : public Library
{
public:
Win32Library(const char *libraryName)
{
char buffer[MAX_PATH];
int ret = snprintf(buffer, MAX_PATH, "%s.%s", libraryName, GetSharedLibraryExtension());
if (ret > 0 && ret < MAX_PATH)
{
mModule = LoadLibraryA(buffer);
}
}
~Win32Library() override
{
if (mModule)
{
FreeLibrary(mModule);
}
}
void *getSymbol(const char *symbolName) override
{
if (!mModule)
{
return nullptr;
}
return reinterpret_cast<void *>(GetProcAddress(mModule, symbolName));
}
private:
HMODULE mModule = nullptr;
};
Library *OpenSharedLibrary(const char *libraryName)
{
return new Win32Library(libraryName);
}
} // namespace angle } // namespace angle
// GENERATED FILE - DO NOT EDIT.
// Generated by generate_loader.py using data from egl.xml and egl_angle_ext.xml.
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// egl_loader_autogen.h:
// Simple EGL function loader.
#ifndef LIBEGL_EGL_LOADER_AUTOGEN_H_
#define LIBEGL_EGL_LOADER_AUTOGEN_H_
#include <EGL/egl.h>
#include <EGL/eglext.h>
extern PFNEGLCHOOSECONFIGPROC EGL_ChooseConfig;
extern PFNEGLCOPYBUFFERSPROC EGL_CopyBuffers;
extern PFNEGLCREATECONTEXTPROC EGL_CreateContext;
extern PFNEGLCREATEPBUFFERSURFACEPROC EGL_CreatePbufferSurface;
extern PFNEGLCREATEPIXMAPSURFACEPROC EGL_CreatePixmapSurface;
extern PFNEGLCREATEWINDOWSURFACEPROC EGL_CreateWindowSurface;
extern PFNEGLDESTROYCONTEXTPROC EGL_DestroyContext;
extern PFNEGLDESTROYSURFACEPROC EGL_DestroySurface;
extern PFNEGLGETCONFIGATTRIBPROC EGL_GetConfigAttrib;
extern PFNEGLGETCONFIGSPROC EGL_GetConfigs;
extern PFNEGLGETCURRENTDISPLAYPROC EGL_GetCurrentDisplay;
extern PFNEGLGETCURRENTSURFACEPROC EGL_GetCurrentSurface;
extern PFNEGLGETDISPLAYPROC EGL_GetDisplay;
extern PFNEGLGETERRORPROC EGL_GetError;
extern PFNEGLGETPROCADDRESSPROC EGL_GetProcAddress;
extern PFNEGLINITIALIZEPROC EGL_Initialize;
extern PFNEGLMAKECURRENTPROC EGL_MakeCurrent;
extern PFNEGLQUERYCONTEXTPROC EGL_QueryContext;
extern PFNEGLQUERYSTRINGPROC EGL_QueryString;
extern PFNEGLQUERYSURFACEPROC EGL_QuerySurface;
extern PFNEGLSWAPBUFFERSPROC EGL_SwapBuffers;
extern PFNEGLTERMINATEPROC EGL_Terminate;
extern PFNEGLWAITGLPROC EGL_WaitGL;
extern PFNEGLWAITNATIVEPROC EGL_WaitNative;
extern PFNEGLBINDTEXIMAGEPROC EGL_BindTexImage;
extern PFNEGLRELEASETEXIMAGEPROC EGL_ReleaseTexImage;
extern PFNEGLSURFACEATTRIBPROC EGL_SurfaceAttrib;
extern PFNEGLSWAPINTERVALPROC EGL_SwapInterval;
extern PFNEGLBINDAPIPROC EGL_BindAPI;
extern PFNEGLQUERYAPIPROC EGL_QueryAPI;
extern PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC EGL_CreatePbufferFromClientBuffer;
extern PFNEGLRELEASETHREADPROC EGL_ReleaseThread;
extern PFNEGLWAITCLIENTPROC EGL_WaitClient;
extern PFNEGLGETCURRENTCONTEXTPROC EGL_GetCurrentContext;
extern PFNEGLCREATESYNCPROC EGL_CreateSync;
extern PFNEGLDESTROYSYNCPROC EGL_DestroySync;
extern PFNEGLCLIENTWAITSYNCPROC EGL_ClientWaitSync;
extern PFNEGLGETSYNCATTRIBPROC EGL_GetSyncAttrib;
extern PFNEGLCREATEIMAGEPROC EGL_CreateImage;
extern PFNEGLDESTROYIMAGEPROC EGL_DestroyImage;
extern PFNEGLGETPLATFORMDISPLAYPROC EGL_GetPlatformDisplay;
extern PFNEGLCREATEPLATFORMWINDOWSURFACEPROC EGL_CreatePlatformWindowSurface;
extern PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC EGL_CreatePlatformPixmapSurface;
extern PFNEGLWAITSYNCPROC EGL_WaitSync;
extern PFNEGLSETBLOBCACHEFUNCSANDROIDPROC EGL_SetBlobCacheFuncsANDROID;
extern PFNEGLGETCOMPOSITORTIMINGANDROIDPROC EGL_GetCompositorTimingANDROID;
extern PFNEGLGETCOMPOSITORTIMINGSUPPORTEDANDROIDPROC EGL_GetCompositorTimingSupportedANDROID;
extern PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROIDPROC EGL_GetFrameTimestampSupportedANDROID;
extern PFNEGLGETFRAMETIMESTAMPSANDROIDPROC EGL_GetFrameTimestampsANDROID;
extern PFNEGLGETNEXTFRAMEIDANDROIDPROC EGL_GetNextFrameIdANDROID;
extern PFNEGLPRESENTATIONTIMEANDROIDPROC EGL_PresentationTimeANDROID;
extern PFNEGLCREATEDEVICEANGLEPROC EGL_CreateDeviceANGLE;
extern PFNEGLRELEASEDEVICEANGLEPROC EGL_ReleaseDeviceANGLE;
extern PFNEGLPROGRAMCACHEGETATTRIBANGLEPROC EGL_ProgramCacheGetAttribANGLE;
extern PFNEGLPROGRAMCACHEPOPULATEANGLEPROC EGL_ProgramCachePopulateANGLE;
extern PFNEGLPROGRAMCACHEQUERYANGLEPROC EGL_ProgramCacheQueryANGLE;
extern PFNEGLPROGRAMCACHERESIZEANGLEPROC EGL_ProgramCacheResizeANGLE;
extern PFNEGLQUERYSURFACEPOINTERANGLEPROC EGL_QuerySurfacePointerANGLE;
extern PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC EGL_CreateStreamProducerD3DTextureANGLE;
extern PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC EGL_StreamPostD3DTextureANGLE;
extern PFNEGLGETSYNCVALUESCHROMIUMPROC EGL_GetSyncValuesCHROMIUM;
extern PFNEGLQUERYDEVICEATTRIBEXTPROC EGL_QueryDeviceAttribEXT;
extern PFNEGLQUERYDEVICESTRINGEXTPROC EGL_QueryDeviceStringEXT;
extern PFNEGLQUERYDISPLAYATTRIBEXTPROC EGL_QueryDisplayAttribEXT;
extern PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC EGL_CreatePlatformPixmapSurfaceEXT;
extern PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC EGL_CreatePlatformWindowSurfaceEXT;
extern PFNEGLGETPLATFORMDISPLAYEXTPROC EGL_GetPlatformDisplayEXT;
extern PFNEGLDEBUGMESSAGECONTROLKHRPROC EGL_DebugMessageControlKHR;
extern PFNEGLLABELOBJECTKHRPROC EGL_LabelObjectKHR;
extern PFNEGLQUERYDEBUGKHRPROC EGL_QueryDebugKHR;
extern PFNEGLCREATEIMAGEKHRPROC EGL_CreateImageKHR;
extern PFNEGLDESTROYIMAGEKHRPROC EGL_DestroyImageKHR;
extern PFNEGLCREATESTREAMKHRPROC EGL_CreateStreamKHR;
extern PFNEGLDESTROYSTREAMKHRPROC EGL_DestroyStreamKHR;
extern PFNEGLQUERYSTREAMKHRPROC EGL_QueryStreamKHR;
extern PFNEGLQUERYSTREAMU64KHRPROC EGL_QueryStreamu64KHR;
extern PFNEGLSTREAMATTRIBKHRPROC EGL_StreamAttribKHR;
extern PFNEGLSTREAMCONSUMERACQUIREKHRPROC EGL_StreamConsumerAcquireKHR;
extern PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC EGL_StreamConsumerGLTextureExternalKHR;
extern PFNEGLSTREAMCONSUMERRELEASEKHRPROC EGL_StreamConsumerReleaseKHR;
extern PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC EGL_SwapBuffersWithDamageKHR;
extern PFNEGLPOSTSUBBUFFERNVPROC EGL_PostSubBufferNV;
extern PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALATTRIBSNVPROC
EGL_StreamConsumerGLTextureExternalAttribsNV;
namespace angle
{
using GenericProc = void (*)();
using LoadProc = GenericProc(KHRONOS_APIENTRY *)(const char *);
void LoadEGL(LoadProc loadProc);
} // namespace angle
#endif // LIBEGL_EGL_LOADER_AUTOGEN_H_
...@@ -32,8 +32,6 @@ libangle_common_sources = [ ...@@ -32,8 +32,6 @@ libangle_common_sources = [
"src/common/platform.h", "src/common/platform.h",
"src/common/string_utils.cpp", "src/common/string_utils.cpp",
"src/common/string_utils.h", "src/common/string_utils.h",
"src/common/system_utils.cpp",
"src/common/system_utils.h",
"src/common/third_party/base/anglebase/base_export.h", "src/common/third_party/base/anglebase/base_export.h",
"src/common/third_party/base/anglebase/containers/mru_cache.h", "src/common/third_party/base/anglebase/containers/mru_cache.h",
"src/common/third_party/base/anglebase/logging.h", "src/common/third_party/base/anglebase/logging.h",
...@@ -56,9 +54,33 @@ libangle_common_sources = [ ...@@ -56,9 +54,33 @@ libangle_common_sources = [
"src/common/utilities.h", "src/common/utilities.h",
"src/common/vector_utils.h", "src/common/vector_utils.h",
] ]
libangle_common_linux_sources = [ "src/common/system_utils_linux.cpp" ]
libangle_common_mac_sources = [ "src/common/system_utils_mac.cpp" ] angle_system_utils_sources = [
libangle_common_win_sources = [ "src/common/system_utils_win.cpp" ] "src/common/Optional.h",
"src/common/angleutils.h",
"src/common/platform.h",
"src/common/system_utils.cpp",
"src/common/system_utils.h",
]
if (is_linux || is_android || is_fuchsia) {
angle_system_utils_sources += [
"src/common/system_utils_linux.cpp",
"src/common/system_utils_posix.cpp",
]
}
if (is_mac) {
angle_system_utils_sources += [
"src/common/system_utils_mac.cpp",
"src/common/system_utils_posix.cpp",
]
}
if (is_win) {
angle_system_utils_sources += [ "src/common/system_utils_win.cpp" ]
}
libangle_image_util_sources = [ libangle_image_util_sources = [
"src/image_util/copyimage.cpp", "src/image_util/copyimage.cpp",
"src/image_util/copyimage.h", "src/image_util/copyimage.h",
......
...@@ -67,7 +67,7 @@ for description, functions in json_data.iteritems(): ...@@ -67,7 +67,7 @@ for description, functions in json_data.iteritems():
if support_egl_ANGLE_explicit_context: if support_egl_ANGLE_explicit_context:
all_functions[function + "ContextANGLE"] = "gl::" + function[2:] + "ContextANGLE" all_functions[function + "ContextANGLE"] = "gl::" + function[2:] + "ContextANGLE"
elif function.startswith("egl"): elif function.startswith("egl"):
all_functions[function] = "egl::" + function[3:] all_functions[function] = "EGL_" + function[3:]
else: else:
all_functions[function] = function all_functions[function] = function
......
...@@ -1338,3 +1338,130 @@ EXPORTS ...@@ -1338,3 +1338,130 @@ EXPORTS
glViewportContextANGLE glViewportContextANGLE
glWaitSyncContextANGLE glWaitSyncContextANGLE
glWeightPointerOESContextANGLE glWeightPointerOESContextANGLE
; EGL 1.0
EGL_ChooseConfig
EGL_CopyBuffers
EGL_CreateContext
EGL_CreatePbufferSurface
EGL_CreatePixmapSurface
EGL_CreateWindowSurface
EGL_DestroyContext
EGL_DestroySurface
EGL_GetConfigAttrib
EGL_GetConfigs
EGL_GetCurrentDisplay
EGL_GetCurrentSurface
EGL_GetDisplay
EGL_GetError
EGL_GetProcAddress
EGL_Initialize
EGL_MakeCurrent
EGL_QueryContext
EGL_QueryString
EGL_QuerySurface
EGL_SwapBuffers
EGL_Terminate
EGL_WaitGL
EGL_WaitNative
; EGL 1.1
EGL_BindTexImage
EGL_ReleaseTexImage
EGL_SurfaceAttrib
EGL_SwapInterval
; EGL 1.2
EGL_BindAPI
EGL_CreatePbufferFromClientBuffer
EGL_QueryAPI
EGL_ReleaseThread
EGL_WaitClient
; EGL 1.4
EGL_GetCurrentContext
; EGL 1.5
EGL_ClientWaitSync
EGL_CreateImage
EGL_CreatePlatformPixmapSurface
EGL_CreatePlatformWindowSurface
EGL_CreateSync
EGL_DestroyImage
EGL_DestroySync
EGL_GetPlatformDisplay
EGL_GetSyncAttrib
EGL_WaitSync
; EGL_ANDROID_blob_cache
EGL_SetBlobCacheFuncsANDROID
; EGL_ANDROID_get_frame_timestamps
EGL_GetCompositorTimingANDROID
EGL_GetCompositorTimingSupportedANDROID
EGL_GetFrameTimestampSupportedANDROID
EGL_GetFrameTimestampsANDROID
EGL_GetNextFrameIdANDROID
; EGL_ANDROID_presentation_time
EGL_PresentationTimeANDROID
; EGL_ANGLE_device_creation
EGL_CreateDeviceANGLE
EGL_ReleaseDeviceANGLE
; EGL_ANGLE_program_cache_control
EGL_ProgramCacheGetAttribANGLE
EGL_ProgramCachePopulateANGLE
EGL_ProgramCacheQueryANGLE
EGL_ProgramCacheResizeANGLE
; EGL_ANGLE_query_surface_pointer
EGL_QuerySurfacePointerANGLE
; EGL_ANGLE_stream_producer_d3d_texture
EGL_CreateStreamProducerD3DTextureANGLE
EGL_StreamPostD3DTextureANGLE
; EGL_CHROMIUM_get_sync_values
EGL_GetSyncValuesCHROMIUM
; EGL_EXT_device_query
EGL_QueryDeviceAttribEXT
EGL_QueryDeviceStringEXT
EGL_QueryDisplayAttribEXT
; EGL_EXT_platform_base
EGL_CreatePlatformPixmapSurfaceEXT
EGL_CreatePlatformWindowSurfaceEXT
EGL_GetPlatformDisplayEXT
; EGL_KHR_debug
EGL_DebugMessageControlKHR
EGL_LabelObjectKHR
EGL_QueryDebugKHR
; EGL_KHR_image
EGL_CreateImageKHR
EGL_DestroyImageKHR
; EGL_KHR_stream
EGL_CreateStreamKHR
EGL_DestroyStreamKHR
EGL_QueryStreamKHR
EGL_QueryStreamu64KHR
EGL_StreamAttribKHR
; EGL_KHR_stream_consumer_gltexture
EGL_StreamConsumerAcquireKHR
EGL_StreamConsumerGLTextureExternalKHR
EGL_StreamConsumerReleaseKHR
; EGL_KHR_swap_buffers_with_damage
EGL_SwapBuffersWithDamageKHR
; EGL_NV_post_sub_buffer
EGL_PostSubBufferNV
; EGL_NV_stream_consumer_gltexture_yuv
EGL_StreamConsumerGLTextureExternalAttribsNV
...@@ -27,90 +27,90 @@ namespace egl ...@@ -27,90 +27,90 @@ namespace egl
ProcEntry g_procTable[] = { ProcEntry g_procTable[] = {
{"ANGLEGetDisplayPlatform", P(ANGLEGetDisplayPlatform)}, {"ANGLEGetDisplayPlatform", P(ANGLEGetDisplayPlatform)},
{"ANGLEResetDisplayPlatform", P(ANGLEResetDisplayPlatform)}, {"ANGLEResetDisplayPlatform", P(ANGLEResetDisplayPlatform)},
{"eglBindAPI", P(egl::BindAPI)}, {"eglBindAPI", P(EGL_BindAPI)},
{"eglBindTexImage", P(egl::BindTexImage)}, {"eglBindTexImage", P(EGL_BindTexImage)},
{"eglChooseConfig", P(egl::ChooseConfig)}, {"eglChooseConfig", P(EGL_ChooseConfig)},
{"eglClientWaitSync", P(egl::ClientWaitSync)}, {"eglClientWaitSync", P(EGL_ClientWaitSync)},
{"eglCopyBuffers", P(egl::CopyBuffers)}, {"eglCopyBuffers", P(EGL_CopyBuffers)},
{"eglCreateContext", P(egl::CreateContext)}, {"eglCreateContext", P(EGL_CreateContext)},
{"eglCreateDeviceANGLE", P(egl::CreateDeviceANGLE)}, {"eglCreateDeviceANGLE", P(EGL_CreateDeviceANGLE)},
{"eglCreateImage", P(egl::CreateImage)}, {"eglCreateImage", P(EGL_CreateImage)},
{"eglCreateImageKHR", P(egl::CreateImageKHR)}, {"eglCreateImageKHR", P(EGL_CreateImageKHR)},
{"eglCreatePbufferFromClientBuffer", P(egl::CreatePbufferFromClientBuffer)}, {"eglCreatePbufferFromClientBuffer", P(EGL_CreatePbufferFromClientBuffer)},
{"eglCreatePbufferSurface", P(egl::CreatePbufferSurface)}, {"eglCreatePbufferSurface", P(EGL_CreatePbufferSurface)},
{"eglCreatePixmapSurface", P(egl::CreatePixmapSurface)}, {"eglCreatePixmapSurface", P(EGL_CreatePixmapSurface)},
{"eglCreatePlatformPixmapSurface", P(egl::CreatePlatformPixmapSurface)}, {"eglCreatePlatformPixmapSurface", P(EGL_CreatePlatformPixmapSurface)},
{"eglCreatePlatformPixmapSurfaceEXT", P(egl::CreatePlatformPixmapSurfaceEXT)}, {"eglCreatePlatformPixmapSurfaceEXT", P(EGL_CreatePlatformPixmapSurfaceEXT)},
{"eglCreatePlatformWindowSurface", P(egl::CreatePlatformWindowSurface)}, {"eglCreatePlatformWindowSurface", P(EGL_CreatePlatformWindowSurface)},
{"eglCreatePlatformWindowSurfaceEXT", P(egl::CreatePlatformWindowSurfaceEXT)}, {"eglCreatePlatformWindowSurfaceEXT", P(EGL_CreatePlatformWindowSurfaceEXT)},
{"eglCreateStreamKHR", P(egl::CreateStreamKHR)}, {"eglCreateStreamKHR", P(EGL_CreateStreamKHR)},
{"eglCreateStreamProducerD3DTextureANGLE", P(egl::CreateStreamProducerD3DTextureANGLE)}, {"eglCreateStreamProducerD3DTextureANGLE", P(EGL_CreateStreamProducerD3DTextureANGLE)},
{"eglCreateSync", P(egl::CreateSync)}, {"eglCreateSync", P(EGL_CreateSync)},
{"eglCreateWindowSurface", P(egl::CreateWindowSurface)}, {"eglCreateWindowSurface", P(EGL_CreateWindowSurface)},
{"eglDebugMessageControlKHR", P(egl::DebugMessageControlKHR)}, {"eglDebugMessageControlKHR", P(EGL_DebugMessageControlKHR)},
{"eglDestroyContext", P(egl::DestroyContext)}, {"eglDestroyContext", P(EGL_DestroyContext)},
{"eglDestroyImage", P(egl::DestroyImage)}, {"eglDestroyImage", P(EGL_DestroyImage)},
{"eglDestroyImageKHR", P(egl::DestroyImageKHR)}, {"eglDestroyImageKHR", P(EGL_DestroyImageKHR)},
{"eglDestroyStreamKHR", P(egl::DestroyStreamKHR)}, {"eglDestroyStreamKHR", P(EGL_DestroyStreamKHR)},
{"eglDestroySurface", P(egl::DestroySurface)}, {"eglDestroySurface", P(EGL_DestroySurface)},
{"eglDestroySync", P(egl::DestroySync)}, {"eglDestroySync", P(EGL_DestroySync)},
{"eglGetCompositorTimingANDROID", P(egl::GetCompositorTimingANDROID)}, {"eglGetCompositorTimingANDROID", P(EGL_GetCompositorTimingANDROID)},
{"eglGetCompositorTimingSupportedANDROID", P(egl::GetCompositorTimingSupportedANDROID)}, {"eglGetCompositorTimingSupportedANDROID", P(EGL_GetCompositorTimingSupportedANDROID)},
{"eglGetConfigAttrib", P(egl::GetConfigAttrib)}, {"eglGetConfigAttrib", P(EGL_GetConfigAttrib)},
{"eglGetConfigs", P(egl::GetConfigs)}, {"eglGetConfigs", P(EGL_GetConfigs)},
{"eglGetCurrentContext", P(egl::GetCurrentContext)}, {"eglGetCurrentContext", P(EGL_GetCurrentContext)},
{"eglGetCurrentDisplay", P(egl::GetCurrentDisplay)}, {"eglGetCurrentDisplay", P(EGL_GetCurrentDisplay)},
{"eglGetCurrentSurface", P(egl::GetCurrentSurface)}, {"eglGetCurrentSurface", P(EGL_GetCurrentSurface)},
{"eglGetDisplay", P(egl::GetDisplay)}, {"eglGetDisplay", P(EGL_GetDisplay)},
{"eglGetError", P(egl::GetError)}, {"eglGetError", P(EGL_GetError)},
{"eglGetFrameTimestampSupportedANDROID", P(egl::GetFrameTimestampSupportedANDROID)}, {"eglGetFrameTimestampSupportedANDROID", P(EGL_GetFrameTimestampSupportedANDROID)},
{"eglGetFrameTimestampsANDROID", P(egl::GetFrameTimestampsANDROID)}, {"eglGetFrameTimestampsANDROID", P(EGL_GetFrameTimestampsANDROID)},
{"eglGetNextFrameIdANDROID", P(egl::GetNextFrameIdANDROID)}, {"eglGetNextFrameIdANDROID", P(EGL_GetNextFrameIdANDROID)},
{"eglGetPlatformDisplay", P(egl::GetPlatformDisplay)}, {"eglGetPlatformDisplay", P(EGL_GetPlatformDisplay)},
{"eglGetPlatformDisplayEXT", P(egl::GetPlatformDisplayEXT)}, {"eglGetPlatformDisplayEXT", P(EGL_GetPlatformDisplayEXT)},
{"eglGetProcAddress", P(egl::GetProcAddress)}, {"eglGetProcAddress", P(EGL_GetProcAddress)},
{"eglGetSyncAttrib", P(egl::GetSyncAttrib)}, {"eglGetSyncAttrib", P(EGL_GetSyncAttrib)},
{"eglGetSyncValuesCHROMIUM", P(egl::GetSyncValuesCHROMIUM)}, {"eglGetSyncValuesCHROMIUM", P(EGL_GetSyncValuesCHROMIUM)},
{"eglInitialize", P(egl::Initialize)}, {"eglInitialize", P(EGL_Initialize)},
{"eglLabelObjectKHR", P(egl::LabelObjectKHR)}, {"eglLabelObjectKHR", P(EGL_LabelObjectKHR)},
{"eglMakeCurrent", P(egl::MakeCurrent)}, {"eglMakeCurrent", P(EGL_MakeCurrent)},
{"eglPostSubBufferNV", P(egl::PostSubBufferNV)}, {"eglPostSubBufferNV", P(EGL_PostSubBufferNV)},
{"eglPresentationTimeANDROID", P(egl::PresentationTimeANDROID)}, {"eglPresentationTimeANDROID", P(EGL_PresentationTimeANDROID)},
{"eglProgramCacheGetAttribANGLE", P(egl::ProgramCacheGetAttribANGLE)}, {"eglProgramCacheGetAttribANGLE", P(EGL_ProgramCacheGetAttribANGLE)},
{"eglProgramCachePopulateANGLE", P(egl::ProgramCachePopulateANGLE)}, {"eglProgramCachePopulateANGLE", P(EGL_ProgramCachePopulateANGLE)},
{"eglProgramCacheQueryANGLE", P(egl::ProgramCacheQueryANGLE)}, {"eglProgramCacheQueryANGLE", P(EGL_ProgramCacheQueryANGLE)},
{"eglProgramCacheResizeANGLE", P(egl::ProgramCacheResizeANGLE)}, {"eglProgramCacheResizeANGLE", P(EGL_ProgramCacheResizeANGLE)},
{"eglQueryAPI", P(egl::QueryAPI)}, {"eglQueryAPI", P(EGL_QueryAPI)},
{"eglQueryContext", P(egl::QueryContext)}, {"eglQueryContext", P(EGL_QueryContext)},
{"eglQueryDebugKHR", P(egl::QueryDebugKHR)}, {"eglQueryDebugKHR", P(EGL_QueryDebugKHR)},
{"eglQueryDeviceAttribEXT", P(egl::QueryDeviceAttribEXT)}, {"eglQueryDeviceAttribEXT", P(EGL_QueryDeviceAttribEXT)},
{"eglQueryDeviceStringEXT", P(egl::QueryDeviceStringEXT)}, {"eglQueryDeviceStringEXT", P(EGL_QueryDeviceStringEXT)},
{"eglQueryDisplayAttribEXT", P(egl::QueryDisplayAttribEXT)}, {"eglQueryDisplayAttribEXT", P(EGL_QueryDisplayAttribEXT)},
{"eglQueryStreamKHR", P(egl::QueryStreamKHR)}, {"eglQueryStreamKHR", P(EGL_QueryStreamKHR)},
{"eglQueryStreamu64KHR", P(egl::QueryStreamu64KHR)}, {"eglQueryStreamu64KHR", P(EGL_QueryStreamu64KHR)},
{"eglQueryString", P(egl::QueryString)}, {"eglQueryString", P(EGL_QueryString)},
{"eglQuerySurface", P(egl::QuerySurface)}, {"eglQuerySurface", P(EGL_QuerySurface)},
{"eglQuerySurfacePointerANGLE", P(egl::QuerySurfacePointerANGLE)}, {"eglQuerySurfacePointerANGLE", P(EGL_QuerySurfacePointerANGLE)},
{"eglReleaseDeviceANGLE", P(egl::ReleaseDeviceANGLE)}, {"eglReleaseDeviceANGLE", P(EGL_ReleaseDeviceANGLE)},
{"eglReleaseTexImage", P(egl::ReleaseTexImage)}, {"eglReleaseTexImage", P(EGL_ReleaseTexImage)},
{"eglReleaseThread", P(egl::ReleaseThread)}, {"eglReleaseThread", P(EGL_ReleaseThread)},
{"eglSetBlobCacheFuncsANDROID", P(egl::SetBlobCacheFuncsANDROID)}, {"eglSetBlobCacheFuncsANDROID", P(EGL_SetBlobCacheFuncsANDROID)},
{"eglStreamAttribKHR", P(egl::StreamAttribKHR)}, {"eglStreamAttribKHR", P(EGL_StreamAttribKHR)},
{"eglStreamConsumerAcquireKHR", P(egl::StreamConsumerAcquireKHR)}, {"eglStreamConsumerAcquireKHR", P(EGL_StreamConsumerAcquireKHR)},
{"eglStreamConsumerGLTextureExternalAttribsNV", {"eglStreamConsumerGLTextureExternalAttribsNV",
P(egl::StreamConsumerGLTextureExternalAttribsNV)}, P(EGL_StreamConsumerGLTextureExternalAttribsNV)},
{"eglStreamConsumerGLTextureExternalKHR", P(egl::StreamConsumerGLTextureExternalKHR)}, {"eglStreamConsumerGLTextureExternalKHR", P(EGL_StreamConsumerGLTextureExternalKHR)},
{"eglStreamConsumerReleaseKHR", P(egl::StreamConsumerReleaseKHR)}, {"eglStreamConsumerReleaseKHR", P(EGL_StreamConsumerReleaseKHR)},
{"eglStreamPostD3DTextureANGLE", P(egl::StreamPostD3DTextureANGLE)}, {"eglStreamPostD3DTextureANGLE", P(EGL_StreamPostD3DTextureANGLE)},
{"eglSurfaceAttrib", P(egl::SurfaceAttrib)}, {"eglSurfaceAttrib", P(EGL_SurfaceAttrib)},
{"eglSwapBuffers", P(egl::SwapBuffers)}, {"eglSwapBuffers", P(EGL_SwapBuffers)},
{"eglSwapBuffersWithDamageKHR", P(egl::SwapBuffersWithDamageKHR)}, {"eglSwapBuffersWithDamageKHR", P(EGL_SwapBuffersWithDamageKHR)},
{"eglSwapInterval", P(egl::SwapInterval)}, {"eglSwapInterval", P(EGL_SwapInterval)},
{"eglTerminate", P(egl::Terminate)}, {"eglTerminate", P(EGL_Terminate)},
{"eglWaitClient", P(egl::WaitClient)}, {"eglWaitClient", P(EGL_WaitClient)},
{"eglWaitGL", P(egl::WaitGL)}, {"eglWaitGL", P(EGL_WaitGL)},
{"eglWaitNative", P(egl::WaitNative)}, {"eglWaitNative", P(EGL_WaitNative)},
{"eglWaitSync", P(egl::WaitSync)}, {"eglWaitSync", P(EGL_WaitSync)},
{"glActiveShaderProgram", P(gl::ActiveShaderProgram)}, {"glActiveShaderProgram", P(gl::ActiveShaderProgram)},
{"glActiveShaderProgramContextANGLE", P(gl::ActiveShaderProgramContextANGLE)}, {"glActiveShaderProgramContextANGLE", P(gl::ActiveShaderProgramContextANGLE)},
{"glActiveTexture", P(gl::ActiveTexture)}, {"glActiveTexture", P(gl::ActiveTexture)},
......
...@@ -132,10 +132,6 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -132,10 +132,6 @@ if (is_win || is_linux || is_mac || is_android) {
test("angle_end2end_tests") { test("angle_end2end_tests") {
include_dirs = [ "../../src/tests" ] include_dirs = [ "../../src/tests" ]
defines = [
"ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"",
"ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"",
]
if (is_android) { if (is_android) {
use_native_activity = true use_native_activity = true
...@@ -166,8 +162,10 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -166,8 +162,10 @@ if (is_win || is_linux || is_mac || is_android) {
} }
configs += [ configs += [
angle_root + ":gl_prototypes",
angle_root + ":internal_config", angle_root + ":internal_config",
angle_root + ":libANGLE_config", angle_root + ":libANGLE_config",
angle_root + ":library_name_config",
] ]
if (is_linux && !is_component_build) { if (is_linux && !is_component_build) {
...@@ -215,6 +213,7 @@ if (is_win || is_linux || is_mac || is_android) { ...@@ -215,6 +213,7 @@ if (is_win || is_linux || is_mac || is_android) {
} }
configs += [ configs += [
angle_root + ":gl_prototypes",
angle_root + ":internal_config", angle_root + ":internal_config",
angle_root + ":libANGLE_config", angle_root + ":libANGLE_config",
] ]
...@@ -278,6 +277,7 @@ if (is_win || is_linux || is_android || is_mac) { ...@@ -278,6 +277,7 @@ if (is_win || is_linux || is_android || is_mac) {
configs += [ configs += [
angle_root + ":internal_config", angle_root + ":internal_config",
angle_root + ":gl_prototypes",
angle_root + ":libANGLE_config", angle_root + ":libANGLE_config",
] ]
...@@ -317,6 +317,7 @@ if (is_win || is_linux || is_android || is_mac) { ...@@ -317,6 +317,7 @@ if (is_win || is_linux || is_android || is_mac) {
configs += [ configs += [
angle_root + ":internal_config", angle_root + ":internal_config",
angle_root + ":gl_prototypes",
angle_root + ":libANGLE_config", angle_root + ":libANGLE_config",
] ]
...@@ -523,6 +524,7 @@ if (build_angle_gles1_conform_tests) { ...@@ -523,6 +524,7 @@ if (build_angle_gles1_conform_tests) {
configs += [ configs += [
angle_root + ":internal_config", angle_root + ":internal_config",
angle_root + ":libANGLE_config", angle_root + ":libANGLE_config",
angle_root + ":gl_prototypes",
] ]
if (build_with_chromium) { if (build_with_chromium) {
...@@ -662,9 +664,8 @@ if (build_angle_deqp_tests) { ...@@ -662,9 +664,8 @@ if (build_angle_deqp_tests) {
"//third_party/libpng:libpng", "//third_party/libpng:libpng",
] ]
defines = [ "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"" ]
configs -= deqp_undefine_configs configs -= deqp_undefine_configs
configs += [ angle_root + ":library_name_config" ]
public_configs = [ ":angle_deqp_libtester_config" ] public_configs = [ ":angle_deqp_libtester_config" ]
sources = deqp_libtester_sources sources = deqp_libtester_sources
if (is_win) { if (is_win) {
......
...@@ -52,10 +52,10 @@ TEST_P(ExplicitContextTest, GetProcAddress) ...@@ -52,10 +52,10 @@ TEST_P(ExplicitContextTest, GetProcAddress)
EGLContext context = getEGLWindow()->getContext(); EGLContext context = getEGLWindow()->getContext();
PFNGLCLEARCOLORCONTEXTANGLE clearColor = reinterpret_cast<PFNGLCLEARCOLORCONTEXTANGLE>( PFNGLCLEARCOLORCONTEXTANGLEPROC clearColor = reinterpret_cast<PFNGLCLEARCOLORCONTEXTANGLEPROC>(
eglGetProcAddress("glClearColorContextANGLE")); eglGetProcAddress("glClearColorContextANGLE"));
PFNGLCLEARCONTEXTANGLE clear = PFNGLCLEARCONTEXTANGLEPROC clear =
reinterpret_cast<PFNGLCLEARCONTEXTANGLE>(eglGetProcAddress("glClearContextANGLE")); reinterpret_cast<PFNGLCLEARCONTEXTANGLEPROC>(eglGetProcAddress("glClearContextANGLE"));
// Clear to green // Clear to green
clearColor(context, 1.0f, 0, 0, 1.0f); clearColor(context, 1.0f, 0, 0, 1.0f);
......
...@@ -1163,7 +1163,8 @@ bool IsAndroid() ...@@ -1163,7 +1163,8 @@ bool IsAndroid()
bool IsVulkan() bool IsVulkan()
{ {
std::string rendererString(reinterpret_cast<const char *>(glGetString(GL_RENDERER))); const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
std::string rendererString(renderer);
return (rendererString.find("Vulkan") != std::string::npos); return (rendererString.find("Vulkan") != std::string::npos);
} }
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#include "system_utils.h" #include "system_utils.h"
#include <sys/resource.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <sched.h> #include <sched.h>
#include <sys/resource.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
...@@ -27,9 +27,8 @@ void Sleep(unsigned int milliseconds) ...@@ -27,9 +27,8 @@ void Sleep(unsigned int milliseconds)
} }
else else
{ {
timespec sleepTime = timespec sleepTime = {
{ .tv_sec = milliseconds / 1000,
.tv_sec = milliseconds / 1000,
.tv_nsec = (milliseconds % 1000) * 1000000, .tv_nsec = (milliseconds % 1000) * 1000000,
}; };
...@@ -80,5 +79,4 @@ bool StabilizeCPUForBenchmarking() ...@@ -80,5 +79,4 @@ bool StabilizeCPUForBenchmarking()
return success; return success;
} }
} // namespace angle
} // namespace angle
...@@ -29,7 +29,6 @@ ANGLE_EXPORT void WriteDebugMessage(const char *format, ...); ...@@ -29,7 +29,6 @@ ANGLE_EXPORT void WriteDebugMessage(const char *format, ...);
// Set thread affinity and priority. // Set thread affinity and priority.
ANGLE_EXPORT bool StabilizeCPUForBenchmarking(); ANGLE_EXPORT bool StabilizeCPUForBenchmarking();
} // namespace angle
} // namespace angle
#endif // UTIL_SYSTEM_UTILS_H_ #endif // UTIL_SYSTEM_UTILS_H_
...@@ -36,5 +36,4 @@ bool StabilizeCPUForBenchmarking() ...@@ -36,5 +36,4 @@ bool StabilizeCPUForBenchmarking()
return true; return true;
} }
} // namespace angle } // namespace angle
...@@ -24,5 +24,4 @@ bool StabilizeCPUForBenchmarking() ...@@ -24,5 +24,4 @@ bool StabilizeCPUForBenchmarking()
// No equivalent to this in WinRT // No equivalent to this in WinRT
return true; return true;
} }
} // namespace angle } // namespace angle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment