diff --git a/gfx/angle/checkout/include/EGL/eglext_angle.h b/gfx/angle/checkout/include/EGL/eglext_angle.h --- a/gfx/angle/checkout/include/EGL/eglext_angle.h +++ b/gfx/angle/checkout/include/EGL/eglext_angle.h @@ -113,14 +113,14 @@ #ifndef EGL_ANGLE_platform_angle_device_type_egl_angle #define EGL_ANGLE_platform_angle_device_type_egl_angle #define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE 0x348E #endif /* EGL_ANGLE_platform_angle_device_type_egl_angle */ -#ifndef EGL_ANGLE_platform_angle_context_virtualization -#define EGL_ANGLE_platform_angle_context_virtualization 1 -#define EGL_PLATFORM_ANGLE_CONTEXT_VIRTUALIZATION_ANGLE 0x3481 -#endif /* EGL_ANGLE_platform_angle_context_virtualization */ +#ifndef EGL_ANGLE_context_virtualization +#define EGL_ANGLE_context_virtualization 1 +#define EGL_CONTEXT_VIRTUALIZATION_GROUP_ANGLE 0x3481 +#endif /* EGL_ANGLE_context_virtualization */ #ifndef EGL_ANGLE_platform_angle_device_context_volatile_eagl #define EGL_ANGLE_platform_angle_device_context_volatile_eagl 1 #define EGL_PLATFORM_ANGLE_DEVICE_CONTEXT_VOLATILE_EAGL_ANGLE 0x34A2 #endif /* EGL_ANGLE_platform_angle_device_context_volatile_eagl */ @@ -128,20 +128,21 @@ #ifndef EGL_ANGLE_platform_angle_device_context_volatile_cgl #define EGL_ANGLE_platform_angle_device_context_volatile_cgl 1 #define EGL_PLATFORM_ANGLE_DEVICE_CONTEXT_VOLATILE_CGL_ANGLE 0x34A3 #endif /* EGL_ANGLE_platform_angle_device_context_volatile_cgl */ +#ifndef EGL_ANGLE_platform_angle_device_id +#define EGL_ANGLE_platform_angle_device_id +#define EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE 0x34D6 +#define EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE 0x34D7 +#endif /* EGL_ANGLE_platform_angle_device_id */ + #ifndef EGL_ANGLE_x11_visual #define EGL_ANGLE_x11_visual #define EGL_X11_VISUAL_ID_ANGLE 0x33A3 #endif /* EGL_ANGLE_x11_visual */ -#ifndef EGL_ANGLE_flexible_surface_compatibility -#define EGL_ANGLE_flexible_surface_compatibility 1 -#define EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE 0x33A6 -#endif /* EGL_ANGLE_flexible_surface_compatibility */ - #ifndef EGL_ANGLE_surface_orientation #define EGL_ANGLE_surface_orientation #define EGL_OPTIMAL_SURFACE_ORIENTATION_ANGLE 0x33A7 #define EGL_SURFACE_ORIENTATION_ANGLE 0x33A8 #define EGL_SURFACE_ORIENTATION_INVERT_X_ANGLE 0x0001 @@ -179,10 +180,15 @@ #ifndef EGL_CHROMIUM_create_context_bind_generates_resource #define EGL_CHROMIUM_create_context_bind_generates_resource 1 #define EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM 0x33AD #endif /* EGL_CHROMIUM_create_context_bind_generates_resource */ +#ifndef EGL_ANGLE_metal_create_context_ownership_identity +#define EGL_ANGLE_metal_create_context_ownership_identity 1 +#define EGL_CONTEXT_METAL_OWNERSHIP_IDENTITY_ANGLE 0x34D2 +#endif /* EGL_ANGLE_metal_create_context_ownership_identity */ + #ifndef EGL_ANGLE_create_context_client_arrays #define EGL_ANGLE_create_context_client_arrays 1 #define EGL_CONTEXT_CLIENT_ARRAYS_ENABLED_ANGLE 0x3452 #endif /* EGL_ANGLE_create_context_client_arrays */ @@ -274,14 +280,16 @@ #define EGL_LOW_POWER_ANGLE 0x0001 #define EGL_HIGH_POWER_ANGLE 0x0002 typedef void(EGLAPIENTRYP PFNEGLRELEASEHIGHPOWERGPUANGLEPROC) (EGLDisplay dpy, EGLContext ctx); typedef void(EGLAPIENTRYP PFNEGLREACQUIREHIGHPOWERGPUANGLEPROC) (EGLDisplay dpy, EGLContext ctx); typedef void(EGLAPIENTRYP PFNEGLHANDLEGPUSWITCHANGLEPROC) (EGLDisplay dpy); +typedef void(EGLAPIENTRYP PFNEGLFORCEGPUSWITCHANGLEPROC) (EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow); #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void EGLAPIENTRY eglReleaseHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx); EGLAPI void EGLAPIENTRY eglReacquireHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx); EGLAPI void EGLAPIENTRY eglHandleGPUSwitchANGLE(EGLDisplay dpy); +EGLAPI void EGLAPIENTRY eglForceGPUSwitchANGLE(EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow); #endif #endif /* EGL_ANGLE_power_preference */ #ifndef EGL_ANGLE_feature_control #define EGL_ANGLE_feature_control 1 @@ -331,10 +339,18 @@ #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy, EGLSurface surface, EGLFrameTokenANGLE frametoken); #endif #endif /* EGL_ANGLE_swap_with_frame_token */ +#ifndef EGL_ANGLE_prepare_swap_buffers +#define EGL_ANGLE_prepare_swap_buffers 1 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLPREPARESWAPBUFFERSANGLEPROC)(EGLDisplay dpy, EGLSurface surface); +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglPrepareSwapBuffersANGLE(EGLDisplay dpy, EGLSurface surface); +#endif +#endif /* EGL_ANGLE_prepare_swap_buffers */ + #ifndef EGL_ANGLE_device_eagl #define EGL_ANGLE_device_eagl 1 #define EGL_EAGL_CONTEXT_ANGLE 0x348C #endif @@ -353,8 +369,35 @@ #define EGL_EXTERNAL_CONTEXT_ANGLE 0x348E #define EGL_EXTERNAL_SURFACE_ANGLE 0x348F #define EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE 0x3490 #endif /* EGL_ANGLE_external_context_and_surface */ +#ifndef EGL_ANGLE_create_surface_swap_interval +#define EGL_ANGLE_create_surface_swap_interval 1 +#define EGL_SWAP_INTERVAL_ANGLE 0x322F +#endif /* EGL_ANGLE_create_surface_swap_interval */ + +#ifndef EGL_ANGLE_device_vulkan +#define EGL_ANGLE_device_vulkan 1 +#define EGL_VULKAN_VERSION_ANGLE 0x34A8 +#define EGL_VULKAN_INSTANCE_ANGLE 0x34A9 +#define EGL_VULKAN_INSTANCE_EXTENSIONS_ANGLE 0x34AA +#define EGL_VULKAN_PHYSICAL_DEVICE_ANGLE 0x34AB +#define EGL_VULKAN_DEVICE_ANGLE 0x34AC +#define EGL_VULKAN_DEVICE_EXTENSIONS_ANGLE 0x34AD +#define EGL_VULKAN_FEATURES_ANGLE 0x34AE +#define EGL_VULKAN_QUEUE_ANGLE 0x34AF +#define EGL_VULKAN_QUEUE_FAMILIY_INDEX_ANGLE 0x34D0 +#define EGL_VULKAN_GET_INSTANCE_PROC_ADDR 0x34D1 +#endif /* EGL_ANGLE_device_vulkan */ + +#ifndef EGL_ANGLE_vulkan_image +#define EGL_ANGLE_vulkan_image +#define EGL_VULKAN_IMAGE_ANGLE 0x34D3 +#define EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE 0x34D4 +#define EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE 0x34D5 +typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTVKIMAGEANGLEPROC)(EGLDisplay dpy, EGLImage image, void* vk_image, void* vk_image_create_info); +#endif /* EGL_ANGLE_vulkan_image */ + // clang-format on #endif // INCLUDE_EGL_EGLEXT_ANGLE_ diff --git a/gfx/angle/checkout/include/GLES/glext.h b/gfx/angle/checkout/include/GLES/glext.h --- a/gfx/angle/checkout/include/GLES/glext.h +++ b/gfx/angle/checkout/include/GLES/glext.h @@ -953,13 +953,10 @@ #ifndef GL_QCOM_writeonly_rendering #define GL_QCOM_writeonly_rendering 1 #define GL_WRITEONLY_RENDERING_QCOM 0x8823 #endif /* GL_QCOM_writeonly_rendering */ -/* ANGLE GLES1 extensions */ -#include "glext_angle.h" - #ifdef __cplusplus } #endif #endif diff --git a/gfx/angle/checkout/include/GLES/glext_angle.h b/gfx/angle/checkout/include/GLES/glext_angle.h deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES/glext_angle.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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. -// -// glext_angle.h: ANGLE modifications to the glext.h header file. -// Currently we don't include this file directly, we patch glext.h -// to include it implicitly so it is visible throughout our code. - -#ifndef INCLUDE_GLES_GLEXT_ANGLE_H_ -#define INCLUDE_GLES_GLEXT_ANGLE_H_ - -// clang-format off - -#ifndef GL_ANGLE_explicit_context_gles1 -#define GL_ANGLE_explicit_context_gles1 -typedef void *GLeglContext; -#include "glext_explicit_context_autogen.inc" -#endif /* GL_ANGLE_explicit_context_gles1 */ - -// clang-format on - -#endif // INCLUDE_GLES_GLEXT_ANGLE_H_ diff --git a/gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc b/gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc +++ /dev/null @@ -1,258 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. -// -// Copyright 2020 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. -// -// glext_explicit_context_autogen.inc: -// Function declarations for the EGL_ANGLE_explicit_context extension - -typedef void (GL_APIENTRYP PFNGLALPHAFUNCCONTEXTANGLEPROC)(GLeglContext ctx, GLenum func, GLfloat ref); -typedef void (GL_APIENTRYP PFNGLALPHAFUNCXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum func, GLfixed ref); -typedef void (GL_APIENTRYP PFNGLCLEARCOLORXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed depth); -typedef void (GL_APIENTRYP PFNGLCLIENTACTIVETEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLenum texture); -typedef void (GL_APIENTRYP PFNGLCLIPPLANEFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum p, const GLfloat *eqn); -typedef void (GL_APIENTRYP PFNGLCLIPPLANEXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum plane, const GLfixed *equation); -typedef void (GL_APIENTRYP PFNGLCOLOR4FCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLCOLOR4UBCONTEXTANGLEPROC)(GLeglContext ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -typedef void (GL_APIENTRYP PFNGLCOLOR4XCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (GL_APIENTRYP PFNGLCOLORPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed n, GLfixed f); -typedef void (GL_APIENTRYP PFNGLDISABLECLIENTSTATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum array); -typedef void (GL_APIENTRYP PFNGLENABLECLIENTSTATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum array); -typedef void (GL_APIENTRYP PFNGLFOGFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLFOGFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLFOGXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLFOGXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfixed *param); -typedef void (GL_APIENTRYP PFNGLFRUSTUMFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLFRUSTUMXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum plane, GLfloat *equation); -typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum plane, GLfixed *equation); -typedef void (GL_APIENTRYP PFNGLGETFIXEDVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfixed *params); -typedef void (GL_APIENTRYP PFNGLGETLIGHTFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETLIGHTXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, GLfixed *params); -typedef void (GL_APIENTRYP PFNGLGETMATERIALFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETMATERIALXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, GLfixed *params); -typedef void (GL_APIENTRYP PFNGLGETTEXENVFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXENVIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXENVXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfixed *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfixed *params); -typedef void (GL_APIENTRYP PFNGLLIGHTMODELFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLLIGHTMODELFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLLIGHTMODELXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfixed *param); -typedef void (GL_APIENTRYP PFNGLLIGHTFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLLIGHTFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLLIGHTXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLLIGHTXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum light, GLenum pname, const GLfixed *params); -typedef void (GL_APIENTRYP PFNGLLINEWIDTHXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed width); -typedef void (GL_APIENTRYP PFNGLLOADIDENTITYCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLLOADMATRIXFCONTEXTANGLEPROC)(GLeglContext ctx, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLLOADMATRIXXCONTEXTANGLEPROC)(GLeglContext ctx, const GLfixed *m); -typedef void (GL_APIENTRYP PFNGLLOGICOPCONTEXTANGLEPROC)(GLeglContext ctx, GLenum opcode); -typedef void (GL_APIENTRYP PFNGLMATERIALFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLMATERIALFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLMATERIALXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLMATERIALXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum pname, const GLfixed *param); -typedef void (GL_APIENTRYP PFNGLMATRIXMODECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLMULTMATRIXFCONTEXTANGLEPROC)(GLeglContext ctx, const GLfloat *m); -typedef void (GL_APIENTRYP PFNGLMULTMATRIXXCONTEXTANGLEPROC)(GLeglContext ctx, const GLfixed *m); -typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4FCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XCONTEXTANGLEPROC)(GLeglContext ctx, GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (GL_APIENTRYP PFNGLNORMAL3FCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (GL_APIENTRYP PFNGLNORMAL3XCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed nx, GLfixed ny, GLfixed nz); -typedef void (GL_APIENTRYP PFNGLNORMALPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLORTHOFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLORTHOXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, const GLfixed *params); -typedef void (GL_APIENTRYP PFNGLPOINTSIZECONTEXTANGLEPROC)(GLeglContext ctx, GLfloat size); -typedef void (GL_APIENTRYP PFNGLPOINTSIZEXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed size); -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed factor, GLfixed units); -typedef void (GL_APIENTRYP PFNGLPOPMATRIXCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLPUSHMATRIXCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLROTATEFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLROTATEXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXCONTEXTANGLEPROC)(GLeglContext ctx, GLclampx value, GLboolean invert); -typedef void (GL_APIENTRYP PFNGLSCALEFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLSCALEXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z); -typedef void (GL_APIENTRYP PFNGLSHADEMODELCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLTEXCOORDPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLTEXENVFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLTEXENVFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLTEXENVICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLTEXENVIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXENVXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLTEXENVXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLfixed *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLfixed *params); -typedef void (GL_APIENTRYP PFNGLTRANSLATEFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLTRANSLATEXCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z); -typedef void (GL_APIENTRYP PFNGLVERTEXPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint framebuffer); -typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint renderbuffer); -typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint matrixpaletteindex); -typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); -typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESCONTEXTANGLEPROC)(GLeglContext ctx, const GLfloat *coords); -typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLint z, GLint width, GLint height); -typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESCONTEXTANGLEPROC)(GLeglContext ctx, const GLint *coords); -typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); -typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESCONTEXTANGLEPROC)(GLeglContext ctx, const GLshort *coords); -typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); -typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESCONTEXTANGLEPROC)(GLeglContext ctx, const GLfixed *coords); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed *params); -typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint framebuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLPOINTSIZEPOINTEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLsizei stride, const void *pointer); -typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLfixed *mantissa, GLint *exponent); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXGENFOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLTEXGENFVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLTEXGENIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLTEXGENIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXGENXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed param); -typedef void (GL_APIENTRYP PFNGLTEXGENXVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum coord, GLenum pname, const GLfixed *params); -typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -#ifdef GL_GLEXT_PROTOTYPES -GL_API void GL_APIENTRY glAlphaFuncContextANGLE(GLeglContext ctx, GLenum func, GLfloat ref); -GL_API void GL_APIENTRY glAlphaFuncxContextANGLE(GLeglContext ctx, GLenum func, GLfixed ref); -GL_API void GL_APIENTRY glClearColorxContextANGLE(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GL_API void GL_APIENTRY glClearDepthxContextANGLE(GLeglContext ctx, GLfixed depth); -GL_API void GL_APIENTRY glClientActiveTextureContextANGLE(GLeglContext ctx, GLenum texture); -GL_API void GL_APIENTRY glClipPlanefContextANGLE(GLeglContext ctx, GLenum p, const GLfloat *eqn); -GL_API void GL_APIENTRY glClipPlanexContextANGLE(GLeglContext ctx, GLenum plane, const GLfixed *equation); -GL_API void GL_APIENTRY glColor4fContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_API void GL_APIENTRY glColor4ubContextANGLE(GLeglContext ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -GL_API void GL_APIENTRY glColor4xContextANGLE(GLeglContext ctx, GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -GL_API void GL_APIENTRY glColorPointerContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -GL_API void GL_APIENTRY glDepthRangexContextANGLE(GLeglContext ctx, GLfixed n, GLfixed f); -GL_API void GL_APIENTRY glDisableClientStateContextANGLE(GLeglContext ctx, GLenum array); -GL_API void GL_APIENTRY glEnableClientStateContextANGLE(GLeglContext ctx, GLenum array); -GL_API void GL_APIENTRY glFogfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glFogfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glFogxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glFogxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *param); -GL_API void GL_APIENTRY glFrustumfContextANGLE(GLeglContext ctx, GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GL_API void GL_APIENTRY glFrustumxContextANGLE(GLeglContext ctx, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GL_API void GL_APIENTRY glGetClipPlanefContextANGLE(GLeglContext ctx, GLenum plane, GLfloat *equation); -GL_API void GL_APIENTRY glGetClipPlanexContextANGLE(GLeglContext ctx, GLenum plane, GLfixed *equation); -GL_API void GL_APIENTRY glGetFixedvContextANGLE(GLeglContext ctx, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glGetLightfvContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfloat *params); -GL_API void GL_APIENTRY glGetLightxvContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glGetMaterialfvContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfloat *params); -GL_API void GL_APIENTRY glGetMaterialxvContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glGetTexEnvfvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfloat *params); -GL_API void GL_APIENTRY glGetTexEnvivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_API void GL_APIENTRY glGetTexEnvxvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glGetTexParameterxvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glLightModelfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glLightModelfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glLightModelxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glLightModelxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *param); -GL_API void GL_APIENTRY glLightfContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glLightfvContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glLightxContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glLightxvContextANGLE(GLeglContext ctx, GLenum light, GLenum pname, const GLfixed *params); -GL_API void GL_APIENTRY glLineWidthxContextANGLE(GLeglContext ctx, GLfixed width); -GL_API void GL_APIENTRY glLoadIdentityContextANGLE(GLeglContext ctx); -GL_API void GL_APIENTRY glLoadMatrixfContextANGLE(GLeglContext ctx, const GLfloat *m); -GL_API void GL_APIENTRY glLoadMatrixxContextANGLE(GLeglContext ctx, const GLfixed *m); -GL_API void GL_APIENTRY glLogicOpContextANGLE(GLeglContext ctx, GLenum opcode); -GL_API void GL_APIENTRY glMaterialfContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glMaterialfvContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glMaterialxContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glMaterialxvContextANGLE(GLeglContext ctx, GLenum face, GLenum pname, const GLfixed *param); -GL_API void GL_APIENTRY glMatrixModeContextANGLE(GLeglContext ctx, GLenum mode); -GL_API void GL_APIENTRY glMultMatrixfContextANGLE(GLeglContext ctx, const GLfloat *m); -GL_API void GL_APIENTRY glMultMatrixxContextANGLE(GLeglContext ctx, const GLfixed *m); -GL_API void GL_APIENTRY glMultiTexCoord4fContextANGLE(GLeglContext ctx, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GL_API void GL_APIENTRY glMultiTexCoord4xContextANGLE(GLeglContext ctx, GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -GL_API void GL_APIENTRY glNormal3fContextANGLE(GLeglContext ctx, GLfloat nx, GLfloat ny, GLfloat nz); -GL_API void GL_APIENTRY glNormal3xContextANGLE(GLeglContext ctx, GLfixed nx, GLfixed ny, GLfixed nz); -GL_API void GL_APIENTRY glNormalPointerContextANGLE(GLeglContext ctx, GLenum type, GLsizei stride, const void *pointer); -GL_API void GL_APIENTRY glOrthofContextANGLE(GLeglContext ctx, GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -GL_API void GL_APIENTRY glOrthoxContextANGLE(GLeglContext ctx, GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); -GL_API void GL_APIENTRY glPointParameterfContextANGLE(GLeglContext ctx, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glPointParameterfvContextANGLE(GLeglContext ctx, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glPointParameterxContextANGLE(GLeglContext ctx, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glPointParameterxvContextANGLE(GLeglContext ctx, GLenum pname, const GLfixed *params); -GL_API void GL_APIENTRY glPointSizeContextANGLE(GLeglContext ctx, GLfloat size); -GL_API void GL_APIENTRY glPointSizexContextANGLE(GLeglContext ctx, GLfixed size); -GL_API void GL_APIENTRY glPolygonOffsetxContextANGLE(GLeglContext ctx, GLfixed factor, GLfixed units); -GL_API void GL_APIENTRY glPopMatrixContextANGLE(GLeglContext ctx); -GL_API void GL_APIENTRY glPushMatrixContextANGLE(GLeglContext ctx); -GL_API void GL_APIENTRY glRotatefContextANGLE(GLeglContext ctx, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GL_API void GL_APIENTRY glRotatexContextANGLE(GLeglContext ctx, GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -GL_API void GL_APIENTRY glSampleCoveragexContextANGLE(GLeglContext ctx, GLclampx value, GLboolean invert); -GL_API void GL_APIENTRY glScalefContextANGLE(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z); -GL_API void GL_APIENTRY glScalexContextANGLE(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z); -GL_API void GL_APIENTRY glShadeModelContextANGLE(GLeglContext ctx, GLenum mode); -GL_API void GL_APIENTRY glTexCoordPointerContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -GL_API void GL_APIENTRY glTexEnvfContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glTexEnvfvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glTexEnviContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -GL_API void GL_APIENTRY glTexEnvivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -GL_API void GL_APIENTRY glTexEnvxContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glTexEnvxvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLfixed *params); -GL_API void GL_APIENTRY glTexParameterxContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glTexParameterxvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLfixed *params); -GL_API void GL_APIENTRY glTranslatefContextANGLE(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z); -GL_API void GL_APIENTRY glTranslatexContextANGLE(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z); -GL_API void GL_APIENTRY glVertexPointerContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -GL_API void GL_APIENTRY glBindFramebufferOESContextANGLE(GLeglContext ctx, GLenum target, GLuint framebuffer); -GL_API void GL_APIENTRY glBindRenderbufferOESContextANGLE(GLeglContext ctx, GLenum target, GLuint renderbuffer); -GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOESContextANGLE(GLeglContext ctx, GLenum target); -GL_API void GL_APIENTRY glCurrentPaletteMatrixOESContextANGLE(GLeglContext ctx, GLuint matrixpaletteindex); -GL_API void GL_APIENTRY glDeleteFramebuffersOESContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *framebuffers); -GL_API void GL_APIENTRY glDeleteRenderbuffersOESContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *renderbuffers); -GL_API void GL_APIENTRY glDrawTexfOESContextANGLE(GLeglContext ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); -GL_API void GL_APIENTRY glDrawTexfvOESContextANGLE(GLeglContext ctx, const GLfloat *coords); -GL_API void GL_APIENTRY glDrawTexiOESContextANGLE(GLeglContext ctx, GLint x, GLint y, GLint z, GLint width, GLint height); -GL_API void GL_APIENTRY glDrawTexivOESContextANGLE(GLeglContext ctx, const GLint *coords); -GL_API void GL_APIENTRY glDrawTexsOESContextANGLE(GLeglContext ctx, GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); -GL_API void GL_APIENTRY glDrawTexsvOESContextANGLE(GLeglContext ctx, const GLshort *coords); -GL_API void GL_APIENTRY glDrawTexxOESContextANGLE(GLeglContext ctx, GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); -GL_API void GL_APIENTRY glDrawTexxvOESContextANGLE(GLeglContext ctx, const GLfixed *coords); -GL_API void GL_APIENTRY glFramebufferRenderbufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_API void GL_APIENTRY glFramebufferTexture2DOESContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_API void GL_APIENTRY glGenFramebuffersOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *framebuffers); -GL_API void GL_APIENTRY glGenRenderbuffersOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *renderbuffers); -GL_API void GL_APIENTRY glGenerateMipmapOESContextANGLE(GLeglContext ctx, GLenum target); -GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLint *params); -GL_API void GL_APIENTRY glGetRenderbufferParameterivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_API void GL_APIENTRY glGetTexGenfvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat *params); -GL_API void GL_APIENTRY glGetTexGenivOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLint *params); -GL_API void GL_APIENTRY glGetTexGenxvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed *params); -GL_API GLboolean GL_APIENTRY glIsFramebufferOESContextANGLE(GLeglContext ctx, GLuint framebuffer); -GL_API GLboolean GL_APIENTRY glIsRenderbufferOESContextANGLE(GLeglContext ctx, GLuint renderbuffer); -GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOESContextANGLE(GLeglContext ctx); -GL_API void GL_APIENTRY glMatrixIndexPointerOESContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -GL_API void GL_APIENTRY glPointSizePointerOESContextANGLE(GLeglContext ctx, GLenum type, GLsizei stride, const void *pointer); -GL_API GLbitfield GL_APIENTRY glQueryMatrixxOESContextANGLE(GLeglContext ctx, GLfixed *mantissa, GLint *exponent); -GL_API void GL_APIENTRY glRenderbufferStorageOESContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_API void GL_APIENTRY glTexGenfOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat param); -GL_API void GL_APIENTRY glTexGenfvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLfloat *params); -GL_API void GL_APIENTRY glTexGeniOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLint param); -GL_API void GL_APIENTRY glTexGenivOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLint *params); -GL_API void GL_APIENTRY glTexGenxOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed param); -GL_API void GL_APIENTRY glTexGenxvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLfixed *params); -GL_API void GL_APIENTRY glWeightPointerOESContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer); -#endif diff --git a/gfx/angle/checkout/include/GLES2/gl2ext_angle.h b/gfx/angle/checkout/include/GLES2/gl2ext_angle.h --- a/gfx/angle/checkout/include/GLES2/gl2ext_angle.h +++ b/gfx/angle/checkout/include/GLES2/gl2ext_angle.h @@ -409,20 +409,10 @@ GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvANGLE(GLenum target, GLint level, GLenum pname, GLfloat *params); GL_APICALL void GL_APIENTRY glGetTexLevelParameterivANGLE(GLenum target, GLint level, GLenum pname, GLint *params); #endif #endif /* GL_ANGLE_get_tex_level_parameter */ -#ifndef GL_ANGLE_explicit_context -#define GL_ANGLE_explicit_context -typedef void *GLeglContext; -#include "gl2ext_explicit_context_autogen.inc" -#include "../GLES3/gl3ext_explicit_context_autogen.inc" -#include "../GLES3/gl31ext_explicit_context_autogen.inc" -#include "../GLES3/gl32.h" -#include "../GLES3/gl32ext_explicit_context_autogen.inc" -#endif /* GL_ANGLE_explicit_context */ - #ifndef GL_ANGLE_multi_draw #define GL_ANGLE_multi_draw 1 typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSANGLEPROC) (GLenum mode, const GLint *firsts, const GLsizei *counts, GLsizei drawcount); typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, const GLint *firsts, const GLsizei *counts, const GLsizei *instanceCounts, GLsizei drawcount); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSANGLEPROC) (GLenum mode, const GLsizei *counts, GLenum type, const GLvoid* const *indices, GLsizei drawcount); @@ -478,16 +468,18 @@ #endif /* GL_ANGLE_texture_external_update */ #ifndef GL_ANGLE_get_image #define GL_ANGLE_get_image typedef void (GL_APIENTRYP PFNGLGETTEXIMAGEANGLEPROC) (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (GL_APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEANGLEPROC) (GLenum target, GLint level, void *pixels); typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERIMAGEANGLEPROC) (GLenum target, GLenum format, GLenum type, void *pixels); #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetTexImageANGLE (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GL_APICALL void GL_APIENTRY glGetCompressedTexImageANGLE (GLenum target, GLint level, void *pixels); GL_APICALL void GL_APIENTRY glGetRenderbufferImageANGLE (GLenum target, GLenum format, GLenum type, void *pixels); #endif -#endif /* GL_ANGLE_texture_external_update */ +#endif /* GL_ANGLE_get_image */ #ifndef GL_WEBGL_video_texture #define GL_WEBGL_video_texture 1 #define GL_TEXTURE_VIDEO_IMAGE_WEBGL 0x9248 #define GL_SAMPLER_VIDEO_IMAGE_WEBGL 0x9249 @@ -518,19 +510,19 @@ #define GL_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT_ANGLE 0x00000020 #define GL_USAGE_TRANSIENT_ATTACHMENT_BIT_ANGLE 0x00000040 #define GL_USAGE_INPUT_ATTACHMENT_BIT_ANGLE 0x00000080 #define GL_USAGE_SHADING_RATE_IMAGE_BIT_ANGLE 0x00000100 #define GL_USAGE_FRAGMENT_DENSITY_MAP_BIT_ANGLE 0x00000200 -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DANGLEPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DANGLEPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DANGLEPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DANGLEPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DANGLE (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DANGLE (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); +GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DANGLE (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DANGLE (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); +GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags, const void *imageCreateInfoPNext); #endif #endif /* GL_ANGLE_memory_object_flags */ #ifndef GL_ANGLE_memory_object_fuchsia #define GL_ANGLE_memory_object_fuchsia 1 @@ -558,10 +550,20 @@ GLenum handleType, GLuint handle); #endif #endif /* GL_ANGLE_semaphore_fuchsia */ +#ifndef GL_ANGLE_vulkan_image +#define GL_ANGLE_vulkan_image 1 +typedef void(GL_APIENTRYP PFNGLACQUIRETEXTURESANGLEPROC)(GLuint numTexture, const GLuint *textures, const GLenum *layouts); +typedef void(GL_APIENTRYP PFNGLRELEASETEXTURESANGLEPROC)(GLuint numTexture, const GLuint *textures, GLenum *layouts); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glAcquireTexturesANGLE(GLuint numTexture, const GLuint *textures, const GLenum *layouts); +GL_APICALL void GL_APIENTRY glReleaseTexturesANGLE(GLuint numTexture, const GLuint *textures, GLenum *layouts); +#endif +#endif /* GL_ANGLE_vulkan_image */ + #ifndef GL_CHROMIUM_texture_filtering_hint #define GL_CHROMIUM_texture_filtering_hint #define GL_TEXTURE_FILTERING_HINT_CHROMIUM 0x8AF0 #endif /* GL_CHROMIUM_texture_filtering_hint */ @@ -573,8 +575,42 @@ #ifndef GL_ANGLE_get_serialized_context_string #define GL_ANGLE_get_serialized_context_string #define GL_SERIALIZED_CONTEXT_STRING_ANGLE 0x96B0 #endif /* GL_ANGLE_get_serialized_context_string */ +#ifndef GL_ANGLE_robust_fragment_shader_output +#define GL_ANGLE_robust_fragment_shader_output +#define GL_ROBUST_FRAGMENT_SHADER_OUTPUT_ANGLE 0x96B9 +#endif /* GL_ANGLE_robust_fragment_shader_output */ + // clang-format on +#ifndef GL_ANGLE_yuv_internal_format +#define GL_ANGLE_yuv_internal_format + +// YUV formats introduced by GL_ANGLE_yuv_internal_format +// 8-bit YUV formats +#define GL_G8_B8R8_2PLANE_420_UNORM_ANGLE 0x96B1 +#define GL_G8_B8_R8_3PLANE_420_UNORM_ANGLE 0x96B2 + +// 10-bit YUV formats +#define GL_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_ANGLE 0x96B3 +#define GL_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_ANGLE 0x96B4 + +// 12-bit YUV formats +#define GL_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_ANGLE 0x96B5 +#define GL_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_ANGLE 0x96B6 + +// 16-bit YUV formats +#define GL_G16_B16R16_2PLANE_420_UNORM_ANGLE 0x96B7 +#define GL_G16_B16_R16_3PLANE_420_UNORM_ANGLE 0x96B8 + +#endif /* GL_ANGLE_yuv_internal_format */ + +#ifndef GL_ANGLE_rgbx_internal_format +#define GL_ANGLE_rgbx_internal_format + +#define GL_RGBX8_ANGLE 0x96BA + +#endif /* GL_ANGLE_rgbx_internal_format */ + #endif // INCLUDE_GLES2_GL2EXT_ANGLE_H_ diff --git a/gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc b/gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc +++ /dev/null @@ -1,896 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. -// -// Copyright 2020 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. -// -// gl2ext_explicit_context_autogen.inc: -// Function declarations for the EGL_ANGLE_explicit_context extension - -typedef void (GL_APIENTRYP PFNGLACTIVETEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLenum texture); -typedef void (GL_APIENTRYP PFNGLATTACHSHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint framebuffer); -typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLBINDTEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint texture); -typedef void (GL_APIENTRYP PFNGLBLENDCOLORCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCCONTEXTANGLEPROC)(GLeglContext ctx, GLenum sfactor, GLenum dfactor); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GL_APIENTRYP PFNGLBUFFERDATACONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATACONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLCLEARCONTEXTANGLEPROC)(GLeglContext ctx, GLbitfield mask); -typedef void (GL_APIENTRYP PFNGLCLEARCOLORCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat d); -typedef void (GL_APIENTRYP PFNGLCLEARSTENCILCONTEXTANGLEPROC)(GLeglContext ctx, GLint s); -typedef void (GL_APIENTRYP PFNGLCOLORMASKCONTEXTANGLEPROC)(GLeglContext ctx, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GL_APIENTRYP PFNGLCOMPILESHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type); -typedef void (GL_APIENTRYP PFNGLCULLFACECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program); -typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLDELETESHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader); -typedef void (GL_APIENTRYP PFNGLDELETETEXTURESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *textures); -typedef void (GL_APIENTRYP PFNGLDEPTHFUNCCONTEXTANGLEPROC)(GLeglContext ctx, GLenum func); -typedef void (GL_APIENTRYP PFNGLDEPTHMASKCONTEXTANGLEPROC)(GLeglContext ctx, GLboolean flag); -typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat n, GLfloat f); -typedef void (GL_APIENTRYP PFNGLDETACHSHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint shader); -typedef void (GL_APIENTRYP PFNGLDISABLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum cap); -typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices); -typedef void (GL_APIENTRYP PFNGLENABLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum cap); -typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index); -typedef void (GL_APIENTRYP PFNGLFINISHCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLFLUSHCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GL_APIENTRYP PFNGLFRONTFACECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLGENBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *buffers); -typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *framebuffers); -typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *renderbuffers); -typedef void (GL_APIENTRYP PFNGLGENTEXTURESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *textures); -typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLboolean *data); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef GLenum (GL_APIENTRYP PFNGLGETERRORCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLGETFLOATVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLfloat *data); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETINTEGERVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint *data); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATCONTEXTANGLEPROC)(GLeglContext ctx, GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCECONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef void (GL_APIENTRYP PFNGLGETSHADERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLenum pname, GLint *params); -typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGCONTEXTANGLEPROC)(GLeglContext ctx, GLenum name); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, void **pointer); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLHINTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum mode); -typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buffer); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDCONTEXTANGLEPROC)(GLeglContext ctx, GLenum cap); -typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint framebuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program); -typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint renderbuffer); -typedef GLboolean (GL_APIENTRYP PFNGLISSHADERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader); -typedef GLboolean (GL_APIENTRYP PFNGLISTEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLuint texture); -typedef void (GL_APIENTRYP PFNGLLINEWIDTHCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat width); -typedef void (GL_APIENTRYP PFNGLLINKPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program); -typedef void (GL_APIENTRYP PFNGLPIXELSTOREICONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat factor, GLfloat units); -typedef void (GL_APIENTRYP PFNGLREADPIXELSCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGECONTEXTANGLEPROC)(GLeglContext ctx, GLfloat value, GLboolean invert); -typedef void (GL_APIENTRYP PFNGLSCISSORCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSHADERBINARYCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -typedef void (GL_APIENTRYP PFNGLSHADERSOURCECONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCCONTEXTANGLEPROC)(GLeglContext ctx, GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKCONTEXTANGLEPROC)(GLeglContext ctx, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLuint mask); -typedef void (GL_APIENTRYP PFNGLSTENCILOPCONTEXTANGLEPROC)(GLeglContext ctx, GLenum fail, GLenum zfail, GLenum zpass); -typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATECONTEXTANGLEPROC)(GLeglContext ctx, GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLfloat *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM1ICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1IVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2ICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2IVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3ICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3IVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4ICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4IVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLfloat x); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLfloat *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLVIEWPORTCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLuint program); -typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint color, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint array); -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVCONTEXTANGLEPROC)(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum origin, GLenum depth); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *memoryObjects); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLsizei count, const GLchar **strings); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLDEBUGPROCKHR callback, const void *userParam); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *fences); -typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *memoryObjects); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLDISABLEIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISABLEIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLenum *bufs); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLENABLEIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLENABLEIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLENDQUERYEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLFINISHFENCENVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint fence); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -typedef void (GL_APIENTRYP PFNGLGENFENCESNVCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *fences); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *semaphores); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, void **params); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint fence, GLenum pname, GLint *params); -typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, const GLchar *name); -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint64 *data); -typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint memoryObject, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, void **params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLenum pname, GLint *params); -typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLenum pname, GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLubyte *data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLenum handleType, GLint fd); -typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei length, const GLchar *marker); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint fence); -typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint memoryObject); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id); -typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint array); -typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum access); -typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLuint count); -typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint memoryObject, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat value); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); -typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRCONTEXTANGLEPROC)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLint length); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei length, const GLchar *marker); -typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum target); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLenum pname, const GLuint64 *params); -typedef void (GL_APIENTRYP PFNGLSETFENCENVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint fence, GLenum condition); -typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint fence); -typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLuint divisor); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLuint divisor); -typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTCONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -typedef void (GL_APIENTRYP PFNGLBINDUNIFORMLOCATIONCHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, const GLchar* name); -typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONCHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLenum components); -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -typedef void (GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint x, GLint y, GLint width, GLint height, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDCOPYTEXTURECHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sourceId, GLuint destId); -typedef void (GL_APIENTRYP PFNGLREQUESTEXTENSIONANGLECONTEXTANGLEPROC)(GLeglContext ctx, const GLchar * name); -typedef void (GL_APIENTRYP PFNGLDISABLEEXTENSIONANGLECONTEXTANGLEPROC)(GLeglContext ctx, const GLchar * name); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLboolean * params); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETFLOATVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETINTEGERVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * data); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETSHADERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint shader, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, void ** pointer); -typedef void (GL_APIENTRYP PFNGLREADPIXELSROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei * length, GLsizei * columns, GLsizei * rows, void * pixels); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLfloat * params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLint * params); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLsizei xoffset, GLsizei yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, void ** params); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLint * data); -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * data); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLint64 * data); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLuint pname, GLsizei bufSize, const GLint * param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLfloat * param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLboolean * data); -typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLuint index, GLsizei bufSize, GLsizei * length, GLfloat * val); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVROBUSTANGLEROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, void ** params); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei * length, GLsizei * columns, GLsizei * rows, void * data); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLint * params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLuint * params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLint * param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint * param); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VROBUSTANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint64 * params); -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURE3DANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -typedef void (GL_APIENTRYP PFNGLCOPYSUBTEXTURE3DANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLint z, GLint width, GLint height, GLint depth, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat * params); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, const GLsizei *instanceCounts, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINSTANCEDANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, const GLsizei*instanceCounts, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei instanceCount, GLuint baseInstance); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCounts, GLint baseVertex, GLuint baseInstance); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINSTANCEDBASEINSTANCEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, const GLsizei *instanceCounts, const GLuint *baseInstances, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, const GLsizei *instanceCounts, const GLint *baseVertices, const GLuint *baseInstances, GLsizei drawcount); -typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLuint index, GLfloat * val); -typedef void (GL_APIENTRYP PFNGLSAMPLEMASKIANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint maskNumber, GLbitfield mask); -typedef void (GL_APIENTRYP PFNGLPROVOKINGVERTEXANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode); -typedef void (GL_APIENTRYP PFNGLLOSECONTEXTCHROMIUMCONTEXTANGLEPROC)(GLeglContext ctx, GLenum current, GLenum other); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DEXTERNALANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type); -typedef void (GL_APIENTRYP PFNGLINVALIDATETEXTUREANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLGETTEXIMAGEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERIMAGEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum format, GLenum type, void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS2DMULTISAMPLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEMFLAGS3DMULTISAMPLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYZIRCONHANDLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint memory, GLuint64 size, GLenum handleType, GLuint handle); -typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREZIRCONHANDLEANGLECONTEXTANGLEPROC)(GLeglContext ctx, GLuint semaphore, GLenum handleType, GLuint handle); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveTextureContextANGLE(GLeglContext ctx, GLenum texture); -GL_APICALL void GL_APIENTRY glAttachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocationContextANGLE(GLeglContext ctx, GLuint program, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindBufferContextANGLE(GLeglContext ctx, GLenum target, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindFramebufferContextANGLE(GLeglContext ctx, GLenum target, GLuint framebuffer); -GL_APICALL void GL_APIENTRY glBindRenderbufferContextANGLE(GLeglContext ctx, GLenum target, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glBindTextureContextANGLE(GLeglContext ctx, GLenum target, GLuint texture); -GL_APICALL void GL_APIENTRY glBlendColorContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glBlendEquationContextANGLE(GLeglContext ctx, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateContextANGLE(GLeglContext ctx, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendFuncContextANGLE(GLeglContext ctx, GLenum sfactor, GLenum dfactor); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateContextANGLE(GLeglContext ctx, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -GL_APICALL void GL_APIENTRY glBufferDataContextANGLE(GLeglContext ctx, GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubDataContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatusContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glClearContextANGLE(GLeglContext ctx, GLbitfield mask); -GL_APICALL void GL_APIENTRY glClearColorContextANGLE(GLeglContext ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GL_APICALL void GL_APIENTRY glClearDepthfContextANGLE(GLeglContext ctx, GLfloat d); -GL_APICALL void GL_APIENTRY glClearStencilContextANGLE(GLeglContext ctx, GLint s); -GL_APICALL void GL_APIENTRY glColorMaskContextANGLE(GLeglContext ctx, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GL_APICALL void GL_APIENTRY glCompileShaderContextANGLE(GLeglContext ctx, GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCopyTexImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GL_APICALL void GL_APIENTRY glCopyTexSubImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLuint GL_APIENTRY glCreateProgramContextANGLE(GLeglContext ctx); -GL_APICALL GLuint GL_APIENTRY glCreateShaderContextANGLE(GLeglContext ctx, GLenum type); -GL_APICALL void GL_APIENTRY glCullFaceContextANGLE(GLeglContext ctx, GLenum mode); -GL_APICALL void GL_APIENTRY glDeleteBuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *buffers); -GL_APICALL void GL_APIENTRY glDeleteFramebuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glDeleteProgramContextANGLE(GLeglContext ctx, GLuint program); -GL_APICALL void GL_APIENTRY glDeleteRenderbuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glDeleteShaderContextANGLE(GLeglContext ctx, GLuint shader); -GL_APICALL void GL_APIENTRY glDeleteTexturesContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *textures); -GL_APICALL void GL_APIENTRY glDepthFuncContextANGLE(GLeglContext ctx, GLenum func); -GL_APICALL void GL_APIENTRY glDepthMaskContextANGLE(GLeglContext ctx, GLboolean flag); -GL_APICALL void GL_APIENTRY glDepthRangefContextANGLE(GLeglContext ctx, GLfloat n, GLfloat f); -GL_APICALL void GL_APIENTRY glDetachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glDisableContextANGLE(GLeglContext ctx, GLenum cap); -GL_APICALL void GL_APIENTRY glDisableVertexAttribArrayContextANGLE(GLeglContext ctx, GLuint index); -GL_APICALL void GL_APIENTRY glDrawArraysContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElementsContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices); -GL_APICALL void GL_APIENTRY glEnableContextANGLE(GLeglContext ctx, GLenum cap); -GL_APICALL void GL_APIENTRY glEnableVertexAttribArrayContextANGLE(GLeglContext ctx, GLuint index); -GL_APICALL void GL_APIENTRY glFinishContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glFlushContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glFramebufferRenderbufferContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFrontFaceContextANGLE(GLeglContext ctx, GLenum mode); -GL_APICALL void GL_APIENTRY glGenBuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *buffers); -GL_APICALL void GL_APIENTRY glGenFramebuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *framebuffers); -GL_APICALL void GL_APIENTRY glGenRenderbuffersContextANGLE(GLeglContext ctx, GLsizei n, GLuint *renderbuffers); -GL_APICALL void GL_APIENTRY glGenTexturesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *textures); -GL_APICALL void GL_APIENTRY glGenerateMipmapContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glGetActiveAttribContextANGLE(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetActiveUniformContextANGLE(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -GL_APICALL void GL_APIENTRY glGetAttachedShadersContextANGLE(GLeglContext ctx, GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); -GL_APICALL GLint GL_APIENTRY glGetAttribLocationContextANGLE(GLeglContext ctx, GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetBooleanvContextANGLE(GLeglContext ctx, GLenum pname, GLboolean *data); -GL_APICALL void GL_APIENTRY glGetBufferParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL GLenum GL_APIENTRY glGetErrorContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glGetFloatvContextANGLE(GLeglContext ctx, GLenum pname, GLfloat *data); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetIntegervContextANGLE(GLeglContext ctx, GLenum pname, GLint *data); -GL_APICALL void GL_APIENTRY glGetProgramInfoLogContextANGLE(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetProgramivContextANGLE(GLeglContext ctx, GLuint program, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLogContextANGLE(GLeglContext ctx, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormatContextANGLE(GLeglContext ctx, GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); -GL_APICALL void GL_APIENTRY glGetShaderSourceContextANGLE(GLeglContext ctx, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -GL_APICALL void GL_APIENTRY glGetShaderivContextANGLE(GLeglContext ctx, GLuint shader, GLenum pname, GLint *params); -GL_APICALL const GLubyte *GL_APIENTRY glGetStringContextANGLE(GLeglContext ctx, GLenum name); -GL_APICALL void GL_APIENTRY glGetTexParameterfvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetTexParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL GLint GL_APIENTRY glGetUniformLocationContextANGLE(GLeglContext ctx, GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetUniformfvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetUniformivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointervContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, void **pointer); -GL_APICALL void GL_APIENTRY glGetVertexAttribfvContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribivContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glHintContextANGLE(GLeglContext ctx, GLenum target, GLenum mode); -GL_APICALL GLboolean GL_APIENTRY glIsBufferContextANGLE(GLeglContext ctx, GLuint buffer); -GL_APICALL GLboolean GL_APIENTRY glIsEnabledContextANGLE(GLeglContext ctx, GLenum cap); -GL_APICALL GLboolean GL_APIENTRY glIsFramebufferContextANGLE(GLeglContext ctx, GLuint framebuffer); -GL_APICALL GLboolean GL_APIENTRY glIsProgramContextANGLE(GLeglContext ctx, GLuint program); -GL_APICALL GLboolean GL_APIENTRY glIsRenderbufferContextANGLE(GLeglContext ctx, GLuint renderbuffer); -GL_APICALL GLboolean GL_APIENTRY glIsShaderContextANGLE(GLeglContext ctx, GLuint shader); -GL_APICALL GLboolean GL_APIENTRY glIsTextureContextANGLE(GLeglContext ctx, GLuint texture); -GL_APICALL void GL_APIENTRY glLineWidthContextANGLE(GLeglContext ctx, GLfloat width); -GL_APICALL void GL_APIENTRY glLinkProgramContextANGLE(GLeglContext ctx, GLuint program); -GL_APICALL void GL_APIENTRY glPixelStoreiContextANGLE(GLeglContext ctx, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glPolygonOffsetContextANGLE(GLeglContext ctx, GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixelsContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -GL_APICALL void GL_APIENTRY glReleaseShaderCompilerContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glRenderbufferStorageContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSampleCoverageContextANGLE(GLeglContext ctx, GLfloat value, GLboolean invert); -GL_APICALL void GL_APIENTRY glScissorContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinaryContextANGLE(GLeglContext ctx, GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSourceContextANGLE(GLeglContext ctx, GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -GL_APICALL void GL_APIENTRY glStencilFuncContextANGLE(GLeglContext ctx, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilFuncSeparateContextANGLE(GLeglContext ctx, GLenum face, GLenum func, GLint ref, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskContextANGLE(GLeglContext ctx, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilMaskSeparateContextANGLE(GLeglContext ctx, GLenum face, GLuint mask); -GL_APICALL void GL_APIENTRY glStencilOpContextANGLE(GLeglContext ctx, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glStencilOpSeparateContextANGLE(GLeglContext ctx, GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -GL_APICALL void GL_APIENTRY glTexImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexParameterfContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glTexParameterfvContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLfloat *params); -GL_APICALL void GL_APIENTRY glTexParameteriContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glTexParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexSubImage2DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glUniform1fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glUniform1fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform1iContextANGLE(GLeglContext ctx, GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glUniform1ivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform2fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glUniform2fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform2iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glUniform2ivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform3fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glUniform3fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform3iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glUniform3ivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniform4fContextANGLE(GLeglContext ctx, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glUniform4fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniform4iContextANGLE(GLeglContext ctx, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glUniform4ivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUseProgramContextANGLE(GLeglContext ctx, GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgramContextANGLE(GLeglContext ctx, GLuint program); -GL_APICALL void GL_APIENTRY glVertexAttrib1fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x); -GL_APICALL void GL_APIENTRY glVertexAttrib1fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib2fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y); -GL_APICALL void GL_APIENTRY glVertexAttrib2fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib3fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y, GLfloat z); -GL_APICALL void GL_APIENTRY glVertexAttrib3fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttrib4fContextANGLE(GLeglContext ctx, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GL_APICALL void GL_APIENTRY glVertexAttrib4fvContextANGLE(GLeglContext ctx, GLuint index, const GLfloat *v); -GL_APICALL void GL_APIENTRY glVertexAttribPointerContextANGLE(GLeglContext ctx, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); -GL_APICALL void GL_APIENTRY glViewportContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glActiveShaderProgramEXTContextANGLE(GLeglContext ctx, GLuint pipeline, GLuint program); -GL_APICALL void GL_APIENTRY glBeginQueryEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glBindFragDataLocationEXTContextANGLE(GLeglContext ctx, GLuint program, GLuint color, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXTContextANGLE(GLeglContext ctx, GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); -GL_APICALL void GL_APIENTRY glBindProgramPipelineEXTContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL void GL_APIENTRY glBindVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array); -GL_APICALL void GL_APIENTRY glBlendBarrierKHRContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXTContextANGLE(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOESContextANGLE(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendEquationiEXTContextANGLE(GLeglContext ctx, GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendEquationiOESContextANGLE(GLeglContext ctx, GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXTContextANGLE(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOESContextANGLE(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciEXTContextANGLE(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlendFunciOESContextANGLE(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glBlitFramebufferANGLEContextANGLE(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GL_APICALL void GL_APIENTRY glBlitFramebufferNVContextANGLE(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GL_APICALL void GL_APIENTRY glBufferStorageEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -GL_APICALL void GL_APIENTRY glBufferStorageExternalEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -GL_APICALL void GL_APIENTRY glBufferStorageMemEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glClipControlEXTContextANGLE(GLeglContext ctx, GLenum origin, GLenum depth); -GL_APICALL void GL_APIENTRY glColorMaskiEXTContextANGLE(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL void GL_APIENTRY glColorMaskiOESContextANGLE(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOESContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOESContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCopyImageSubDataEXTContextANGLE(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GL_APICALL void GL_APIENTRY glCopyImageSubDataOESContextANGLE(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOESContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *memoryObjects); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXTContextANGLE(GLeglContext ctx, GLenum type, GLsizei count, const GLchar **strings); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHRContextANGLE(GLeglContext ctx, GLDEBUGPROCKHR callback, const void *userParam); -GL_APICALL void GL_APIENTRY glDebugMessageControlKHRContextANGLE(GLeglContext ctx, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertKHRContextANGLE(GLeglContext ctx, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDeleteFencesNVContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *fences); -GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *memoryObjects); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glDeleteQueriesEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *semaphores); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysOESContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glDisableiEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDisableiOESContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDiscardFramebufferEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments); -GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXTContextANGLE(GLeglContext ctx, GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawBuffersEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs); -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXTContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOESContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEnableiEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glEnableiOESContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glEndQueryEXTContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glFinishFenceNVContextANGLE(GLeglContext ctx, GLuint fence); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length); -GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXTContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); -GL_APICALL void GL_APIENTRY glFramebufferTexture3DOESContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -GL_APICALL void GL_APIENTRY glFramebufferTextureEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level); -GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVRContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); -GL_APICALL void GL_APIENTRY glGenFencesNVContextANGLE(GLeglContext ctx, GLsizei n, GLuint *fences); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGenQueriesEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glGenSemaphoresEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *semaphores); -GL_APICALL void GL_APIENTRY glGenVertexArraysOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *arrays); -GL_APICALL void GL_APIENTRY glGetBufferPointervOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, void **params); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHRContextANGLE(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL void GL_APIENTRY glGetFenceivNVContextANGLE(GLeglContext ctx, GLuint fence, GLenum pname, GLint *params); -GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXTContextANGLE(GLeglContext ctx, GLuint program, const GLchar *name); -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXTContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glGetInteger64vEXTContextANGLE(GLeglContext ctx, GLenum pname, GLint64 *data); -GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXTContextANGLE(GLeglContext ctx, GLuint memoryObject, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetObjectLabelEXTContextANGLE(GLeglContext ctx, GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervKHRContextANGLE(GLeglContext ctx, GLenum pname, void **params); -GL_APICALL void GL_APIENTRY glGetProgramBinaryOESContextANGLE(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXTContextANGLE(GLeglContext ctx, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXTContextANGLE(GLeglContext ctx, GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXTContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryivEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXTContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOESContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXTContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOESContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXTContextANGLE(GLeglContext ctx, GLuint semaphore, GLenum pname, GLuint64 *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLEContextANGLE(GLeglContext ctx, GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); -GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXTContextANGLE(GLeglContext ctx, GLenum pname, GLubyte *data); -GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLubyte *data); -GL_APICALL void GL_APIENTRY glGetnUniformfvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params); -GL_APICALL void GL_APIENTRY glImportMemoryFdEXTContextANGLE(GLeglContext ctx, GLuint memory, GLuint64 size, GLenum handleType, GLint fd); -GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXTContextANGLE(GLeglContext ctx, GLuint semaphore, GLenum handleType, GLint fd); -GL_APICALL void GL_APIENTRY glInsertEventMarkerEXTContextANGLE(GLeglContext ctx, GLsizei length, const GLchar *marker); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXTContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediOESContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL GLboolean GL_APIENTRY glIsFenceNVContextANGLE(GLeglContext ctx, GLuint fence); -GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXTContextANGLE(GLeglContext ctx, GLuint memoryObject); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXTContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL GLboolean GL_APIENTRY glIsQueryEXTContextANGLE(GLeglContext ctx, GLuint id); -GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXTContextANGLE(GLeglContext ctx, GLuint semaphore); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array); -GL_APICALL void GL_APIENTRY glLabelObjectEXTContextANGLE(GLeglContext ctx, GLenum type, GLuint object, GLsizei length, const GLchar *label); -GL_APICALL void *GL_APIENTRY glMapBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum access); -GL_APICALL void *GL_APIENTRY glMapBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count); -GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXTContextANGLE(GLeglContext ctx, GLuint memoryObject, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glMinSampleShadingOESContextANGLE(GLeglContext ctx, GLfloat value); -GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXTContextANGLE(GLeglContext ctx, GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex); -GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXTContextANGLE(GLeglContext ctx, GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); -GL_APICALL void GL_APIENTRY glObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glPatchParameteriEXTContextANGLE(GLeglContext ctx, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glPopDebugGroupKHRContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glPopGroupMarkerEXTContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXTContextANGLE(GLeglContext ctx, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -GL_APICALL void GL_APIENTRY glProgramBinaryOESContextANGLE(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLint length); -GL_APICALL void GL_APIENTRY glProgramParameteriEXTContextANGLE(GLeglContext ctx, GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glProgramUniform1fEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glProgramUniform1fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform1iEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1ivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform1uiEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1uivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glProgramUniform2fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2iEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2ivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2uiEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2uivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glProgramUniform3fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3iEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3ivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3uiEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3uivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glProgramUniform4fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4iEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4ivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4uiEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4uivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glPushDebugGroupKHRContextANGLE(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glPushGroupMarkerEXTContextANGLE(GLeglContext ctx, GLsizei length, const GLchar *marker); -GL_APICALL void GL_APIENTRY glQueryCounterEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum target); -GL_APICALL void GL_APIENTRY glReadnPixelsEXTContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glSamplerParameterIivEXTContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIivOESContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXTContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivOESContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXTContextANGLE(GLeglContext ctx, GLuint semaphore, GLenum pname, const GLuint64 *params); -GL_APICALL void GL_APIENTRY glSetFenceNVContextANGLE(GLeglContext ctx, GLuint fence, GLenum condition); -GL_APICALL void GL_APIENTRY glSignalSemaphoreEXTContextANGLE(GLeglContext ctx, GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); -GL_APICALL GLboolean GL_APIENTRY glTestFenceNVContextANGLE(GLeglContext ctx, GLuint fence); -GL_APICALL void GL_APIENTRY glTexBufferEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glTexBufferRangeOESContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glTexImage3DOESContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexParameterIivEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glTexStorage1DEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -GL_APICALL void GL_APIENTRY glTexStorage2DEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOESContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GL_APICALL void GL_APIENTRY glTexStorageMem2DEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXTContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); -GL_APICALL void GL_APIENTRY glTexSubImage3DOESContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOESContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glUseProgramStagesEXTContextANGLE(GLeglContext ctx, GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXTContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLEContextANGLE(GLeglContext ctx, GLuint index, GLuint divisor); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXTContextANGLE(GLeglContext ctx, GLuint index, GLuint divisor); -GL_APICALL void GL_APIENTRY glWaitSemaphoreEXTContextANGLE(GLeglContext ctx, GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); -GL_APICALL void GL_APIENTRY glBindUniformLocationCHROMIUMContextANGLE(GLeglContext ctx, GLuint program, GLint location, const GLchar* name); -GL_APICALL void GL_APIENTRY glCoverageModulationCHROMIUMContextANGLE(GLeglContext ctx, GLenum components); -GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUMContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUMContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint x, GLint y, GLint width, GLint height, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -GL_APICALL void GL_APIENTRY glCompressedCopyTextureCHROMIUMContextANGLE(GLeglContext ctx, GLuint sourceId, GLuint destId); -GL_APICALL void GL_APIENTRY glRequestExtensionANGLEContextANGLE(GLeglContext ctx, const GLchar * name); -GL_APICALL void GL_APIENTRY glDisableExtensionANGLEContextANGLE(GLeglContext ctx, const GLchar * name); -GL_APICALL void GL_APIENTRY glGetBooleanvRobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLboolean * params); -GL_APICALL void GL_APIENTRY glGetBufferParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetFloatvRobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetIntegervRobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * data); -GL_APICALL void GL_APIENTRY glGetProgramivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetRenderbufferParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetShaderivRobustANGLEContextANGLE(GLeglContext ctx, GLuint shader, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetTexParameterfvRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetTexParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetUniformfvRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetUniformivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetVertexAttribfvRobustANGLEContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetVertexAttribivRobustANGLEContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointervRobustANGLEContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, void ** pointer); -GL_APICALL void GL_APIENTRY glReadPixelsRobustANGLEContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei * length, GLsizei * columns, GLsizei * rows, void * pixels); -GL_APICALL void GL_APIENTRY glTexImage2DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -GL_APICALL void GL_APIENTRY glTexParameterfvRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLfloat * params); -GL_APICALL void GL_APIENTRY glTexParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLint * params); -GL_APICALL void GL_APIENTRY glTexSubImage2DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -GL_APICALL void GL_APIENTRY glTexImage3DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, const void * pixels); -GL_APICALL void GL_APIENTRY glCompressedTexImage2DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLsizei xoffset, GLsizei yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei dataSize, const GLvoid * data); -GL_APICALL void GL_APIENTRY glGetQueryivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glGetBufferPointervRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, void ** params); -GL_APICALL void GL_APIENTRY glGetIntegeri_vRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLint * data); -GL_APICALL void GL_APIENTRY glGetInternalformativRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetVertexAttribIivRobustANGLEContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetVertexAttribIuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glGetUniformuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glGetActiveUniformBlockivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetInteger64vRobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * data); -GL_APICALL void GL_APIENTRY glGetInteger64i_vRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLint64 * data); -GL_APICALL void GL_APIENTRY glGetBufferParameteri64vRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params); -GL_APICALL void GL_APIENTRY glSamplerParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLuint pname, GLsizei bufSize, const GLint * param); -GL_APICALL void GL_APIENTRY glSamplerParameterfvRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLfloat * param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterfvRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetFramebufferParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetProgramInterfaceivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetBooleani_vRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLsizei bufSize, GLsizei * length, GLboolean * data); -GL_APICALL void GL_APIENTRY glGetMultisamplefvRobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLuint index, GLsizei bufSize, GLsizei * length, GLfloat * val); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetPointervRobustANGLERobustANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLsizei bufSize, GLsizei * length, void ** params); -GL_APICALL void GL_APIENTRY glReadnPixelsRobustANGLEContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei * length, GLsizei * columns, GLsizei * rows, void * data); -GL_APICALL void GL_APIENTRY glGetnUniformfvRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLfloat * params); -GL_APICALL void GL_APIENTRY glGetnUniformivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetnUniformuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glTexParameterIivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLint * params); -GL_APICALL void GL_APIENTRY glTexParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, const GLuint * params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glSamplerParameterIivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLint * param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint * param); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params); -GL_APICALL void GL_APIENTRY glGetQueryObjectivRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params); -GL_APICALL void GL_APIENTRY glGetQueryObjecti64vRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params); -GL_APICALL void GL_APIENTRY glGetQueryObjectui64vRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint64 * params); -GL_APICALL void GL_APIENTRY glCopyTexture3DANGLEContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint internalFormat, GLenum destType, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -GL_APICALL void GL_APIENTRY glCopySubTexture3DANGLEContextANGLE(GLeglContext ctx, GLuint sourceId, GLint sourceLevel, GLenum destTarget, GLuint destId, GLint destLevel, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLint z, GLint width, GLint height, GLint depth, GLboolean unpackFlipY, GLboolean unpackPremultiplyAlpha, GLboolean unpackUnmultiplyAlpha); -GL_APICALL void GL_APIENTRY glTexStorage2DMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterivANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat * params); -GL_APICALL void GL_APIENTRY glMultiDrawArraysANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glMultiDrawArraysInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, const GLsizei *instanceCounts, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, const GLsizei*instanceCounts, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei instanceCount, GLuint baseInstance); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCounts, GLint baseVertex, GLuint baseInstance); -GL_APICALL void GL_APIENTRY glMultiDrawArraysInstancedBaseInstanceANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLint *firsts, const GLsizei *counts, const GLsizei *instanceCounts, const GLuint *baseInstances, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLEContextANGLE(GLeglContext ctx, GLenum mode, const GLsizei *counts, GLenum type, const GLvoid *const*indices, const GLsizei *instanceCounts, const GLint *baseVertices, const GLuint *baseInstances, GLsizei drawcount); -GL_APICALL void GL_APIENTRY glGetMultisamplefvANGLEContextANGLE(GLeglContext ctx, GLenum pname, GLuint index, GLfloat * val); -GL_APICALL void GL_APIENTRY glSampleMaskiANGLEContextANGLE(GLeglContext ctx, GLuint maskNumber, GLbitfield mask); -GL_APICALL void GL_APIENTRY glProvokingVertexANGLEContextANGLE(GLeglContext ctx, GLenum mode); -GL_APICALL void GL_APIENTRY glLoseContextCHROMIUMContextANGLE(GLeglContext ctx, GLenum current, GLenum other); -GL_APICALL void GL_APIENTRY glTexImage2DExternalANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type); -GL_APICALL void GL_APIENTRY glInvalidateTextureANGLEContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glGetTexImageANGLEContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GL_APICALL void GL_APIENTRY glGetRenderbufferImageANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum format, GLenum type, void *pixels); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags2DMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glTexStorageMemFlags3DMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset, GLbitfield createFlags, GLbitfield usageFlags); -GL_APICALL void GL_APIENTRY glImportMemoryZirconHandleANGLEContextANGLE(GLeglContext ctx, GLuint memory, GLuint64 size, GLenum handleType, GLuint handle); -GL_APICALL void GL_APIENTRY glImportSemaphoreZirconHandleANGLEContextANGLE(GLeglContext ctx, GLuint semaphore, GLenum handleType, GLuint handle); -#endif diff --git a/gfx/angle/checkout/include/GLES3/gl31ext_explicit_context_autogen.inc b/gfx/angle/checkout/include/GLES3/gl31ext_explicit_context_autogen.inc deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES3/gl31ext_explicit_context_autogen.inc +++ /dev/null @@ -1,148 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. -// -// Copyright 2020 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. -// -// gl31ext_explicit_context_autogen.inc: -// Function declarations for the EGL_ANGLE_explicit_context extension - -typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLuint program); -typedef void (GL_APIENTRYP PFNGLBINDIMAGETEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINECONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLBINDVERTEXBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum type, GLsizei count, const GLchar *const*strings); -typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTECONTEXTANGLEPROC)(GLeglContext ctx, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (GL_APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTCONTEXTANGLEPROC)(GLeglContext ctx, GLintptr indirect); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINDIRECTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, const void *indirect); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINDIRECTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLenum type, const void *indirect); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *pipelines); -typedef void (GL_APIENTRYP PFNGLGETBOOLEANI_VCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLboolean *data); -typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLuint index, GLfloat *val); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINTERFACEIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLenum pname, GLint *params); -typedef GLuint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCENAMECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint *params); -typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINECONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERCONTEXTANGLEPROC)(GLeglContext ctx, GLbitfield barriers); -typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERBYREGIONCONTEXTANGLEPROC)(GLeglContext ctx, GLbitfield barriers); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1ICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2ICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3ICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4ICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLSAMPLEMASKICONTEXTANGLEPROC)(GLeglContext ctx, GLuint maskNumber, GLbitfield mask); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINECONTEXTANGLEPROC)(GLeglContext ctx, GLuint pipeline); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBBINDINGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint attribindex, GLuint bindingindex); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBFORMATCONTEXTANGLEPROC)(GLeglContext ctx, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIFORMATCONTEXTANGLEPROC)(GLeglContext ctx, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GL_APIENTRYP PFNGLVERTEXBINDINGDIVISORCONTEXTANGLEPROC)(GLeglContext ctx, GLuint bindingindex, GLuint divisor); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glActiveShaderProgramContextANGLE(GLeglContext ctx, GLuint pipeline, GLuint program); -GL_APICALL void GL_APIENTRY glBindImageTextureContextANGLE(GLeglContext ctx, GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -GL_APICALL void GL_APIENTRY glBindProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL void GL_APIENTRY glBindVertexBufferContextANGLE(GLeglContext ctx, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvContextANGLE(GLeglContext ctx, GLenum type, GLsizei count, const GLchar *const*strings); -GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *pipelines); -GL_APICALL void GL_APIENTRY glDispatchComputeContextANGLE(GLeglContext ctx, GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -GL_APICALL void GL_APIENTRY glDispatchComputeIndirectContextANGLE(GLeglContext ctx, GLintptr indirect); -GL_APICALL void GL_APIENTRY glDrawArraysIndirectContextANGLE(GLeglContext ctx, GLenum mode, const void *indirect); -GL_APICALL void GL_APIENTRY glDrawElementsIndirectContextANGLE(GLeglContext ctx, GLenum mode, GLenum type, const void *indirect); -GL_APICALL void GL_APIENTRY glFramebufferParameteriContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glGenProgramPipelinesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *pipelines); -GL_APICALL void GL_APIENTRY glGetBooleani_vContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLboolean *data); -GL_APICALL void GL_APIENTRY glGetFramebufferParameterivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetMultisamplefvContextANGLE(GLeglContext ctx, GLenum pname, GLuint index, GLfloat *val); -GL_APICALL void GL_APIENTRY glGetProgramInterfaceivContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogContextANGLE(GLeglContext ctx, GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -GL_APICALL void GL_APIENTRY glGetProgramPipelineivContextANGLE(GLeglContext ctx, GLuint pipeline, GLenum pname, GLint *params); -GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndexContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetProgramResourceNameContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); -GL_APICALL void GL_APIENTRY glGetProgramResourceivContextANGLE(GLeglContext ctx, GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetTexLevelParameterivContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum pname, GLint *params); -GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL void GL_APIENTRY glMemoryBarrierContextANGLE(GLeglContext ctx, GLbitfield barriers); -GL_APICALL void GL_APIENTRY glMemoryBarrierByRegionContextANGLE(GLeglContext ctx, GLbitfield barriers); -GL_APICALL void GL_APIENTRY glProgramUniform1fContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0); -GL_APICALL void GL_APIENTRY glProgramUniform1fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform1iContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1ivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform1uiContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glProgramUniform1uivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2fContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1); -GL_APICALL void GL_APIENTRY glProgramUniform2fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform2iContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2ivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform2uiContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glProgramUniform2uivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3fContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -GL_APICALL void GL_APIENTRY glProgramUniform3fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform3iContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3ivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform3uiContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glProgramUniform3uivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4fContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -GL_APICALL void GL_APIENTRY glProgramUniform4fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniform4iContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4ivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLint *value); -GL_APICALL void GL_APIENTRY glProgramUniform4uiContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glProgramUniform4uivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glSampleMaskiContextANGLE(GLeglContext ctx, GLuint maskNumber, GLbitfield mask); -GL_APICALL void GL_APIENTRY glTexStorage2DMultisampleContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GL_APICALL void GL_APIENTRY glUseProgramStagesContextANGLE(GLeglContext ctx, GLuint pipeline, GLbitfield stages, GLuint program); -GL_APICALL void GL_APIENTRY glValidateProgramPipelineContextANGLE(GLeglContext ctx, GLuint pipeline); -GL_APICALL void GL_APIENTRY glVertexAttribBindingContextANGLE(GLeglContext ctx, GLuint attribindex, GLuint bindingindex); -GL_APICALL void GL_APIENTRY glVertexAttribFormatContextANGLE(GLeglContext ctx, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GL_APICALL void GL_APIENTRY glVertexAttribIFormatContextANGLE(GLeglContext ctx, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GL_APICALL void GL_APIENTRY glVertexBindingDivisorContextANGLE(GLeglContext ctx, GLuint bindingindex, GLuint divisor); -#endif diff --git a/gfx/angle/checkout/include/GLES3/gl32ext_explicit_context_autogen.inc b/gfx/angle/checkout/include/GLES3/gl32ext_explicit_context_autogen.inc deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES3/gl32ext_explicit_context_autogen.inc +++ /dev/null @@ -1,100 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. -// -// Copyright 2020 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. -// -// gl32ext_explicit_context_autogen.inc: -// Function declarations for the EGL_ANGLE_explicit_context extension - -typedef void (GL_APIENTRYP PFNGLBLENDBARRIERCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEICONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONICONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum mode); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEICONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GL_APIENTRYP PFNGLBLENDFUNCICONTEXTANGLEPROC)(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -typedef void (GL_APIENTRYP PFNGLCOLORMASKICONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATACONTEXTANGLEPROC)(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKCONTEXTANGLEPROC)(GLeglContext ctx, GLDEBUGPROC callback, const void *userParam); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -typedef void (GL_APIENTRYP PFNGLDISABLEICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GL_APIENTRYP PFNGLENABLEICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELCONTEXTANGLEPROC)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELCONTEXTANGLEPROC)(GLeglContext ctx, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (GL_APIENTRYP PFNGLGETPOINTERVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, void **params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDICONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index); -typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat value); -typedef void (GL_APIENTRYP PFNGLOBJECTLABELCONTEXTANGLEPROC)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELCONTEXTANGLEPROC)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); -typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERICONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXCONTEXTANGLEPROC)(GLeglContext ctx, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPCONTEXTANGLEPROC)(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message); -typedef void (GL_APIENTRYP PFNGLREADNPIXELSCONTEXTANGLEPROC)(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlendBarrierContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glBlendEquationSeparateiContextANGLE(GLeglContext ctx, GLuint buf, GLenum modeRGB, GLenum modeAlpha); -GL_APICALL void GL_APIENTRY glBlendEquationiContextANGLE(GLeglContext ctx, GLuint buf, GLenum mode); -GL_APICALL void GL_APIENTRY glBlendFuncSeparateiContextANGLE(GLeglContext ctx, GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBlendFunciContextANGLE(GLeglContext ctx, GLuint buf, GLenum src, GLenum dst); -GL_APICALL void GL_APIENTRY glColorMaskiContextANGLE(GLeglContext ctx, GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -GL_APICALL void GL_APIENTRY glCopyImageSubDataContextANGLE(GLeglContext ctx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -GL_APICALL void GL_APIENTRY glDebugMessageCallbackContextANGLE(GLeglContext ctx, GLDEBUGPROC callback, const void *userParam); -GL_APICALL void GL_APIENTRY glDebugMessageControlContextANGLE(GLeglContext ctx, GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); -GL_APICALL void GL_APIENTRY glDebugMessageInsertContextANGLE(GLeglContext ctx, GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); -GL_APICALL void GL_APIENTRY glDisableiContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GL_APICALL void GL_APIENTRY glEnableiContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glFramebufferTextureContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level); -GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogContextANGLE(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); -GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glGetObjectLabelContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetObjectPtrLabelContextANGLE(GLeglContext ctx, const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); -GL_APICALL void GL_APIENTRY glGetPointervContextANGLE(GLeglContext ctx, GLenum pname, void **params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetTexParameterIuivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetnUniformfvContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetnUniformivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params); -GL_APICALL void GL_APIENTRY glGetnUniformuivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GL_APICALL GLboolean GL_APIENTRY glIsEnablediContextANGLE(GLeglContext ctx, GLenum target, GLuint index); -GL_APICALL void GL_APIENTRY glMinSampleShadingContextANGLE(GLeglContext ctx, GLfloat value); -GL_APICALL void GL_APIENTRY glObjectLabelContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glObjectPtrLabelContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label); -GL_APICALL void GL_APIENTRY glPatchParameteriContextANGLE(GLeglContext ctx, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glPopDebugGroupContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxContextANGLE(GLeglContext ctx, GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); -GL_APICALL void GL_APIENTRY glPushDebugGroupContextANGLE(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message); -GL_APICALL void GL_APIENTRY glReadnPixelsContextANGLE(GLeglContext ctx, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GL_APICALL void GL_APIENTRY glSamplerParameterIivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glSamplerParameterIuivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLuint *param); -GL_APICALL void GL_APIENTRY glTexBufferContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer); -GL_APICALL void GL_APIENTRY glTexBufferRangeContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glTexParameterIivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLint *params); -GL_APICALL void GL_APIENTRY glTexParameterIuivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, const GLuint *params); -GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -#endif diff --git a/gfx/angle/checkout/include/GLES3/gl3ext_explicit_context_autogen.inc b/gfx/angle/checkout/include/GLES3/gl3ext_explicit_context_autogen.inc deleted file mode 100644 --- a/gfx/angle/checkout/include/GLES3/gl3ext_explicit_context_autogen.inc +++ /dev/null @@ -1,220 +0,0 @@ -// GENERATED FILE - DO NOT EDIT. -// Generated by generate_entry_points.py using data from gl.xml and gl_angle_ext.xml. -// -// Copyright 2020 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. -// -// gl3ext_explicit_context_autogen.inc: -// Function declarations for the EGL_ANGLE_explicit_context extension - -typedef void (GL_APIENTRYP PFNGLBEGINQUERYCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx, GLenum primitiveMode); -typedef void (GL_APIENTRYP PFNGLBINDBUFFERBASECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLuint buffer); -typedef void (GL_APIENTRYP PFNGLBINDBUFFERRANGECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GL_APIENTRYP PFNGLBINDSAMPLERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint unit, GLuint sampler); -typedef void (GL_APIENTRYP PFNGLBINDTRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint id); -typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint array); -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFICONTEXTANGLEPROC)(GLeglContext ctx, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef void (GL_APIENTRYP PFNGLCLEARBUFFERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLCLEARBUFFERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (GL_APIENTRYP PFNGLCLEARBUFFERUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCCONTEXTANGLEPROC)(GLeglContext ctx, GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATACONTEXTANGLEPROC)(GLeglContext ctx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLDELETEQUERIESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETESAMPLERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei count, const GLuint *samplers); -typedef void (GL_APIENTRYP PFNGLDELETESYNCCONTEXTANGLEPROC)(GLeglContext ctx, GLsync sync); -typedef void (GL_APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *ids); -typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, const GLenum *bufs); -typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSCONTEXTANGLEPROC)(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (GL_APIENTRYP PFNGLENDQUERYCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLENDTRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx); -typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCCONTEXTANGLEPROC)(GLeglContext ctx, GLenum condition, GLbitfield flags); -typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GL_APIENTRYP PFNGLGENQUERIESCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLGENSAMPLERSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei count, GLuint *samplers); -typedef void (GL_APIENTRYP PFNGLGENTRANSFORMFEEDBACKSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *ids); -typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSCONTEXTANGLEPROC)(GLeglContext ctx, GLsizei n, GLuint *arrays); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMECONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMSIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint64 *params); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, void **params); -typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATALOCATIONCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, const GLchar *name); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLint64 *data); -typedef void (GL_APIENTRYP PFNGLGETINTEGER64VCONTEXTANGLEPROC)(GLeglContext ctx, GLenum pname, GLint64 *data); -typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLuint index, GLint *data); -typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETQUERYIVCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLfloat *params); -typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGICONTEXTANGLEPROC)(GLeglContext ctx, GLenum name, GLuint index); -typedef void (GL_APIENTRYP PFNGLGETSYNCIVCONTEXTANGLEPROC)(GLeglContext ctx, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -typedef void (GL_APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef GLuint (GL_APIENTRYP PFNGLGETUNIFORMBLOCKINDEXCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, const GLchar *uniformBlockName); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMINDICESCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -typedef void (GL_APIENTRYP PFNGLGETUNIFORMUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLint location, GLuint *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLint *params); -typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIUIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLenum pname, GLuint *params); -typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments); -typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLboolean (GL_APIENTRYP PFNGLISQUERYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id); -typedef GLboolean (GL_APIENTRYP PFNGLISSAMPLERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler); -typedef GLboolean (GL_APIENTRYP PFNGLISSYNCCONTEXTANGLEPROC)(GLeglContext ctx, GLsync sync); -typedef GLboolean (GL_APIENTRYP PFNGLISTRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx, GLuint id); -typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint array); -typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GL_APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERICONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLenum pname, GLint value); -typedef void (GL_APIENTRYP PFNGLREADBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum src); -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKCONTEXTANGLEPROC)(GLeglContext ctx); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLfloat param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERFVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLfloat *param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERICONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, GLint param); -typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (GL_APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLuint v0); -typedef void (GL_APIENTRYP PFNGLUNIFORM1UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLuint v0, GLuint v1); -typedef void (GL_APIENTRYP PFNGLUNIFORM2UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GL_APIENTRYP PFNGLUNIFORM3UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UICONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GL_APIENTRYP PFNGLUNIFORM4UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMBLOCKBINDINGCONTEXTANGLEPROC)(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVCONTEXTANGLEPROC)(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFERCONTEXTANGLEPROC)(GLeglContext ctx, GLenum target); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLuint divisor); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4ICONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4IVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLint *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UICONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBI4UIVCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, const GLuint *v); -typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBIPOINTERCONTEXTANGLEPROC)(GLeglContext ctx, GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GL_APIENTRYP PFNGLWAITSYNCCONTEXTANGLEPROC)(GLeglContext ctx, GLsync sync, GLbitfield flags, GLuint64 timeout); -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBeginQueryContextANGLE(GLeglContext ctx, GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glBeginTransformFeedbackContextANGLE(GLeglContext ctx, GLenum primitiveMode); -GL_APICALL void GL_APIENTRY glBindBufferBaseContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLuint buffer); -GL_APICALL void GL_APIENTRY glBindBufferRangeContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glBindSamplerContextANGLE(GLeglContext ctx, GLuint unit, GLuint sampler); -GL_APICALL void GL_APIENTRY glBindTransformFeedbackContextANGLE(GLeglContext ctx, GLenum target, GLuint id); -GL_APICALL void GL_APIENTRY glBindVertexArrayContextANGLE(GLeglContext ctx, GLuint array); -GL_APICALL void GL_APIENTRY glBlitFramebufferContextANGLE(GLeglContext ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GL_APICALL void GL_APIENTRY glClearBufferfiContextANGLE(GLeglContext ctx, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -GL_APICALL void GL_APIENTRY glClearBufferfvContextANGLE(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLfloat *value); -GL_APICALL void GL_APIENTRY glClearBufferivContextANGLE(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLint *value); -GL_APICALL void GL_APIENTRY glClearBufferuivContextANGLE(GLeglContext ctx, GLenum buffer, GLint drawbuffer, const GLuint *value); -GL_APICALL GLenum GL_APIENTRY glClientWaitSyncContextANGLE(GLeglContext ctx, GLsync sync, GLbitfield flags, GLuint64 timeout); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GL_APICALL void GL_APIENTRY glCopyBufferSubDataContextANGLE(GLeglContext ctx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glCopyTexSubImage3DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glDeleteQueriesContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteSamplersContextANGLE(GLeglContext ctx, GLsizei count, const GLuint *samplers); -GL_APICALL void GL_APIENTRY glDeleteSyncContextANGLE(GLeglContext ctx, GLsync sync); -GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacksContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *ids); -GL_APICALL void GL_APIENTRY glDeleteVertexArraysContextANGLE(GLeglContext ctx, GLsizei n, const GLuint *arrays); -GL_APICALL void GL_APIENTRY glDrawArraysInstancedContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GL_APICALL void GL_APIENTRY glDrawBuffersContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs); -GL_APICALL void GL_APIENTRY glDrawElementsInstancedContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); -GL_APICALL void GL_APIENTRY glDrawRangeElementsContextANGLE(GLeglContext ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -GL_APICALL void GL_APIENTRY glEndQueryContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glEndTransformFeedbackContextANGLE(GLeglContext ctx); -GL_APICALL GLsync GL_APIENTRY glFenceSyncContextANGLE(GLeglContext ctx, GLenum condition, GLbitfield flags); -GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length); -GL_APICALL void GL_APIENTRY glFramebufferTextureLayerContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -GL_APICALL void GL_APIENTRY glGenQueriesContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glGenSamplersContextANGLE(GLeglContext ctx, GLsizei count, GLuint *samplers); -GL_APICALL void GL_APIENTRY glGenTransformFeedbacksContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids); -GL_APICALL void GL_APIENTRY glGenVertexArraysContextANGLE(GLeglContext ctx, GLsizei n, GLuint *arrays); -GL_APICALL void GL_APIENTRY glGetActiveUniformBlockNameContextANGLE(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); -GL_APICALL void GL_APIENTRY glGetActiveUniformBlockivContextANGLE(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetActiveUniformsivContextANGLE(GLeglContext ctx, GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetBufferParameteri64vContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint64 *params); -GL_APICALL void GL_APIENTRY glGetBufferPointervContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, void **params); -GL_APICALL GLint GL_APIENTRY glGetFragDataLocationContextANGLE(GLeglContext ctx, GLuint program, const GLchar *name); -GL_APICALL void GL_APIENTRY glGetInteger64i_vContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLint64 *data); -GL_APICALL void GL_APIENTRY glGetInteger64vContextANGLE(GLeglContext ctx, GLenum pname, GLint64 *data); -GL_APICALL void GL_APIENTRY glGetIntegeri_vContextANGLE(GLeglContext ctx, GLenum target, GLuint index, GLint *data); -GL_APICALL void GL_APIENTRY glGetInternalformativContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); -GL_APICALL void GL_APIENTRY glGetProgramBinaryContextANGLE(GLeglContext ctx, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GL_APICALL void GL_APIENTRY glGetQueryObjectuivContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glGetQueryivContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterfvContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLfloat *params); -GL_APICALL void GL_APIENTRY glGetSamplerParameterivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLint *params); -GL_APICALL const GLubyte *GL_APIENTRY glGetStringiContextANGLE(GLeglContext ctx, GLenum name, GLuint index); -GL_APICALL void GL_APIENTRY glGetSyncivContextANGLE(GLeglContext ctx, GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -GL_APICALL void GL_APIENTRY glGetTransformFeedbackVaryingContextANGLE(GLeglContext ctx, GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndexContextANGLE(GLeglContext ctx, GLuint program, const GLchar *uniformBlockName); -GL_APICALL void GL_APIENTRY glGetUniformIndicesContextANGLE(GLeglContext ctx, GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); -GL_APICALL void GL_APIENTRY glGetUniformuivContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLuint *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribIivContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLint *params); -GL_APICALL void GL_APIENTRY glGetVertexAttribIuivContextANGLE(GLeglContext ctx, GLuint index, GLenum pname, GLuint *params); -GL_APICALL void GL_APIENTRY glInvalidateFramebufferContextANGLE(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments); -GL_APICALL void GL_APIENTRY glInvalidateSubFramebufferContextANGLE(GLeglContext ctx, GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL GLboolean GL_APIENTRY glIsQueryContextANGLE(GLeglContext ctx, GLuint id); -GL_APICALL GLboolean GL_APIENTRY glIsSamplerContextANGLE(GLeglContext ctx, GLuint sampler); -GL_APICALL GLboolean GL_APIENTRY glIsSyncContextANGLE(GLeglContext ctx, GLsync sync); -GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedbackContextANGLE(GLeglContext ctx, GLuint id); -GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayContextANGLE(GLeglContext ctx, GLuint array); -GL_APICALL void *GL_APIENTRY glMapBufferRangeContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -GL_APICALL void GL_APIENTRY glPauseTransformFeedbackContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glProgramBinaryContextANGLE(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -GL_APICALL void GL_APIENTRY glProgramParameteriContextANGLE(GLeglContext ctx, GLuint program, GLenum pname, GLint value); -GL_APICALL void GL_APIENTRY glReadBufferContextANGLE(GLeglContext ctx, GLenum src); -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glResumeTransformFeedbackContextANGLE(GLeglContext ctx); -GL_APICALL void GL_APIENTRY glSamplerParameterfContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLfloat param); -GL_APICALL void GL_APIENTRY glSamplerParameterfvContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLfloat *param); -GL_APICALL void GL_APIENTRY glSamplerParameteriContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLint param); -GL_APICALL void GL_APIENTRY glSamplerParameterivContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, const GLint *param); -GL_APICALL void GL_APIENTRY glTexImage3DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTexStorage2DContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glTexStorage3DContextANGLE(GLeglContext ctx, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GL_APICALL void GL_APIENTRY glTexSubImage3DContextANGLE(GLeglContext ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GL_APICALL void GL_APIENTRY glTransformFeedbackVaryingsContextANGLE(GLeglContext ctx, GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); -GL_APICALL void GL_APIENTRY glUniform1uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0); -GL_APICALL void GL_APIENTRY glUniform1uivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glUniform2uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1); -GL_APICALL void GL_APIENTRY glUniform2uivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glUniform3uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2); -GL_APICALL void GL_APIENTRY glUniform3uivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glUniform4uiContextANGLE(GLeglContext ctx, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -GL_APICALL void GL_APIENTRY glUniform4uivContextANGLE(GLeglContext ctx, GLint location, GLsizei count, const GLuint *value); -GL_APICALL void GL_APIENTRY glUniformBlockBindingContextANGLE(GLeglContext ctx, GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvContextANGLE(GLeglContext ctx, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -GL_APICALL GLboolean GL_APIENTRY glUnmapBufferContextANGLE(GLeglContext ctx, GLenum target); -GL_APICALL void GL_APIENTRY glVertexAttribDivisorContextANGLE(GLeglContext ctx, GLuint index, GLuint divisor); -GL_APICALL void GL_APIENTRY glVertexAttribI4iContextANGLE(GLeglContext ctx, GLuint index, GLint x, GLint y, GLint z, GLint w); -GL_APICALL void GL_APIENTRY glVertexAttribI4ivContextANGLE(GLeglContext ctx, GLuint index, const GLint *v); -GL_APICALL void GL_APIENTRY glVertexAttribI4uiContextANGLE(GLeglContext ctx, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -GL_APICALL void GL_APIENTRY glVertexAttribI4uivContextANGLE(GLeglContext ctx, GLuint index, const GLuint *v); -GL_APICALL void GL_APIENTRY glVertexAttribIPointerContextANGLE(GLeglContext ctx, GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -GL_APICALL void GL_APIENTRY glWaitSyncContextANGLE(GLeglContext ctx, GLsync sync, GLbitfield flags, GLuint64 timeout); -#endif diff --git a/gfx/angle/checkout/include/GLSLANG/ShaderLang.h b/gfx/angle/checkout/include/GLSLANG/ShaderLang.h --- a/gfx/angle/checkout/include/GLSLANG/ShaderLang.h +++ b/gfx/angle/checkout/include/GLSLANG/ShaderLang.h @@ -24,11 +24,11 @@ // Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h #include "ShaderVars.h" // Version number for shader translation API. // It is incremented every time the API changes. -#define ANGLE_SH_VERSION 257 +#define ANGLE_SH_VERSION 272 enum ShShaderSpec { SH_GLES2_SPEC, SH_WEBGL_SPEC, @@ -72,17 +72,31 @@ // Output SPIR-V for the Vulkan backend. SH_SPIRV_VULKAN_OUTPUT = 0x8B4B, // Output SPIR-V to be cross compiled to Metal. SH_SPIRV_METAL_OUTPUT = 0x8B4C, + + // Output for MSL + SH_MSL_METAL_OUTPUT = 0x8B4D, }; // Compile options. // The Compile options type is defined in ShaderVars.h, to allow ANGLE to import the ShaderVars // header without needing the ShaderLang header. This avoids some conflicts with glslang. - -const ShCompileOptions SH_VALIDATE = 0; +// SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to +// ensure that they do not exceed the minimum +// functionality mandated in GLSL 1.0 spec, +// Appendix A, Section 4 and 5. +// There is no need to specify this parameter when +// compiling for WebGL - it is implied. +// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader, or SPIR-V binary. +// Can be queried by calling sh::GetObjectCode(). +// SH_VARIABLES: Extracts attributes, uniforms, and varyings. +// Can be queried by calling ShGetVariableInfo(). +// SH_LINE_DIRECTIVES: Emits #line directives in HLSL. +// SH_SOURCE_PATH: Tracks the source path for shaders. +// Can be queried with getSourcePath(). const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0; const ShCompileOptions SH_INTERMEDIATE_TREE = UINT64_C(1) << 1; const ShCompileOptions SH_OBJECT_CODE = UINT64_C(1) << 2; const ShCompileOptions SH_VARIABLES = UINT64_C(1) << 3; const ShCompileOptions SH_LINE_DIRECTIVES = UINT64_C(1) << 4; @@ -118,14 +132,11 @@ const ShCompileOptions SH_ENFORCE_PACKING_RESTRICTIONS = UINT64_C(1) << 9; // This flag ensures all indirect (expression-based) array indexing // is clamped to the bounds of the array. This ensures, for example, // that you cannot read off the end of a uniform, whether an array -// vec234, or mat234 type. The ShArrayIndexClampingStrategy enum, -// specified in the ShBuiltInResources when constructing the -// compiler, selects the strategy for the clamping implementation. -// TODO(http://anglebug.com/4361): fix for compute shaders. +// vec234, or mat234 type. const ShCompileOptions SH_CLAMP_INDIRECT_ARRAY_BOUNDS = UINT64_C(1) << 10; // This flag limits the complexity of an expression. const ShCompileOptions SH_LIMIT_EXPRESSION_COMPLEXITY = UINT64_C(1) << 11; @@ -234,17 +245,13 @@ // If the flag is enabled, gl_PointSize is clamped to the maximum point size specified in // ShBuiltInResources in vertex shaders. const ShCompileOptions SH_CLAMP_POINT_SIZE = UINT64_C(1) << 32; -// Turn some arithmetic operations that operate on a float vector-scalar pair into vector-vector -// operations. This is done recursively. Some scalar binary operations inside vector constructors -// are also turned into vector operations. -// -// This is targeted to work around a bug in NVIDIA OpenGL drivers that was reproducible on NVIDIA -// driver version 387.92. It works around the most common occurrences of the bug. -const ShCompileOptions SH_REWRITE_VECTOR_SCALAR_ARITHMETIC = UINT64_C(1) << 33; +// This flag indicates whether advanced blend equation should be emulated. Currently only +// implemented for the Vulkan backend. +const ShCompileOptions SH_ADD_ADVANCED_BLEND_EQUATIONS_EMULATION = UINT64_C(1) << 33; // Don't use loops to initialize uninitialized variables. Only has an effect if some kind of // variable initialization is turned on. const ShCompileOptions SH_DONT_USE_LOOPS_TO_INITIALIZE_VARIABLES = UINT64_C(1) << 34; @@ -335,19 +342,16 @@ // This flag initializes fragment shader's output variables to zero at the beginning of the fragment // shader's main(). It is intended as a workaround for drivers which get context lost if // gl_FragColor is not written. const ShCompileOptions SH_INIT_FRAGMENT_OUTPUT_VARIABLES = UINT64_C(1) << 57; -// Defines alternate strategies for implementing array index clamping. -enum ShArrayIndexClampingStrategy -{ - // Use the clamp intrinsic for array index clamping. - SH_CLAMP_WITH_CLAMP_INTRINSIC = 1, +// Transitory flag to select between producing SPIR-V directly vs using glslang. Ignored in +// non-assert-enabled builds to avoid increasing ANGLE's binary size. +const ShCompileOptions SH_GENERATE_SPIRV_THROUGH_GLSLANG = UINT64_C(1) << 58; - // Use a user-defined function for array index clamping. - SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION -}; +// Insert explicit casts for float/double/unsigned/signed int on macOS 10.15 with Intel driver +const ShCompileOptions SH_ADD_EXPLICIT_BOOL_CASTS = UINT64_C(1) << 59; // The 64 bits hash function. The first parameter is the input string; the // second parameter is the string length. using ShHashFunction64 = khronos_uint64_t (*)(const char *, size_t); @@ -376,11 +380,10 @@ int ARB_texture_rectangle; int EXT_blend_func_extended; int EXT_draw_buffers; int EXT_frag_depth; int EXT_shader_texture_lod; - int WEBGL_debug_shader_precision; int EXT_shader_framebuffer_fetch; int EXT_shader_framebuffer_fetch_non_coherent; int NV_shader_framebuffer_fetch; int NV_shader_noperspective_interpolation; int ARM_shader_framebuffer_fetch; @@ -388,18 +391,20 @@ int OVR_multiview2; int EXT_multisampled_render_to_texture; int EXT_multisampled_render_to_texture2; int EXT_YUV_target; int EXT_geometry_shader; + int OES_geometry_shader; int OES_shader_io_blocks; int EXT_shader_io_blocks; int EXT_gpu_shader5; int EXT_shader_non_constant_global_initializers; int OES_texture_storage_multisample_2d_array; int OES_texture_3D; int ANGLE_texture_multisample; int ANGLE_multi_draw; + // TODO(angleproject:3402) remove after chromium side removal to pass compilation int ANGLE_base_vertex_base_instance; int WEBGL_video_texture; int APPLE_clip_distance; int OES_texture_cube_map_array; int EXT_texture_cube_map_array; @@ -409,10 +414,15 @@ int EXT_tessellation_shader; int OES_texture_buffer; int EXT_texture_buffer; int OES_sample_variables; int EXT_clip_cull_distance; + int EXT_primitive_bounding_box; + int OES_primitive_bounding_box; + int ANGLE_base_vertex_base_instance_shader_builtin; + int ANDROID_extension_pack_es31a; + int KHR_blend_equation_advanced; // Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives // with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate // EXT_draw_buffers by using it in combination with GLES3.0 glDrawBuffers // function. This applies to Tegra K1 devices. @@ -443,14 +453,10 @@ // Name Hashing. // Set a 64 bit hash function to enable user-defined name hashing. // Default is NULL. ShHashFunction64 HashFunction; - // Selects a strategy to use when implementing array index clamping. - // Default is SH_CLAMP_WITH_CLAMP_INTRINSIC. - ShArrayIndexClampingStrategy ArrayIndexClampingStrategy; - // The maximum complexity an expression can be when SH_LIMIT_EXPRESSION_COMPLEXITY is turned on. int MaxExpressionComplexity; // The maximum depth a call stack can be. int MaxCallStackDepth; @@ -581,10 +587,19 @@ // APPLE_clip_distance/EXT_clip_cull_distance constant int MaxClipDistances; int MaxCullDistances; int MaxCombinedClipAndCullDistances; + + // Direct-to-metal backend constants: + + // Binding index for driver uniforms: + int DriverUniformsBindingIndex; + // Binding index for default uniforms: + int DefaultUniformsBindingIndex; + // Binding index for UBO's argument buffer + int UBOArgumentBufferBindingIndex; }; // // ShHandle held by but opaque to the driver. It is allocated, // managed, and de-allocated by the compiler. Its contents @@ -646,26 +661,11 @@ // Parameters: // handle: Specifies the handle of compiler to be used. // shaderStrings: Specifies an array of pointers to null-terminated strings containing the shader // source code. // numStrings: Specifies the number of elements in shaderStrings array. -// compileOptions: A mask containing the following parameters: -// SH_VALIDATE: Validates shader to ensure that it conforms to the spec -// specified during compiler construction. -// SH_VALIDATE_LOOP_INDEXING: Validates loop and indexing in the shader to -// ensure that they do not exceed the minimum -// functionality mandated in GLSL 1.0 spec, -// Appendix A, Section 4 and 5. -// There is no need to specify this parameter when -// compiling for WebGL - it is implied. -// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log. -// Can be queried by calling sh::GetInfoLog(). -// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader, or SPIR-V binary. -// Can be queried by calling sh::GetObjectCode(). -// SH_VARIABLES: Extracts attributes, uniforms, and varyings. -// Can be queried by calling ShGetVariableInfo(). -// +// compileOptions: A mask of compile options defined above. bool Compile(const ShHandle handle, const char *const shaderStrings[], size_t numStrings, ShCompileOptions compileOptions); @@ -795,10 +795,14 @@ GLenum GetTessGenMode(const ShHandle handle); GLenum GetTessGenSpacing(const ShHandle handle); GLenum GetTessGenVertexOrder(const ShHandle handle); GLenum GetTessGenPointMode(const ShHandle handle); +// Returns the blend equation list supported in the fragment shader. This is a bitset of +// gl::BlendEquationType, and can only include bits from KHR_blend_equation_advanced. +uint32_t GetAdvancedBlendEquations(const ShHandle handle); + // // Helper function to identify specs that are based on the WebGL spec. // inline bool IsWebGLBasedSpec(ShShaderSpec spec) { @@ -826,12 +830,13 @@ { LineRasterEmulation = 0, SurfaceRotation = 1, DrawableWidth = 2, DrawableHeight = 3, + Dither = 4, - InvalidEnum = 4, + InvalidEnum = 5, EnumCount = InvalidEnum, }; enum class SurfaceRotation : uint32_t { @@ -852,15 +857,25 @@ { LineRasterEmulation = 0, YFlip = 1, Rotation = 2, DrawableSize = 3, + Dither = 4, - InvalidEnum = 4, + InvalidEnum = 5, EnumCount = InvalidEnum, }; +enum ColorAttachmentDitherControl +{ + // See comments in ContextVk::updateDither and EmulateDithering.cpp + kDitherControlNoDither = 0, + kDitherControlDither4444 = 1, + kDitherControlDither5551 = 2, + kDitherControlDither565 = 3, +}; + // Interface block name containing the aggregate default uniforms extern const char kDefaultUniformsNameVS[]; extern const char kDefaultUniformsNameTCS[]; extern const char kDefaultUniformsNameTES[]; extern const char kDefaultUniformsNameGS[]; @@ -897,10 +912,13 @@ // Specialization constant to enable GL_SAMPLE_COVERAGE_VALUE emulation. extern const char kCoverageMaskEnabledConstName[]; // Specialization constant to emulate rasterizer discard. extern const char kRasterizerDiscardEnabledConstName[]; + +// Specialization constant to enable depth write in fragment shaders. +extern const char kDepthWriteEnabledConstName[]; } // namespace mtl // For backends that use glslang (the Vulkan shader compiler), i.e. Vulkan and Metal, call these to // initialize and finalize glslang itself. This can be called independently from Initialize() and // Finalize(). diff --git a/gfx/angle/checkout/include/GLSLANG/ShaderVars.h b/gfx/angle/checkout/include/GLSLANG/ShaderVars.h --- a/gfx/angle/checkout/include/GLSLANG/ShaderVars.h +++ b/gfx/angle/checkout/include/GLSLANG/ShaderVars.h @@ -13,11 +13,11 @@ #include #include #include #include -// This type is defined here to simplify ANGLE's integration with glslang for SPIRv. +// This type is defined here to simplify ANGLE's integration with glslang for SPIR-V. using ShCompileOptions = uint64_t; namespace sh { // GLenum alias @@ -31,10 +31,12 @@ INTERPOLATION_SAMPLE, INTERPOLATION_FLAT, INTERPOLATION_NOPERSPECTIVE }; +const char *InterpolationTypeToString(InterpolationType type); + // Validate link & SSO consistency of interpolation qualifiers bool InterpolationTypesMatch(InterpolationType a, InterpolationType b); // Uniform block layout qualifier, see section 4.3.8.3 of the ESSL 3.00.4 spec enum BlockLayoutType @@ -44,17 +46,21 @@ BLOCKLAYOUT_STD430, // Shader storage block layout qualifier BLOCKLAYOUT_PACKED, BLOCKLAYOUT_SHARED }; +const char *BlockLayoutTypeToString(BlockLayoutType type); + // Interface Blocks, see section 4.3.9 of the ESSL 3.10 spec enum class BlockType { BLOCK_UNIFORM, BLOCK_BUFFER, }; +const char *BlockTypeToString(BlockType type); + // Base class for all variables defined in shaders, including Varyings, Uniforms, etc // Note: we must override the copy constructor and assignment operator so we can // work around excessive GCC binary bloating: // See https://code.google.com/p/angleproject/issues/detail?id=697 struct ShaderVariable @@ -211,11 +217,11 @@ GLenum imageUnitFormat; int offset; bool readonly; bool writeonly; - // From EXT_shader_framebuffer_fetch + // From EXT_shader_framebuffer_fetch / KHR_blend_equation_advanced bool isFragmentInOut; // OutputVariable // From EXT_blend_func_extended. int index; diff --git a/gfx/angle/checkout/include/platform/Feature.h b/gfx/angle/checkout/include/platform/Feature.h --- a/gfx/angle/checkout/include/platform/Feature.h +++ b/gfx/angle/checkout/include/platform/Feature.h @@ -23,66 +23,72 @@ namespace angle { enum class FeatureCategory { + FrontendFeatures, FrontendWorkarounds, - FrontendFeatures, OpenGLWorkarounds, D3DWorkarounds, - D3DCompilerWorkarounds, + VulkanFeatures, VulkanWorkarounds, - VulkanFeatures, + VulkanAppWorkarounds, MetalFeatures, + MetalWorkarounds, }; -constexpr char kFeatureCategoryFrontendWorkarounds[] = "Frontend workarounds"; -constexpr char kFeatureCategoryFrontendFeatures[] = "Frontend features"; -constexpr char kFeatureCategoryOpenGLWorkarounds[] = "OpenGL workarounds"; -constexpr char kFeatureCategoryD3DWorkarounds[] = "D3D workarounds"; -constexpr char kFeatureCategoryD3DCompilerWorkarounds[] = "D3D compiler workarounds"; -constexpr char kFeatureCategoryVulkanWorkarounds[] = "Vulkan workarounds"; -constexpr char kFeatureCategoryVulkanFeatures[] = "Vulkan features"; -constexpr char kFeatureCategoryMetalFeatures[] = "Metal features"; -constexpr char kFeatureCategoryUnknown[] = "Unknown"; +constexpr char kFeatureCategoryFrontendWorkarounds[] = "Frontend workarounds"; +constexpr char kFeatureCategoryFrontendFeatures[] = "Frontend features"; +constexpr char kFeatureCategoryOpenGLWorkarounds[] = "OpenGL workarounds"; +constexpr char kFeatureCategoryD3DWorkarounds[] = "D3D workarounds"; +constexpr char kFeatureCategoryVulkanAppWorkarounds[] = "Vulkan app workarounds"; +constexpr char kFeatureCategoryVulkanWorkarounds[] = "Vulkan workarounds"; +constexpr char kFeatureCategoryVulkanFeatures[] = "Vulkan features"; +constexpr char kFeatureCategoryMetalFeatures[] = "Metal features"; +constexpr char kFeatureCategoryMetalWorkarounds[] = "Metal workarounds"; +constexpr char kFeatureCategoryUnknown[] = "Unknown"; inline const char *FeatureCategoryToString(const FeatureCategory &fc) { switch (fc) { + case FeatureCategory::FrontendFeatures: + return kFeatureCategoryFrontendFeatures; + break; + case FeatureCategory::FrontendWorkarounds: return kFeatureCategoryFrontendWorkarounds; break; - case FeatureCategory::FrontendFeatures: - return kFeatureCategoryFrontendFeatures; - break; - case FeatureCategory::OpenGLWorkarounds: return kFeatureCategoryOpenGLWorkarounds; break; case FeatureCategory::D3DWorkarounds: return kFeatureCategoryD3DWorkarounds; break; - case FeatureCategory::D3DCompilerWorkarounds: - return kFeatureCategoryD3DCompilerWorkarounds; + case FeatureCategory::VulkanFeatures: + return kFeatureCategoryVulkanFeatures; break; case FeatureCategory::VulkanWorkarounds: return kFeatureCategoryVulkanWorkarounds; break; - case FeatureCategory::VulkanFeatures: - return kFeatureCategoryVulkanFeatures; + case FeatureCategory::VulkanAppWorkarounds: + return kFeatureCategoryVulkanAppWorkarounds; break; case FeatureCategory::MetalFeatures: return kFeatureCategoryMetalFeatures; break; + case FeatureCategory::MetalWorkarounds: + return kFeatureCategoryMetalWorkarounds; + break; + default: return kFeatureCategoryUnknown; break; } } @@ -97,24 +103,24 @@ return kFeatureStatusEnabled; } return kFeatureStatusDisabled; } -struct Feature; +struct FeatureInfo; -using FeatureMap = std::map; -using FeatureList = std::vector; +using FeatureMap = std::map; +using FeatureList = std::vector; -struct Feature +struct FeatureInfo { - Feature(const Feature &other); - Feature(const char *name, - const FeatureCategory &category, - const char *description, - FeatureMap *const mapPtr, - const char *bug); - ~Feature(); + FeatureInfo(const FeatureInfo &other); + FeatureInfo(const char *name, + const FeatureCategory &category, + const char *description, + FeatureMap *const mapPtr, + const char *bug); + ~FeatureInfo(); // The name of the workaround, lowercase, camel_case const char *const name; // The category that the workaround belongs to. Eg. "Vulkan workarounds" @@ -132,16 +138,16 @@ // A stingified version of the condition used to set 'enabled'. ie "IsNvidia() && IsApple()" const char *condition; }; -inline Feature::Feature(const Feature &other) = default; -inline Feature::Feature(const char *name, - const FeatureCategory &category, - const char *description, - FeatureMap *const mapPtr, - const char *bug = "") +inline FeatureInfo::FeatureInfo(const FeatureInfo &other) = default; +inline FeatureInfo::FeatureInfo(const char *name, + const FeatureCategory &category, + const char *description, + FeatureMap *const mapPtr, + const char *bug = "") : name(name), category(category), description(description), bug(bug), enabled(false), @@ -151,11 +157,11 @@ { (*mapPtr)[std::string(name)] = this; } } -inline Feature::~Feature() = default; +inline FeatureInfo::~FeatureInfo() = default; struct FeatureSetBase { public: FeatureSetBase(); diff --git a/gfx/angle/checkout/include/platform/FeaturesD3D.h b/gfx/angle/checkout/include/platform/FeaturesD3D.h --- a/gfx/angle/checkout/include/platform/FeaturesD3D.h +++ b/gfx/angle/checkout/include/platform/FeaturesD3D.h @@ -1,7 +1,9 @@ +// GENERATED FILE - DO NOT EDIT. +// Generated by gen_features.py using data from d3d_features.json. // -// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2022 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. // // FeaturesD3D.h: Features and workarounds for D3D driver bugs and other issues. @@ -12,225 +14,159 @@ #include "platform/Feature.h" namespace angle { -// Workarounds attached to each shader. Do not need to expose information about these workarounds so -// a simple bool struct suffices. -struct CompilerWorkaroundsD3D -{ - bool skipOptimization = false; - - bool useMaxOptimization = false; - - // IEEE strictness needs to be enabled for NANs to work. - bool enableIEEEStrictness = false; -}; - struct FeaturesD3D : FeatureSetBase { FeaturesD3D(); ~FeaturesD3D(); - // On some systems, having extra rendertargets than necessary slows down the shader. - // We can fix this by optimizing those out of the shader. At the same time, we can - // work around a bug on some nVidia drivers that they ignore "null" render targets - // in D3D11, by compacting the active color attachments list to omit null entries. - Feature mrtPerfWorkaround = {"mrt_perf_workaround", FeatureCategory::D3DWorkarounds, - "Some drivers have a bug where they ignore null render targets", - &members}; + FeatureInfo mrtPerfWorkaround = { + "mrt_perf_workaround", + FeatureCategory::D3DWorkarounds, + "Some drivers have a bug where they ignore null render targets", + &members, + }; - Feature setDataFasterThanImageUpload = {"set_data_faster_than_image_upload", - FeatureCategory::D3DWorkarounds, - "Set data faster than image upload", &members}; - - Feature setDataFasterThanImageUploadOn128bitFormats = { - "set_data_faster_than_image_upload_on_128bit_formats", FeatureCategory::D3DWorkarounds, - "Set data faster than image upload on 128bit formats", &members}; + FeatureInfo setDataFasterThanImageUpload = { + "set_data_faster_than_image_upload", + FeatureCategory::D3DWorkarounds, + "Set data faster than image upload", + &members, + }; - // Some renderers can't disable mipmaps on a mipmapped texture (i.e. solely sample from level - // zero, and ignore the other levels). D3D11 Feature Level 10+ does this by setting MaxLOD to - // 0.0f in the Sampler state. D3D9 sets D3DSAMP_MIPFILTER to D3DTEXF_NONE. There is no - // equivalent to this in D3D11 Feature Level 9_3. This causes problems when (for example) an - // application creates a mipmapped texture2D, but sets GL_TEXTURE_MIN_FILTER to GL_NEAREST - // (i.e disables mipmaps). To work around this, D3D11 FL9_3 has to create two copies of the - // texture. The textures' level zeros are identical, but only one texture has mips. - Feature zeroMaxLodWorkaround = {"zero_max_lod", FeatureCategory::D3DWorkarounds, - "Missing an option to disable mipmaps on a mipmapped texture", - &members}; + FeatureInfo zeroMaxLodWorkaround = { + "zero_max_lod", + FeatureCategory::D3DWorkarounds, + "Missing an option to disable mipmaps on a mipmapped texture", + &members, + }; - // Some renderers do not support Geometry Shaders so the Geometry Shader-based PointSprite - // emulation will not work. To work around this, D3D11 FL9_3 has to use a different pointsprite - // emulation that is implemented using instanced quads. - Feature useInstancedPointSpriteEmulation = { - "use_instanced_point_sprite_emulation", FeatureCategory::D3DWorkarounds, - "Some D3D11 renderers do not support geometry shaders for pointsprite emulation", &members}; + FeatureInfo useInstancedPointSpriteEmulation = { + "use_instanced_point_sprite_emulation", + FeatureCategory::D3DWorkarounds, + "Some D3D11 renderers do not support geometry shaders for pointsprite emulation", + &members, + }; - // A bug fixed in NVIDIA driver version 347.88 < x <= 368.81 triggers a TDR when using - // CopySubresourceRegion from a staging texture to a depth/stencil in D3D11. The workaround - // is to use UpdateSubresource to trigger an extra copy. We disable this workaround on newer - // NVIDIA driver versions because of a second driver bug present with the workaround enabled. - // (See: http://anglebug.com/1452) - Feature depthStencilBlitExtraCopy = { + FeatureInfo depthStencilBlitExtraCopy = { "depth_stencil_blit_extra_copy", FeatureCategory::D3DWorkarounds, "Bug in some drivers triggers a TDR when using CopySubresourceRegion from a staging " "texture to a depth/stencil", &members, "http://anglebug.com/1452"}; - // The HLSL optimizer has a bug with optimizing "pow" in certain integer-valued expressions. - // We can work around this by expanding the pow into a series of multiplies if we're running - // under the affected compiler. - Feature expandIntegerPowExpressions = { - "expand_integer_pow_expressions", FeatureCategory::D3DWorkarounds, + FeatureInfo expandIntegerPowExpressions = { + "expand_integer_pow_expressions", + FeatureCategory::D3DWorkarounds, "The HLSL optimizer has a bug with optimizing 'pow' in certain integer-valued expressions", - &members}; + &members, + }; - // NVIDIA drivers sometimes write out-of-order results to StreamOut buffers when transform - // feedback is used to repeatedly write to the same buffer positions. - Feature flushAfterEndingTransformFeedback = { - "flush_after_ending_transform_feedback", FeatureCategory::D3DWorkarounds, + FeatureInfo flushAfterEndingTransformFeedback = { + "flush_after_ending_transform_feedback", + FeatureCategory::D3DWorkarounds, "Some drivers sometimes write out-of-order results to StreamOut buffers when transform " "feedback is used to repeatedly write to the same buffer positions", - &members}; + &members, + }; - // Some drivers (NVIDIA) do not take into account the base level of the texture in the results - // of the HLSL GetDimensions builtin. - Feature getDimensionsIgnoresBaseLevel = { - "get_dimensions_ignores_base_level", FeatureCategory::D3DWorkarounds, + FeatureInfo getDimensionsIgnoresBaseLevel = { + "get_dimensions_ignores_base_level", + FeatureCategory::D3DWorkarounds, "Some drivers do not take into account the base level of the " "texture in the results of the HLSL GetDimensions builtin", - &members}; + &members, + }; - // On some Intel drivers, HLSL's function texture.Load returns 0 when the parameter Location - // is negative, even if the sum of Offset and Location is in range. This may cause errors when - // translating GLSL's function texelFetchOffset into texture.Load, as it is valid for - // texelFetchOffset to use negative texture coordinates as its parameter P when the sum of P - // and Offset is in range. To work around this, we translate texelFetchOffset into texelFetch - // by adding Offset directly to Location before reading the texture. - Feature preAddTexelFetchOffsets = { - "pre_add_texel_fetch_offsets", FeatureCategory::D3DWorkarounds, + FeatureInfo preAddTexelFetchOffsets = { + "pre_add_texel_fetch_offsets", + FeatureCategory::D3DWorkarounds, "HLSL's function texture.Load returns 0 when the parameter Location is negative, even if " "the sum of Offset and Location is in range", - &members}; - - // On some AMD drivers, 1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly. - // We can work around this bug by doing an internal blit to a temporary single-channel texture - // before we sample. - Feature emulateTinyStencilTextures = { - "emulate_tiny_stencil_textures", FeatureCategory::D3DWorkarounds, - "1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly", &members}; + &members, + }; - // In Intel driver, the data with format DXGI_FORMAT_B5G6R5_UNORM will be parsed incorrectly. - // This workaroud will disable B5G6R5 support when it's Intel driver. By default, it will use - // R8G8B8A8 format. This bug is fixed in version 4539 on Intel drivers. - // On older AMD drivers, the data in DXGI_FORMAT_B5G6R5_UNORM becomes corrupted for unknown - // reasons. - Feature disableB5G6R5Support = {"disable_b5g6r5_support", FeatureCategory::D3DWorkarounds, - "Textures with the format " - "DXGI_FORMAT_B5G6R5_UNORM have incorrect data", - &members}; + FeatureInfo emulateTinyStencilTextures = { + "emulate_tiny_stencil_textures", + FeatureCategory::D3DWorkarounds, + "1x1 and 2x2 mips of depth/stencil textures aren't sampled correctly", + &members, + }; - // On some Intel drivers, evaluating unary minus operator on integer may get wrong answer in - // vertex shaders. To work around this bug, we translate -(int) into ~(int)+1. - // This driver bug is fixed in 20.19.15.4624. - Feature rewriteUnaryMinusOperator = { - "rewrite_unary_minus_operator", FeatureCategory::D3DWorkarounds, - "Evaluating unary minus operator on integer may get wrong answer in vertex shaders", - &members}; + FeatureInfo disableB5G6R5Support = { + "disable_b5g6r5_support", + FeatureCategory::D3DWorkarounds, + "Textures with the format " + "DXGI_FORMAT_B5G6R5_UNORM have incorrect data", + &members, + }; - // On some Intel drivers, using isnan() on highp float will get wrong answer. To work around - // this bug, we use an expression to emulate function isnan(). - // Tracking bug: https://crbug.com/650547 - // This driver bug is fixed in 21.20.16.4542. - Feature emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::D3DWorkarounds, - "Using isnan() on highp float will get wrong answer", &members, - "https://crbug.com/650547"}; + FeatureInfo rewriteUnaryMinusOperator = { + "rewrite_unary_minus_operator", + FeatureCategory::D3DWorkarounds, + "Evaluating unary minus operator on integer may get wrong answer in vertex shaders", + &members, + }; - // On some Intel drivers, using clear() may not take effect. To work around this bug, we call - // clear() twice on these platforms. - // Tracking bug: https://crbug.com/655534 - Feature callClearTwice = {"call_clear_twice", FeatureCategory::D3DWorkarounds, - "Using clear() may not take effect", &members, - "https://crbug.com/655534"}; + FeatureInfo emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::D3DWorkarounds, + "Using isnan() on highp float will get wrong answer", &members, + "https://crbug.com/650547"}; - // On Sandybridge, calling ClearView after using dual source blending causes the hardware to - // hang. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1633628 - Feature emulateClearViewAfterDualSourceBlending = { - "emulate_clear_view_after_dual_source_blending", FeatureCategory::D3DWorkarounds, - "On Sandybridge, calling ClearView after using dual source blending causes " - "the hardware to hang", - &members, "https://bugzilla.mozilla.org/show_bug.cgi?id=1633628"}; + FeatureInfo callClearTwice = {"call_clear_twice", FeatureCategory::D3DWorkarounds, + "Using clear() may not take effect", &members, + "https://crbug.com/655534"}; - // On some Intel drivers, copying from staging storage to constant buffer storage does not - // seem to work. Work around this by keeping system memory storage as a canonical reference - // for buffer data. - // D3D11-only workaround. See http://crbug.com/593024. - Feature useSystemMemoryForConstantBuffers = {"use_system_memory_for_constant_buffers", - FeatureCategory::D3DWorkarounds, - "Copying from staging storage to constant buffer " - "storage does not work", - &members, "https://crbug.com/593024"}; + FeatureInfo useSystemMemoryForConstantBuffers = { + "use_system_memory_for_constant_buffers", FeatureCategory::D3DWorkarounds, + "Copying from staging storage to constant buffer " + "storage does not work", + &members, "https://crbug.com/593024"}; - // This workaround is for the ANGLE_multiview extension. If enabled the viewport or render - // target slice will be selected in the geometry shader stage. The workaround flag is added to - // make it possible to select the code path in end2end and performance tests. - Feature selectViewInGeometryShader = { - "select_view_in_geometry_shader", FeatureCategory::D3DWorkarounds, + FeatureInfo selectViewInGeometryShader = { + "select_view_in_geometry_shader", + FeatureCategory::D3DWorkarounds, "The viewport or render target slice will be selected in the geometry shader stage for " "the ANGLE_multiview extension", - &members}; + &members, + }; - // When rendering with no render target on D3D, two bugs lead to incorrect behavior on Intel - // drivers < 4815. The rendering samples always pass neglecting discard statements in pixel - // shader. - // 1. If rendertarget is not set, the pixel shader will be recompiled to drop 'SV_TARGET'. - // When using a pixel shader with no 'SV_TARGET' in a draw, the pixels are always generated even - // if they should be discard by 'discard' statements. - // 2. If ID3D11BlendState.RenderTarget[].RenderTargetWriteMask is 0 and rendertarget is not set, - // then rendering samples also pass neglecting discard statements in pixel shader. - // So we add a mock texture as render target in such case. See http://anglebug.com/2152 - Feature addMockTextureNoRenderTarget = { + FeatureInfo addMockTextureNoRenderTarget = { "add_mock_texture_no_render_target", FeatureCategory::D3DWorkarounds, "On some drivers when rendering with no render target, two bugs lead to incorrect behavior", &members, "http://anglebug.com/2152"}; - // Don't use D3D constant register zero when allocating space for uniforms in the vertex shader. - // This is targeted to work around a bug in NVIDIA D3D driver version 388.59 where in very - // specific cases the driver would not handle constant register zero correctly. - Feature skipVSConstantRegisterZero = { - "skip_vs_constant_register_zero", FeatureCategory::D3DWorkarounds, - "In specific cases the driver doesn't handle constant register zero correctly", &members}; + FeatureInfo skipVSConstantRegisterZero = { + "skip_vs_constant_register_zero", + FeatureCategory::D3DWorkarounds, + "In specific cases the driver doesn't handle constant register zero correctly", + &members, + }; - // Forces the value returned from an atomic operations to be always be resolved. This is - // targeted to workaround a bug in NVIDIA D3D driver where the return value from - // RWByteAddressBuffer.InterlockedAdd does not get resolved when used in the .yzw components of - // a RWByteAddressBuffer.Store operation. Only has an effect on HLSL translation. - // http://anglebug.com/3246 - Feature forceAtomicValueResolution = { + FeatureInfo forceAtomicValueResolution = { "force_atomic_value_resolution", FeatureCategory::D3DWorkarounds, "On some drivers the return value from RWByteAddressBuffer.InterlockedAdd does not resolve " "when used in the .yzw components of a RWByteAddressBuffer.Store operation", &members, "http://anglebug.com/3246"}; - // Match chromium's robust resource init behaviour by always prefering to upload texture data - // instead of clearing. Clear calls have been observed to cause texture corruption for some - // formats. - Feature allowClearForRobustResourceInit = { + FeatureInfo allowClearForRobustResourceInit = { "allow_clear_for_robust_resource_init", FeatureCategory::D3DWorkarounds, "Some drivers corrupt texture data when clearing for robust resource initialization.", &members, "http://crbug.com/941620"}; - // Allow translating uniform block to StructuredBuffer. This is targeted to work around a slow - // fxc compile performance issue with dynamic uniform indexing. http://anglebug.com/3682 - Feature allowTranslateUniformBlockToStructuredBuffer = { + FeatureInfo allowTranslateUniformBlockToStructuredBuffer = { "allow_translate_uniform_block_to_structured_buffer", FeatureCategory::D3DWorkarounds, "There is a slow fxc compile performance issue with dynamic uniform indexing if " "translating a uniform block with a large array member to cbuffer.", &members, "http://anglebug.com/3682"}; - Feature allowES3OnFL10_0 = {"allowES3OnFL10_0", FeatureCategory::D3DWorkarounds, - "Allow ES3 on 10.0 devices", &members}; + FeatureInfo allowES3OnFL10_0 = { + "allowES3OnFL10_0", + FeatureCategory::D3DWorkarounds, + "Allow ES3 on 10.0 devices", + &members, + }; }; inline FeaturesD3D::FeaturesD3D() = default; inline FeaturesD3D::~FeaturesD3D() = default; diff --git a/gfx/angle/checkout/include/platform/FeaturesGL.h b/gfx/angle/checkout/include/platform/FeaturesGL.h --- a/gfx/angle/checkout/include/platform/FeaturesGL.h +++ b/gfx/angle/checkout/include/platform/FeaturesGL.h @@ -1,12 +1,13 @@ +// GENERATED FILE - DO NOT EDIT. +// Generated by gen_features.py using data from gl_features.json. // -// Copyright 2015 The ANGLE Project Authors. All rights reserved. +// Copyright 2022 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. // - -// FeaturesGL.h: Features and workarounds for GL driver bugs and other issues. +// FeaturesGL.h: angle::Features and workarounds for GL driver bugs and other issues. #ifndef ANGLE_PLATFORM_FEATURESGL_H_ #define ANGLE_PLATFORM_FEATURESGL_H_ #include "platform/Feature.h" @@ -17,546 +18,433 @@ struct FeaturesGL : FeatureSetBase { FeaturesGL(); ~FeaturesGL(); - // When writing a float to a normalized integer framebuffer, desktop OpenGL is allowed to write - // one of the two closest normalized integer representations (although round to nearest is - // preferred) (see section 2.3.5.2 of the GL 4.5 core specification). OpenGL ES requires that - // round-to-nearest is used (see "Conversion from Floating-Point to Framebuffer Fixed-Point" in - // section 2.1.2 of the OpenGL ES 2.0.25 spec). This issue only shows up on AMD drivers on - // framebuffer formats that have 1-bit alpha, work around this by using higher precision formats - // instead. - Feature avoid1BitAlphaTextureFormats = {"avoid_1_bit_alpha_texture_formats", - FeatureCategory::OpenGLWorkarounds, - "Issue with 1-bit alpha framebuffer formats", &members}; + FeatureInfo avoid1BitAlphaTextureFormats = { + "avoid_1_bit_alpha_texture_formats", + FeatureCategory::OpenGLWorkarounds, + "Issue with 1-bit alpha framebuffer formats", + &members, + }; - // On some older Intel drivers, GL_RGBA4 is not color renderable, glCheckFramebufferStatus - // returns GL_FRAMEBUFFER_UNSUPPORTED. Work around this by using a known color-renderable - // format. - Feature rgba4IsNotSupportedForColorRendering = {"rgba4_is_not_supported_for_color_rendering", - FeatureCategory::OpenGLWorkarounds, - "GL_RGBA4 is not color renderable", &members}; + FeatureInfo rgba4IsNotSupportedForColorRendering = { + "rgba4_is_not_supported_for_color_rendering", + FeatureCategory::OpenGLWorkarounds, + "GL_RGBA4 is not color renderable", + &members, + }; - // Newer Intel GPUs natively support ETC2/EAC compressed texture formats. - Feature allowEtcFormats = {"allow_etc_formats", FeatureCategory::OpenGLWorkarounds, - "Enable ETC2/EAC on desktop OpenGL", &members}; + FeatureInfo allowEtcFormats = { + "allow_etc_formats", + FeatureCategory::OpenGLWorkarounds, + "Enable ETC2/EAC on desktop OpenGL", + &members, + }; - // When clearing a framebuffer on Intel or AMD drivers, when GL_FRAMEBUFFER_SRGB is enabled, the - // driver clears to the linearized clear color despite the framebuffer not supporting SRGB - // blending. It only seems to do this when the framebuffer has only linear attachments, mixed - // attachments appear to get the correct clear color. - Feature doesSRGBClearsOnLinearFramebufferAttachments = { - "does_srgb_clears_on_linear_framebuffer_attachments", FeatureCategory::OpenGLWorkarounds, + FeatureInfo doesSRGBClearsOnLinearFramebufferAttachments = { + "does_srgb_clears_on_linear_framebuffer_attachments", + FeatureCategory::OpenGLWorkarounds, "Issue clearing framebuffers with linear attachments when GL_FRAMEBUFFER_SRGB is enabled", - &members}; + &members, + }; - // On Mac some GLSL constructs involving do-while loops cause GPU hangs, such as the following: - // int i = 1; - // do { - // i --; - // continue; - // } while (i > 0) - // Work around this by rewriting the do-while to use another GLSL construct (block + while) - Feature doWhileGLSLCausesGPUHang = { + FeatureInfo doWhileGLSLCausesGPUHang = { "do_while_glsl_causes_gpu_hang", FeatureCategory::OpenGLWorkarounds, "Some GLSL constructs involving do-while loops cause GPU hangs", &members, "http://crbug.com/644669"}; - // On Mac AMD GPU gl_VertexID in GLSL vertex shader doesn't include base vertex value, - // Work aronud this by replace gl_VertexID with (gl_VertexID - angle_BaseVertex) when - // angle_BaseVertex is present. - Feature addBaseVertexToVertexID = { - "vertex_id_does_not_include_base_vertex", FeatureCategory::OpenGLWorkarounds, - "gl_VertexID in GLSL vertex shader doesn't include base vertex value", &members}; + FeatureInfo addBaseVertexToVertexID = { + "vertex_id_does_not_include_base_vertex", + FeatureCategory::OpenGLWorkarounds, + "gl_VertexID in GLSL vertex shader doesn't include base vertex value", + &members, + }; - // Calling glFinish doesn't cause all queries to report that the result is available on some - // (NVIDIA) drivers. It was found that enabling GL_DEBUG_OUTPUT_SYNCHRONOUS before the finish - // causes it to fully finish. - Feature finishDoesNotCauseQueriesToBeAvailable = { - "finish_does_not_cause_queries_to_be_available", FeatureCategory::OpenGLWorkarounds, - "glFinish doesn't cause all queries to report available result", &members}; + FeatureInfo finishDoesNotCauseQueriesToBeAvailable = { + "finish_does_not_cause_queries_to_be_available", + FeatureCategory::OpenGLWorkarounds, + "glFinish doesn't cause all queries to report available result", + &members, + }; - // Always call useProgram after a successful link to avoid a driver bug. - // This workaround is meant to reproduce the use_current_program_after_successful_link - // workaround in Chromium (http://crbug.com/110263). It has been shown that this workaround is - // not necessary for MacOSX 10.9 and higher (http://crrev.com/39eb535b). - Feature alwaysCallUseProgramAfterLink = { + FeatureInfo alwaysCallUseProgramAfterLink = { "always_call_use_program_after_link", FeatureCategory::OpenGLWorkarounds, "Always call useProgram after a successful link to avoid a driver bug", &members, "http://crbug.com/110263"}; - // On NVIDIA, in the case of unpacking from a pixel unpack buffer, unpack overlapping rows row - // by row. - Feature unpackOverlappingRowsSeparatelyUnpackBuffer = { - "unpack_overlapping_rows_separately_unpack_buffer", FeatureCategory::OpenGLWorkarounds, + FeatureInfo unpackOverlappingRowsSeparatelyUnpackBuffer = { + "unpack_overlapping_rows_separately_unpack_buffer", + FeatureCategory::OpenGLWorkarounds, "In the case of unpacking from a pixel unpack buffer, unpack overlapping rows row by row", - &members}; + &members, + }; - // On NVIDIA, in the case of packing to a pixel pack buffer, pack overlapping rows row by row. - Feature packOverlappingRowsSeparatelyPackBuffer = { - "pack_overlapping_rows_separately_pack_buffer", FeatureCategory::OpenGLWorkarounds, + FeatureInfo packOverlappingRowsSeparatelyPackBuffer = { + "pack_overlapping_rows_separately_pack_buffer", + FeatureCategory::OpenGLWorkarounds, "In the case of packing to a pixel pack buffer, pack overlapping rows row by row", - &members}; - - // On NVIDIA, during initialization, assign the current vertex attributes to the spec-mandated - // defaults. - Feature initializeCurrentVertexAttributes = { - "initialize_current_vertex_attributes", FeatureCategory::OpenGLWorkarounds, - "During initialization, assign the current vertex attributes to the spec-mandated defaults", - &members}; + &members, + }; - // abs(i) where i is an integer returns unexpected result on Intel Mac. - // Emulate abs(i) with i * sign(i). - Feature emulateAbsIntFunction = {"emulate_abs_int_function", FeatureCategory::OpenGLWorkarounds, - "abs(i) where i is an integer returns unexpected result", - &members, "http://crbug.com/642227"}; - - // On Intel Mac, calculation of loop conditions in for and while loop has bug. - // Add "&& true" to the end of the condition expression to work around the bug. - Feature addAndTrueToLoopCondition = { - "add_and_true_to_loop_condition", FeatureCategory::OpenGLWorkarounds, - "Calculation of loop conditions in for and while loop has bug", &members}; + FeatureInfo initializeCurrentVertexAttributes = { + "initialize_current_vertex_attributes", + FeatureCategory::OpenGLWorkarounds, + "During initialization, assign the current vertex attributes to the spec-mandated defaults", + &members, + }; - // When uploading textures from an unpack buffer, some drivers count an extra row padding when - // checking if the pixel unpack buffer is big enough. Tracking bug: http://anglebug.com/1512 - // For example considering the pixel buffer below where in memory, each row data (D) of the - // texture is followed by some unused data (the dots): - // +-------+--+ - // |DDDDDDD|..| - // |DDDDDDD|..| - // |DDDDDDD|..| - // |DDDDDDD|..| - // +-------A--B - // The last pixel read will be A, but the driver will think it is B, causing it to generate an - // error when the pixel buffer is just big enough. - Feature unpackLastRowSeparatelyForPaddingInclusion = { + FeatureInfo emulateAbsIntFunction = {"emulate_abs_int_function", + FeatureCategory::OpenGLWorkarounds, + "abs(i) where i is an integer returns unexpected result", + &members, "http://crbug.com/642227"}; + + FeatureInfo addAndTrueToLoopCondition = { + "add_and_true_to_loop_condition", + FeatureCategory::OpenGLWorkarounds, + "Calculation of loop conditions in for and while loop has bug", + &members, + }; + + FeatureInfo unpackLastRowSeparatelyForPaddingInclusion = { "unpack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds, "When uploading textures from an unpack buffer, some drivers count an extra row padding", &members, "http://anglebug.com/1512"}; - // Equivalent workaround when uploading data from a pixel pack buffer. - Feature packLastRowSeparatelyForPaddingInclusion = { + FeatureInfo packLastRowSeparatelyForPaddingInclusion = { "pack_last_row_separately_for_padding_inclusion", FeatureCategory::OpenGLWorkarounds, "When uploading textures from an pack buffer, some drivers count an extra row padding", &members, "http://anglebug.com/1512"}; - // On some Intel drivers, using isnan() on highp float will get wrong answer. To work around - // this bug, we use an expression to emulate function isnan(). - // Tracking bug: http://crbug.com/650547 - Feature emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::OpenGLWorkarounds, - "Using isnan() on highp float will get wrong answer", &members, - "http://crbug.com/650547"}; + FeatureInfo emulateIsnanFloat = {"emulate_isnan_float", FeatureCategory::OpenGLWorkarounds, + "Using isnan() on highp float will get wrong answer", &members, + "http://crbug.com/650547"}; - // On Mac with OpenGL version 4.1, unused std140 or shared uniform blocks will be - // treated as inactive which is not consistent with WebGL2.0 spec. Reference all members in a - // unused std140 or shared uniform block at the beginning of main to work around it. - // Also used on Linux AMD. - Feature useUnusedBlocksWithStandardOrSharedLayout = { - "use_unused_blocks_with_standard_or_shared_layout", FeatureCategory::OpenGLWorkarounds, - "Unused std140 or shared uniform blocks will be treated as inactive", &members}; + FeatureInfo useUnusedBlocksWithStandardOrSharedLayout = { + "use_unused_blocks_with_standard_or_shared_layout", + FeatureCategory::OpenGLWorkarounds, + "Unused std140 or shared uniform blocks will be treated as inactive", + &members, + }; - // This flag is used to fix spec difference between GLSL 4.1 or lower and ESSL3. - Feature removeInvariantAndCentroidForESSL3 = { - "remove_invarient_and_centroid_for_essl3", FeatureCategory::OpenGLWorkarounds, - "Fix spec difference between GLSL 4.1 or lower and ESSL3", &members}; + FeatureInfo removeInvariantAndCentroidForESSL3 = { + "remove_invarient_and_centroid_for_essl3", + FeatureCategory::OpenGLWorkarounds, + "Fix spec difference between GLSL 4.1 or lower and ESSL3", + &members, + }; - // On Intel Mac OSX 10.11 driver, using "-float" will get wrong answer. Use "0.0 - float" to - // replace "-float". - // Tracking bug: http://crbug.com/308366 - Feature rewriteFloatUnaryMinusOperator = { + FeatureInfo rewriteFloatUnaryMinusOperator = { "rewrite_float_unary_minus_operator", FeatureCategory::OpenGLWorkarounds, "Using '-' will get wrong answer", &members, "http://crbug.com/308366"}; - // On NVIDIA drivers, atan(y, x) may return a wrong answer. - // Tracking bug: http://crbug.com/672380 - Feature emulateAtan2Float = {"emulate_atan_2_float", FeatureCategory::OpenGLWorkarounds, - "atan(y, x) may return a wrong answer", &members, - "http://crbug.com/672380"}; + FeatureInfo emulateAtan2Float = {"emulate_atan_2_float", FeatureCategory::OpenGLWorkarounds, + "atan(y, x) may return a wrong answer", &members, + "http://crbug.com/672380"}; - // Some drivers seem to forget about UBO bindings when using program binaries. Work around - // this by re-applying the bindings after the program binary is loaded or saved. - // This only seems to affect AMD OpenGL drivers, and some Android devices. - // http://anglebug.com/1637 - Feature reapplyUBOBindingsAfterUsingBinaryProgram = { + FeatureInfo reapplyUBOBindingsAfterUsingBinaryProgram = { "reapply_ubo_bindings_after_using_binary_program", FeatureCategory::OpenGLWorkarounds, "Some drivers forget about UBO bindings when using program binaries", &members, "http://anglebug.com/1637"}; - // Some Linux OpenGL drivers return 0 when we query MAX_VERTEX_ATTRIB_STRIDE in an OpenGL 4.4 or - // higher context. - // This only seems to affect AMD OpenGL drivers. - // Tracking bug: http://anglebug.com/1936 - Feature emulateMaxVertexAttribStride = { + FeatureInfo emulateMaxVertexAttribStride = { "emulate_max_vertex_attrib_stride", FeatureCategory::OpenGLWorkarounds, "Some drivers return 0 when MAX_VERTEX_ATTRIB_STRIED queried", &members, "http://anglebug.com/1936"}; - // Initializing uninitialized locals caused odd behavior on Android Qualcomm in a few WebGL 2 - // tests. Tracking bug: http://anglebug.com/2046 - Feature dontInitializeUninitializedLocals = { + FeatureInfo dontInitializeUninitializedLocals = { "dont_initialize_uninitialized_locals", FeatureCategory::OpenGLWorkarounds, "Initializing uninitialized locals caused odd behavior in a few WebGL 2 tests", &members, "http://anglebug.com/2046"}; - // On some NVIDIA drivers the point size range reported from the API is inconsistent with the - // actual behavior. Clamp the point size to the value from the API to fix this. - Feature clampPointSize = { - "clamp_point_size", FeatureCategory::OpenGLWorkarounds, + FeatureInfo clampPointSize = { + "clamp_point_size", + FeatureCategory::OpenGLWorkarounds, "The point size range reported from the API is inconsistent with the actual behavior", - &members}; + &members, + }; - // On some NVIDIA drivers certain types of GLSL arithmetic ops mixing vectors and scalars may be - // executed incorrectly. Change them in the shader translator. Tracking bug: - // http://crbug.com/772651 - Feature rewriteVectorScalarArithmetic = {"rewrite_vector_scalar_arithmetic", - FeatureCategory::OpenGLWorkarounds, - "Certain types of GLSL arithmetic ops mixing vectors " - "and scalars may be executed incorrectly", - &members, "http://crbug.com/772651"}; - - // On some Android devices for loops used to initialize variables hit native GLSL compiler bugs. - Feature dontUseLoopsToInitializeVariables = { + FeatureInfo dontUseLoopsToInitializeVariables = { "dont_use_loops_to_initialize_variables", FeatureCategory::OpenGLWorkarounds, "For loops used to initialize variables hit native GLSL compiler bugs", &members, "http://crbug.com/809422"}; - // On some NVIDIA drivers gl_FragDepth is not clamped correctly when rendering to a floating - // point depth buffer. Clamp it in the translated shader to fix this. - Feature clampFragDepth = { - "clamp_frag_depth", FeatureCategory::OpenGLWorkarounds, + FeatureInfo clampFragDepth = { + "clamp_frag_depth", + FeatureCategory::OpenGLWorkarounds, "gl_FragDepth is not clamped correctly when rendering to a floating point depth buffer", - &members}; + &members, + }; - // On some NVIDIA drivers before version 397.31 repeated assignment to swizzled values inside a - // GLSL user-defined function have incorrect results. Rewrite this type of statements to fix - // this. - Feature rewriteRepeatedAssignToSwizzled = {"rewrite_repeated_assign_to_swizzled", - FeatureCategory::OpenGLWorkarounds, - "Repeated assignment to swizzled values inside a " - "GLSL user-defined function have incorrect results", - &members}; + FeatureInfo rewriteRepeatedAssignToSwizzled = { + "rewrite_repeated_assign_to_swizzled", + FeatureCategory::OpenGLWorkarounds, + "Repeated assignment to swizzled values inside a " + "GLSL user-defined function have incorrect results", + &members, + }; - // On some AMD and Intel GL drivers ARB_blend_func_extended does not pass the tests. - // It might be possible to work around the Intel bug by rewriting *FragData to *FragColor - // instead of disabling the functionality entirely. The AMD bug looked like incorrect blending, - // not sure if a workaround is feasible. http://anglebug.com/1085 - Feature disableBlendFuncExtended = { + FeatureInfo disableBlendFuncExtended = { "disable_blend_func_extended", FeatureCategory::OpenGLWorkarounds, "ARB_blend_func_extended does not pass the tests", &members, "http://anglebug.com/1085"}; - // Qualcomm drivers returns raw sRGB values instead of linearized values when calling - // glReadPixels on unsized sRGB texture formats. http://crbug.com/550292 and - // http://crbug.com/565179 - Feature unsizedsRGBReadPixelsDoesntTransform = { + FeatureInfo unsizedsRGBReadPixelsDoesntTransform = { "unsized_srgb_read_pixels_doesnt_transform", FeatureCategory::OpenGLWorkarounds, "Drivers returning raw sRGB values instead of linearized values when calling glReadPixels " "on unsized sRGB texture formats", - &members, "http://crbug.com/565179"}; + &members, "http://crbug.com/550292 http://crbug.com/565179"}; - // Older Qualcomm drivers generate errors when querying the number of bits in timer queries, ex: - // GetQueryivEXT(GL_TIME_ELAPSED, GL_QUERY_COUNTER_BITS). http://anglebug.com/3027 - Feature queryCounterBitsGeneratesErrors = { + FeatureInfo queryCounterBitsGeneratesErrors = { "query_counter_bits_generates_errors", FeatureCategory::OpenGLWorkarounds, "Drivers generate errors when querying the number of bits in timer queries", &members, "http://anglebug.com/3027"}; - // Re-linking a program in parallel is buggy on some Intel Windows OpenGL drivers and Android - // platforms. - // http://anglebug.com/3045 - Feature dontRelinkProgramsInParallel = { + FeatureInfo dontRelinkProgramsInParallel = { "dont_relink_programs_in_parallel", FeatureCategory::OpenGLWorkarounds, "Relinking a program in parallel is buggy", &members, "http://anglebug.com/3045"}; - // Some tests have been seen to fail using worker contexts, this switch allows worker contexts - // to be disabled for some platforms. http://crbug.com/849576 - Feature disableWorkerContexts = {"disable_worker_contexts", FeatureCategory::OpenGLWorkarounds, - "Some tests have been seen to fail using worker contexts", - &members, "http://crbug.com/849576"}; + FeatureInfo disableWorkerContexts = {"disable_worker_contexts", + FeatureCategory::OpenGLWorkarounds, + "Some tests have been seen to fail using worker contexts", + &members, "http://crbug.com/849576"}; - // Most Android devices fail to allocate a texture that is larger than 4096. Limit the caps - // instead of generating GL_OUT_OF_MEMORY errors. Also causes system to hang on some older - // intel mesa drivers on Linux. - Feature limitMaxTextureSizeTo4096 = {"max_texture_size_limit_4096", - FeatureCategory::OpenGLWorkarounds, - "Limit max texture size to 4096 to avoid frequent " - "out-of-memory errors", - &members, "http://crbug.com/927470"}; + FeatureInfo limitMaxTextureSizeTo4096 = {"max_texture_size_limit_4096", + FeatureCategory::OpenGLWorkarounds, + "Limit max texture size to 4096 to avoid frequent " + "out-of-memory errors", + &members, "http://crbug.com/927470"}; - // Prevent excessive MSAA allocations on Android devices, various rendering bugs have been - // observed and they tend to be high DPI anyways. http://crbug.com/797243 - Feature limitMaxMSAASamplesTo4 = { + FeatureInfo limitMaxMSAASamplesTo4 = { "max_msaa_sample_count_4", FeatureCategory::OpenGLWorkarounds, "Various rendering bugs have been observed when using higher MSAA counts", &members, "http://crbug.com/797243"}; - // Prefer to do the robust resource init clear using a glClear. Calls to TexSubImage2D on large - // textures can take hundreds of milliseconds because of slow uploads on macOS. Do this only on - // macOS because clears are buggy on other drivers. - // https://crbug.com/848952 (slow uploads on macOS) - // https://crbug.com/883276 (buggy clears on Android) - Feature allowClearForRobustResourceInit = { + FeatureInfo allowClearForRobustResourceInit = { "allow_clear_for_robust_resource_init", FeatureCategory::OpenGLWorkarounds, "Using glClear for robust resource initialization is buggy on some drivers and leads to " "texture corruption. Default to data uploads except on MacOS where it is very slow.", - &members, "http://crbug.com/883276"}; + &members, "https://crbug.com/848952 http://crbug.com/883276"}; - // Some drivers automatically handle out-of-bounds uniform array access but others need manual - // clamping to satisfy the WebGL requirements. - Feature clampArrayAccess = {"clamp_array_access", FeatureCategory::OpenGLWorkarounds, - "Clamp uniform array access to avoid reading invalid memory.", - &members, "http://anglebug.com/2978"}; + FeatureInfo clampArrayAccess = {"clamp_array_access", FeatureCategory::OpenGLWorkarounds, + "Clamp uniform array access to avoid reading invalid memory.", + &members, "http://anglebug.com/2978"}; - // Reset glTexImage2D base level to workaround pixel comparison failure above Mac OS 10.12.4 on - // Intel Mac. - Feature resetTexImage2DBaseLevel = {"reset_teximage2d_base_level", - FeatureCategory::OpenGLWorkarounds, - "Reset texture base level before calling glTexImage2D to " - "work around pixel comparison failure.", - &members, "https://crbug.com/705865"}; + FeatureInfo resetTexImage2DBaseLevel = { + "reset_teximage2d_base_level", FeatureCategory::OpenGLWorkarounds, + "Reset texture base level before calling glTexImage2D to " + "work around pixel comparison failure.", + &members, "https://crbug.com/705865"}; - // glClearColor does not always work on Intel 6xxx Mac drivers when the clear color made up of - // all zeros and ones. - Feature clearToZeroOrOneBroken = { + FeatureInfo clearToZeroOrOneBroken = { "clear_to_zero_or_one_broken", FeatureCategory::OpenGLWorkarounds, "Clears when the clear color is all zeros or ones do not work.", &members, "https://crbug.com/710443"}; - // Some older Linux Intel mesa drivers will hang the system when allocating large textures. Fix - // this by capping the max texture size. - Feature limitMax3dArrayTextureSizeTo1024 = { + FeatureInfo limitMax3dArrayTextureSizeTo1024 = { "max_3d_array_texture_size_1024", FeatureCategory::OpenGLWorkarounds, "Limit max 3d texture size and max array texture layers to 1024 to avoid system hang", &members, "http://crbug.com/927470"}; - // BlitFramebuffer has issues on some platforms with large source/dest texture sizes. This - // workaround adjusts the destination rectangle source and dest rectangle to fit within maximum - // twice the size of the framebuffer. - Feature adjustSrcDstRegionBlitFramebuffer = { + FeatureInfo adjustSrcDstRegionBlitFramebuffer = { "adjust_src_dst_region_for_blitframebuffer", FeatureCategory::OpenGLWorkarounds, "Many platforms have issues with blitFramebuffer when the parameters are large.", &members, "http://crbug.com/830046"}; - // BlitFramebuffer has issues on Mac when the source bounds aren't enclosed by the framebuffer. - // This workaround clips the source region and adjust the dest region proportionally. - Feature clipSrcRegionBlitFramebuffer = { + FeatureInfo clipSrcRegionBlitFramebuffer = { "clip_src_region_for_blitframebuffer", FeatureCategory::OpenGLWorkarounds, "Issues with blitFramebuffer when the parameters don't match the framebuffer size.", &members, "http://crbug.com/830046"}; - // Calling glTexImage2D with zero size generates GL errors - Feature resettingTexturesGeneratesErrors = { - "reset_texture_generates_errors", FeatureCategory::OpenGLWorkarounds, - "Calling glTexImage2D with zero size generates errors.", &members, - "http://anglebug.com/3859"}; - - // Mac Intel samples transparent black from GL_COMPRESSED_RGB_S3TC_DXT1_EXT - Feature rgbDXT1TexturesSampleZeroAlpha = { + FeatureInfo rgbDXT1TexturesSampleZeroAlpha = { "rgb_dxt1_textures_sample_zero_alpha", FeatureCategory::OpenGLWorkarounds, "Sampling BLACK texels from RGB DXT1 textures returns transparent black on Mac.", &members, "http://anglebug.com/3729"}; - // Mac incorrectly executes both sides of && and || expressions when they should short-circuit. - Feature unfoldShortCircuits = { + FeatureInfo unfoldShortCircuits = { "unfold_short_circuits", FeatureCategory::OpenGLWorkarounds, "Mac incorrectly executes both sides of && and || expressions when they should " "short-circuit.", &members, "http://anglebug.com/482"}; - Feature emulatePrimitiveRestartFixedIndex = { + FeatureInfo emulatePrimitiveRestartFixedIndex = { "emulate_primitive_restart_fixed_index", FeatureCategory::OpenGLWorkarounds, "When GL_PRIMITIVE_RESTART_FIXED_INDEX is not available, emulate it with " "GL_PRIMITIVE_RESTART and glPrimitiveRestartIndex.", &members, "http://anglebug.com/3997"}; - Feature setPrimitiveRestartFixedIndexForDrawArrays = { + FeatureInfo setPrimitiveRestartFixedIndexForDrawArrays = { "set_primitive_restart_fixed_index_for_draw_arrays", FeatureCategory::OpenGLWorkarounds, "Some drivers discard vertex data in DrawArrays calls when the fixed primitive restart " "index is within the number of primitives being drawn.", &members, "http://anglebug.com/3997"}; - // Dynamic indexing of swizzled l-values doesn't work correctly on various platforms. - Feature removeDynamicIndexingOfSwizzledVector = { + FeatureInfo removeDynamicIndexingOfSwizzledVector = { "remove_dynamic_indexing_of_swizzled_vector", FeatureCategory::OpenGLWorkarounds, "Dynamic indexing of swizzled l-values doesn't work correctly on various platforms.", &members, "http://crbug.com/709351"}; - // Intel Mac drivers does not treat texelFetchOffset() correctly. - Feature preAddTexelFetchOffsets = { + FeatureInfo preAddTexelFetchOffsets = { "pre_add_texel_fetch_offsets", FeatureCategory::OpenGLWorkarounds, "Intel Mac drivers mistakenly consider the parameter position of nagative vaule as invalid " "even if the sum of position and offset is in range, so we need to add workarounds by " "rewriting texelFetchOffset(sampler, position, lod, offset) into texelFetch(sampler, " "position + offset, lod).", &members, "http://crbug.com/642605"}; - // All Mac drivers do not handle struct scopes correctly. This workaround overwrites a struct - // name with a unique prefix - Feature regenerateStructNames = { + FeatureInfo regenerateStructNames = { "regenerate_struct_names", FeatureCategory::OpenGLWorkarounds, "All Mac drivers do not handle struct scopes correctly. This workaround overwrites a struct" "name with a unique prefix.", &members, "http://crbug.com/403957"}; - // Quite some OpenGL ES drivers don't implement readPixels for RGBA/UNSIGNED_SHORT from - // EXT_texture_norm16 correctly - Feature readPixelsUsingImplementationColorReadFormatForNorm16 = { + FeatureInfo readPixelsUsingImplementationColorReadFormatForNorm16 = { "read_pixels_using_implementation_color_read_format", FeatureCategory::OpenGLWorkarounds, "Quite some OpenGL ES drivers don't implement readPixels for RGBA/UNSIGNED_SHORT from " "EXT_texture_norm16 correctly", &members, "http://anglebug.com/4214"}; - // Bugs exist in some Intel drivers where dependencies are incorrectly - // tracked for textures which are copy destinations (via CopyTexImage2D, for - // example). Flush before DeleteTexture if these entry points have been - // called recently. - Feature flushBeforeDeleteTextureIfCopiedTo = { + FeatureInfo flushBeforeDeleteTextureIfCopiedTo = { "flush_before_delete_texture_if_copied_to", FeatureCategory::OpenGLWorkarounds, "Some drivers track CopyTex{Sub}Image texture dependencies incorrectly. Flush" " before glDeleteTextures in this case", &members, "http://anglebug.com/4267"}; - // Rewrite row-major matrices as column-major as a driver bug workaround if - // necessary. - Feature rewriteRowMajorMatrices = { + FeatureInfo rewriteRowMajorMatrices = { "rewrite_row_major_matrices", FeatureCategory::OpenGLWorkarounds, "Rewrite row major matrices in shaders as column major as a driver bug workaround", &members, "http://anglebug.com/2273"}; - // Bugs exist in various OpenGL Intel drivers on Windows that produce incorrect - // values for GL_COMPRESSED_SRGB_S3TC_DXT1_EXT format. Replace it with - // GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT as it's the closest option allowed by - // the WebGL extension spec. - Feature avoidDXT1sRGBTextureFormat = { - "avoid_dxt1_srgb_texture_format", FeatureCategory::OpenGLWorkarounds, - "Replaces DXT1 sRGB with DXT1 sRGB Alpha as a driver bug workaround.", &members}; + FeatureInfo disableDrawBuffersIndexed = { + "disable_draw_buffers_indexed", + FeatureCategory::OpenGLWorkarounds, + "Disable OES_draw_buffers_indexed extension.", + &members, + }; - // Bugs exist in OpenGL AMD drivers on Windows that produce incorrect pipeline state for - // colorMaski calls. - Feature disableDrawBuffersIndexed = {"disable_draw_buffers_indexed", - FeatureCategory::OpenGLWorkarounds, - "Disable OES_draw_buffers_indexed extension.", &members}; + FeatureInfo disableSemaphoreFd = {"disable_semaphore_fd", FeatureCategory::OpenGLWorkarounds, + "Disable GL_EXT_semaphore_fd extension", &members, + "https://crbug.com/1046462"}; - // GL_EXT_semaphore_fd doesn't work properly with Mesa 19.3.4 and earlier versions. - Feature disableSemaphoreFd = {"disable_semaphore_fd", FeatureCategory::OpenGLWorkarounds, - "Disable GL_EXT_semaphore_fd extension", &members, - "https://crbug.com/1046462"}; - - // GL_EXT_disjoint_timer_query doesn't work properly with Linux VMWare drivers. - Feature disableTimestampQueries = { + FeatureInfo disableTimestampQueries = { "disable_timestamp_queries", FeatureCategory::OpenGLWorkarounds, "Disable GL_EXT_disjoint_timer_query extension", &members, "https://crbug.com/811661"}; - // Some drivers use linear blending when generating mipmaps for sRGB textures. Work around this - // by generating mipmaps in a linear texture and copying back to sRGB. - Feature encodeAndDecodeSRGBForGenerateMipmap = { + FeatureInfo encodeAndDecodeSRGBForGenerateMipmap = { "decode_encode_srgb_for_generatemipmap", FeatureCategory::OpenGLWorkarounds, "Decode and encode before generateMipmap for srgb format textures.", &members, "http://anglebug.com/4646"}; - Feature emulateCopyTexImage2DFromRenderbuffers = { + FeatureInfo emulateCopyTexImage2DFromRenderbuffers = { "emulate_copyteximage2d_from_renderbuffers", FeatureCategory::OpenGLWorkarounds, "CopyTexImage2D spuriously returns errors on iOS when copying from renderbuffers.", &members, "https://anglebug.com/4674"}; - Feature disableGPUSwitchingSupport = { + FeatureInfo disableGPUSwitchingSupport = { "disable_gpu_switching_support", FeatureCategory::OpenGLWorkarounds, "Disable GPU switching support (use only the low-power GPU) on older MacBook Pros.", &members, "https://crbug.com/1091824"}; - // KHR_parallel_shader_compile fails TSAN on Linux, so we avoid using it with this workaround. - Feature disableNativeParallelCompile = { + FeatureInfo disableNativeParallelCompile = { "disable_native_parallel_compile", FeatureCategory::OpenGLWorkarounds, "Do not use native KHR_parallel_shader_compile even when available.", &members, "http://crbug.com/1094869"}; - Feature emulatePackSkipRowsAndPackSkipPixels = { + FeatureInfo emulatePackSkipRowsAndPackSkipPixels = { "emulate_pack_skip_rows_and_pack_skip_pixels", FeatureCategory::OpenGLWorkarounds, "GL_PACK_SKIP_ROWS and GL_PACK_SKIP_PIXELS are ignored in Apple's OpenGL driver.", &members, "https://anglebug.com/4849"}; - // Some drivers return bogus/1hz values for GetMscRate, which we may want to clamp - Feature clampMscRate = { + FeatureInfo clampMscRate = { "clamp_msc_rate", FeatureCategory::OpenGLWorkarounds, "Some drivers return bogus values for GetMscRate, so we clamp it to 30Hz", &members, "https://crbug.com/1042393"}; - // Mac drivers generate GL_INVALID_VALUE when binding a transform feedback buffer with - // glBindBufferRange before first binding it to some generic binding point. - Feature bindTransformFeedbackBufferBeforeBindBufferRange = { + FeatureInfo bindTransformFeedbackBufferBeforeBindBufferRange = { "bind_transform_feedback_buffer_before_bind_buffer_range", FeatureCategory::OpenGLWorkarounds, "Bind transform feedback buffers to the generic binding point before calling " "glBindBufferBase or glBindBufferRange.", &members, "https://anglebug.com/5140"}; - // Speculative fix for issues on Linux/Wayland where exposing GLX_OML_sync_control renders - // Chrome unusable - Feature disableSyncControlSupport = { + FeatureInfo disableSyncControlSupport = { "disable_sync_control_support", FeatureCategory::OpenGLWorkarounds, "Speculative fix for issues on Linux/Wayland where exposing GLX_OML_sync_control renders " "Chrome unusable", &members, "https://crbug.com/1137851"}; - // Buffers need to maintain a shadow copy of data when buffer data readback is not possible - // through the GL API - Feature keepBufferShadowCopy = { - "keep_buffer_shadow_copy", FeatureCategory::OpenGLWorkarounds, + FeatureInfo keepBufferShadowCopy = { + "keep_buffer_shadow_copy", + FeatureCategory::OpenGLWorkarounds, "Maintain a shadow copy of buffer data when the GL API does not permit reading data back.", - &members}; + &members, + }; - // glGenerateMipmap fails if the zero texture level is not set on some Mac drivers - Feature setZeroLevelBeforeGenerateMipmap = { - "set_zero_level_before_generating_mipmap", FeatureCategory::OpenGLWorkarounds, + FeatureInfo setZeroLevelBeforeGenerateMipmap = { + "set_zero_level_before_generating_mipmap", + FeatureCategory::OpenGLWorkarounds, "glGenerateMipmap fails if the zero texture level is not set on some Mac drivers.", - &members}; + &members, + }; - // On macOS with AMD GPUs, packed color formats like RGB565 and RGBA4444 are buggy. Promote them - // to 8 bit per channel formats. - Feature promotePackedFormatsTo8BitPerChannel = { + FeatureInfo promotePackedFormatsTo8BitPerChannel = { "promote_packed_formats_to_8_bit_per_channel", FeatureCategory::OpenGLWorkarounds, "Packed color formats are buggy on Macs with AMD GPUs", &members, "http://anglebug.com/5469"}; - // If gl_FragColor is not written by fragment shader, it may cause context lost with Adreno 42x - // and 3xx. - Feature initFragmentOutputVariables = { + FeatureInfo initFragmentOutputVariables = { "init_fragment_output_variables", FeatureCategory::OpenGLWorkarounds, "No init gl_FragColor causes context lost", &members, "http://crbug.com/1171371"}; - // On macOS with Intel GPUs, instanced array with divisor > 0 is buggy when first > 0 in - // drawArraysInstanced. Shift the attributes with extra offset to workaround. - Feature shiftInstancedArrayDataWithExtraOffset = { + FeatureInfo shiftInstancedArrayDataWithExtraOffset = { "shift_instanced_array_data_with_offset", FeatureCategory::OpenGLWorkarounds, "glDrawArraysInstanced is buggy on certain new Mac Intel GPUs", &members, "http://crbug.com/1144207"}; - // ANGLE needs to support devices that have no native VAOs. Sync everything to the default VAO. - Feature syncVertexArraysToDefault = { + FeatureInfo syncVertexArraysToDefault = { "sync_vertex_arrays_to_default", FeatureCategory::OpenGLWorkarounds, "Only use the default VAO because of missing support or driver bugs", &members, "http://anglebug.com/5577"}; - // On desktop Linux/AMD when using the amdgpu drivers, the precise kernel and DRM version are - // leaked via GL_RENDERER. We workaround this to improve user privacy. - Feature sanitizeAmdGpuRendererString = { + FeatureInfo sanitizeAmdGpuRendererString = { "sanitize_amdgpu_renderer_string", FeatureCategory::OpenGLWorkarounds, "Strip precise kernel and DRM version information from amdgpu renderer strings.", &members, "http://crbug.com/1181193"}; - // Imagination GL drivers are buggy with context switching. We need to ubind fbo to workaround a - // crash in the driver. - Feature unbindFBOOnContextSwitch = {"unbind_fbo_before_switching_context", - FeatureCategory::OpenGLWorkarounds, - "Imagination GL drivers are buggy with context switching.", - &members, "http://crbug.com/1181193"}; + FeatureInfo unbindFBOOnContextSwitch = { + "unbind_fbo_before_switching_context", FeatureCategory::OpenGLWorkarounds, + "Imagination GL drivers are buggy with context switching.", &members, + "http://crbug.com/1181193"}; + + FeatureInfo flushOnFramebufferChange = {"flush_on_framebuffer_change", + FeatureCategory::OpenGLWorkarounds, + "Switching framebuffers without a flush can lead to " + "crashes on Intel 9th Generation GPU Macs.", + &members, "http://crbug.com/1181068"}; + + FeatureInfo disableMultisampledRenderToTexture = { + "disable_mutlisampled_render_to_texture", FeatureCategory::OpenGLWorkarounds, + "Many drivers have bugs when using GL_EXT_multisampled_render_to_texture", &members, + "http://anglebug.com/2894"}; - Feature flushOnFramebufferChange = {"flush_on_framebuffer_change", - FeatureCategory::OpenGLWorkarounds, - "Switching framebuffers without a flush can lead to " - "crashes on Intel 9th Generation GPU Macs.", - &members, "http://crbug.com/1181068"}; + FeatureInfo uploadTextureDataInChunks = { + "chunked_texture_upload", FeatureCategory::OpenGLWorkarounds, + "Upload texture data in <120kb chunks to work around Mac driver hangs and crashes.", + &members, "http://crbug.com/1181068"}; + + FeatureInfo emulateImmutableCompressedTexture3D = { + "emulate_immutable_compressed_texture_3d", FeatureCategory::OpenGLWorkarounds, + "Use non-immutable texture allocation to work around a driver bug.", &members, + "https://crbug.com/1060012"}; + + FeatureInfo emulateRGB10 = {"emulate_rgb10", FeatureCategory::OpenGLWorkarounds, + "Emulate RGB10 support using RGB10_A2.", &members, + "https://crbug.com/1300575"}; + + FeatureInfo alwaysUnbindFramebufferTexture2D = { + "always_unbind_framebuffer_texture_2d", FeatureCategory::OpenGLWorkarounds, + "Force unbind framebufferTexture2D before binding renderbuffer to work around driver bug.", + &members, "https://anglebug.com/5536"}; }; inline FeaturesGL::FeaturesGL() = default; inline FeaturesGL::~FeaturesGL() = default; diff --git a/gfx/angle/checkout/include/platform/FeaturesMtl.h b/gfx/angle/checkout/include/platform/FeaturesMtl.h --- a/gfx/angle/checkout/include/platform/FeaturesMtl.h +++ b/gfx/angle/checkout/include/platform/FeaturesMtl.h @@ -1,12 +1,13 @@ +// GENERATED FILE - DO NOT EDIT. +// Generated by gen_features.py using data from mtl_features.json. // -// Copyright 2019 The ANGLE Project Authors. All rights reserved. +// Copyright 2022 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. // // FeaturesMtl.h: Optional features for the Metal renderer. -// #ifndef ANGLE_PLATFORM_FEATURESMTL_H_ #define ANGLE_PLATFORM_FEATURESMTL_H_ #include "platform/Feature.h" @@ -14,77 +15,202 @@ namespace angle { struct FeaturesMtl : FeatureSetBase { - // BaseVertex/Instanced draw support: - Feature hasBaseVertexInstancedDraw = { - "has_base_vertex_instanced_draw", FeatureCategory::MetalFeatures, - "The renderer supports base vertex instanced draw", &members}; + FeaturesMtl(); + ~FeaturesMtl(); + + FeatureInfo hasBaseVertexInstancedDraw = { + "has_base_vertex_instanced_draw", + FeatureCategory::MetalFeatures, + "The renderer supports base vertex instanced draw", + &members, + }; + + FeatureInfo hasExplicitMemBarrier = { + "has_explicit_mem_barrier_mtl", + FeatureCategory::MetalFeatures, + "The renderer supports explicit memory barrier", + &members, + }; - // Support depth texture filtering - Feature hasDepthTextureFiltering = { - "has_depth_texture_filtering", FeatureCategory::MetalFeatures, - "The renderer supports depth texture's filtering other than nearest", &members}; + FeatureInfo hasCheapRenderPass = { + "has_cheap_render_pass_mtl", + FeatureCategory::MetalFeatures, + "The renderer can cheaply break a render pass.", + &members, + }; + + FeatureInfo hasNonUniformDispatch = { + "has_non_uniform_dispatch", + FeatureCategory::MetalFeatures, + "The renderer supports non uniform compute shader dispatch's group size", + &members, + }; - // Support explicit memory barrier - Feature hasExplicitMemBarrier = {"has_explicit_mem_barrier_mtl", FeatureCategory::MetalFeatures, - "The renderer supports explicit memory barrier", &members}; + FeatureInfo hasStencilOutput = { + "has_shader_stencil_output", + FeatureCategory::MetalFeatures, + "The renderer supports stencil output from fragment shader", + &members, + }; + + FeatureInfo hasTextureSwizzle = { + "has_texture_swizzle", + FeatureCategory::MetalFeatures, + "The renderer supports texture swizzle", + &members, + }; - // Some renderer can break render pass cheaply, i.e. desktop class GPUs. - Feature hasCheapRenderPass = {"has_cheap_render_pass_mtl", FeatureCategory::MetalFeatures, - "The renderer can cheaply break a render pass.", &members}; + FeatureInfo hasDepthAutoResolve = { + "has_msaa_depth_auto_resolve", + FeatureCategory::MetalFeatures, + "The renderer supports MSAA depth auto resolve at the end of render pass", + &members, + }; - // Non-uniform compute shader dispatch support, i.e. Group size is not necessarily to be fixed: - Feature hasNonUniformDispatch = { - "has_non_uniform_dispatch", FeatureCategory::MetalFeatures, - "The renderer supports non uniform compute shader dispatch's group size", &members}; + FeatureInfo hasStencilAutoResolve = { + "has_msaa_stencil_auto_resolve", + FeatureCategory::MetalFeatures, + "The renderer supports MSAA stencil auto resolve at the end of render pass", + &members, + }; + + FeatureInfo hasEvents = { + "has_mtl_events", + FeatureCategory::MetalFeatures, + "The renderer supports MTL(Shared)Event", + &members, + }; - // fragment stencil output support - Feature hasStencilOutput = {"has_shader_stencil_output", FeatureCategory::MetalFeatures, - "The renderer supports stencil output from fragment shader", - &members}; + FeatureInfo allowInlineConstVertexData = { + "allow_inline_const_vertex_data", + FeatureCategory::MetalFeatures, + "The renderer supports using inline constant data for small client vertex data", + &members, + }; - // Texture swizzle support: - Feature hasTextureSwizzle = {"has_texture_swizzle", FeatureCategory::MetalFeatures, - "The renderer supports texture swizzle", &members}; + FeatureInfo allowSeparatedDepthStencilBuffers = { + "allow_separate_depth_stencil_buffers", + FeatureCategory::MetalFeatures, + "Some Apple platforms such as iOS allows separate depth and stencil buffers, " + "whereas others such as macOS don't", + &members, + }; + + FeatureInfo allowRuntimeSamplerCompareMode = { + "allow_runtime_sampler_compare_mode", + FeatureCategory::MetalFeatures, + "The renderer supports changing sampler's compare mode outside shaders", + &members, + }; + + FeatureInfo allowSamplerCompareGradient = { + "allow_sampler_compare_gradient", + FeatureCategory::MetalFeatures, + "The renderer supports sample_compare with gradients", + &members, + }; - Feature hasDepthAutoResolve = { - "has_msaa_depth_auto_resolve", FeatureCategory::MetalFeatures, - "The renderer supports MSAA depth auto resolve at the end of render pass", &members}; + FeatureInfo allowSamplerCompareLod = { + "allow_sampler_compare_lod", + FeatureCategory::MetalFeatures, + "The renderer supports sample_compare with lod", + &members, + }; + + FeatureInfo allowBufferReadWrite = { + "allow_buffer_read_write", + FeatureCategory::MetalFeatures, + "The renderer supports buffer read and write in the same shader", + &members, + }; + + FeatureInfo allowMultisampleStoreAndResolve = { + "allow_msaa_store_and_resolve", + FeatureCategory::MetalFeatures, + "The renderer supports MSAA store and resolve in the same pass", + &members, + }; - Feature hasStencilAutoResolve = { - "has_msaa_stencil_auto_resolve", FeatureCategory::MetalFeatures, - "The renderer supports MSAA stencil auto resolve at the end of render pass", &members}; + FeatureInfo allowGenMultipleMipsPerPass = { + "gen_multiple_mips_per_pass", + FeatureCategory::MetalFeatures, + "The renderer supports generating multiple mipmaps per pass", + &members, + }; - Feature hasEvents = {"has_mtl_events", FeatureCategory::MetalFeatures, - "The renderer supports MTL(Shared)Event", &members}; + FeatureInfo forceD24S8AsUnsupported = { + "force_d24s8_as_unsupported", + FeatureCategory::MetalFeatures, + "Force Depth24Stencil8 format as unsupported.", + &members, + }; + + FeatureInfo forceBufferGPUStorage = { + "force_buffer_gpu_storage", + FeatureCategory::MetalFeatures, + "On systems that support both buffer' memory allocation on GPU and shared memory (such as " + "macOS), force using GPU memory allocation for buffers everytime or not.", + &members, + }; + + FeatureInfo directMetalGeneration = {"directMetalGeneration", FeatureCategory::MetalFeatures, + "Direct translation to Metal.", &members, + "http://anglebug.com/5505"}; - // On macos, separate depth & stencil buffers are not supproted. However, on iOS devices, - // they are supproted: - Feature allowSeparatedDepthStencilBuffers = { - "allow_separate_depth_stencil_buffers", FeatureCategory::MetalFeatures, - "Some Apple platforms such as iOS allows separate depth & stencil buffers, " - "whereas others such as macOS don't", - &members}; + FeatureInfo forceNonCSBaseMipmapGeneration = { + "force_non_cs_mipmap_gen", + FeatureCategory::MetalFeatures, + "Turn this feature on to disallow Compute Shader based mipmap generation. Compute Shader " + "based mipmap generation might cause GPU hang on some older iOS devices.", + &members, + }; - Feature allowMultisampleStoreAndResolve = { - "allow_msaa_store_and_resolve", FeatureCategory::MetalFeatures, - "The renderer supports MSAA store and resolve in the same pass", &members}; + FeatureInfo emulateTransformFeedback = { + "emulateTransformFeedback", + FeatureCategory::MetalFeatures, + "Turn this on to allow transform feedback in Metal using a 2-pass VS for GLES3.", + &members, + }; + + FeatureInfo rewriteRowMajorMatrices = { + "rewrite_row_major_matrices", + FeatureCategory::MetalFeatures, + "Rewrite row major matrices in shaders as column major.", + &members, + }; - Feature allowGenMultipleMipsPerPass = { - "gen_multiple_mips_per_pass", FeatureCategory::MetalFeatures, - "The renderer supports generating multiple mipmaps per pass", &members}; + FeatureInfo intelExplicitBoolCastWorkaround = { + "intel_explicit_bool_cast_workaround", + FeatureCategory::MetalWorkarounds, + "Insert explicit casts for float/double/unsigned/signed int on macOS 10.15 with Intel " + "driver", + &members, + }; + + FeatureInfo intelDisableFastMath = { + "intel_disable_fast_math", + FeatureCategory::MetalWorkarounds, + "Disable fast math in atan and invariance cases when running below macOS 12.0", + &members, + }; - Feature forceBufferGPUStorage = { - "force_buffer_gpu_storage_mtl", FeatureCategory::MetalFeatures, - "On systems that support both buffer's memory allocation on GPU and shared memory (such as " - "macOS), force using GPU memory allocation for buffers.", - &members}; + FeatureInfo multisampleColorFormatShaderReadWorkaround = { + "multisample_color_format_shader_read_workaround", FeatureCategory::MetalWorkarounds, + "Add shaderRead usage to some multisampled texture formats", &members, + "http://anglebug.com/7049"}; - Feature forceD24S8AsUnsupported = {"force_d24s8_as_unsupported", FeatureCategory::MetalFeatures, - "Force Depth24Stencil8 format as unsupported.", &members}; + FeatureInfo copyIOSurfaceToNonIOSurfaceForReadOptimization = { + "copy_iosurface_to_non_iosurface_for_read_optimization", FeatureCategory::MetalWorkarounds, + "some GPUs are faster to read an IOSurface texture by first copying the texture to a " + "non-IOSurface texture", + &members, "http://anglebug.com/7117"}; }; +inline FeaturesMtl::FeaturesMtl() = default; +inline FeaturesMtl::~FeaturesMtl() = default; + } // namespace angle #endif // ANGLE_PLATFORM_FEATURESMTL_H_ diff --git a/gfx/angle/checkout/include/platform/FeaturesVk.h b/gfx/angle/checkout/include/platform/FeaturesVk.h --- a/gfx/angle/checkout/include/platform/FeaturesVk.h +++ b/gfx/angle/checkout/include/platform/FeaturesVk.h @@ -1,528 +1,600 @@ +// GENERATED FILE - DO NOT EDIT. +// Generated by gen_features.py using data from vk_features.json. // -// Copyright 2018 The ANGLE Project Authors. All rights reserved. +// Copyright 2022 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. // // FeaturesVk.h: Optional features for the Vulkan renderer. -// #ifndef ANGLE_PLATFORM_FEATURESVK_H_ #define ANGLE_PLATFORM_FEATURESVK_H_ #include "platform/Feature.h" -#include - namespace angle { struct FeaturesVk : FeatureSetBase { FeaturesVk(); ~FeaturesVk(); - // Line segment rasterization must follow OpenGL rules. This means using an algorithm similar - // to Bresenham's. Vulkan uses a different algorithm. This feature enables the use of pixel - // shader patching to implement OpenGL basic line rasterization rules. This feature will - // normally always be enabled. Exposing it as an option enables performance testing. - Feature basicGLLineRasterization = { - "basicGLLineRasterization", FeatureCategory::VulkanFeatures, + FeatureInfo basicGLLineRasterization = { + "basicGLLineRasterization", + FeatureCategory::VulkanFeatures, "Enable the use of pixel shader patching to implement OpenGL basic line " "rasterization rules", - &members}; + &members, + }; - // If the VK_EXT_line_rasterization extension is available we'll use it to get - // Bresenham line rasterization. - Feature bresenhamLineRasterization = { - "bresenhamLineRasterization", FeatureCategory::VulkanFeatures, - "Enable Bresenham line rasterization via VK_EXT_line_rasterization extension", &members}; - - // If the VK_EXT_provoking_vertex extension is available, we'll use it to set - // the provoking vertex mode - Feature provokingVertex = {"provokingVertex", FeatureCategory::VulkanFeatures, - "Enable provoking vertex mode via VK_EXT_provoking_vertex extension", - &members}; + FeatureInfo bresenhamLineRasterization = { + "bresenhamLineRasterization", + FeatureCategory::VulkanFeatures, + "Enable Bresenham line rasterization via VK_EXT_line_rasterization extension", + &members, + }; - // Add an extra copy region when using vkCmdCopyBuffer as the Windows Intel driver seems - // to have a bug where the last region is ignored. - Feature extraCopyBufferRegion = { - "extraCopyBufferRegion", FeatureCategory::VulkanWorkarounds, - "Some drivers seem to have a bug where the last copy region in vkCmdCopyBuffer is ignored", - &members}; + FeatureInfo provokingVertex = { + "provokingVertex", + FeatureCategory::VulkanFeatures, + "Enable provoking vertex mode via VK_EXT_provoking_vertex extension", + &members, + }; - // This flag is added for the sole purpose of end2end tests, to test the correctness - // of various algorithms when a fallback format is used, such as using a packed format to - // emulate a depth- or stencil-only format. - Feature forceFallbackFormat = {"forceFallbackFormat", FeatureCategory::VulkanWorkarounds, - "Force a fallback format for angle_end2end_tests", &members}; + FeatureInfo forceFallbackFormat = { + "forceFallbackFormat", + FeatureCategory::VulkanWorkarounds, + "Force a fallback format for angle_end2end_tests", + &members, + }; - // On some NVIDIA drivers the point size range reported from the API is inconsistent with the - // actual behavior. Clamp the point size to the value from the API to fix this. - // Tracked in http://anglebug.com/2970. - Feature clampPointSize = { - "clampPointSize", FeatureCategory::VulkanWorkarounds, + FeatureInfo clampPointSize = { + "clamp_point_size", FeatureCategory::VulkanWorkarounds, "The point size range reported from the API is inconsistent with the actual behavior", &members, "http://anglebug.com/2970"}; - // On some NVIDIA drivers the depth value is not clamped to [0,1] for floating point depth - // buffers. This is NVIDIA bug 3171019, see http://anglebug.com/3970 for details. - Feature depthClamping = { + FeatureInfo depthClamping = { "depth_clamping", FeatureCategory::VulkanWorkarounds, "The depth value is not clamped to [0,1] for floating point depth buffers.", &members, "http://anglebug.com/3970"}; - // On some android devices, the memory barrier between the compute shader that converts vertex - // attributes and the vertex shader that reads from it is ineffective. Only known workaround is - // to perform a flush after the conversion. http://anglebug.com/3016 - Feature flushAfterVertexConversion = { - "flushAfterVertexConversion", FeatureCategory::VulkanWorkarounds, - "The memory barrier between the compute shader that converts vertex attributes and the " - "vertex shader that reads from it is ineffective", - &members, "http://anglebug.com/3016"}; + FeatureInfo supportsRenderpass2 = { + "supportsRenderpass2", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_create_renderpass2 extension", + &members, + }; - Feature supportsRenderpass2 = {"supportsRenderpass2", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_create_renderpass2 extension", - &members}; + FeatureInfo supportsIncrementalPresent = { + "supportsIncrementalPresent", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_incremental_present extension", + &members, + }; - // Whether the VkDevice supports the VK_KHR_incremental_present extension, on which the - // EGL_KHR_swap_buffers_with_damage extension can be layered. - Feature supportsIncrementalPresent = { - "supportsIncrementalPresent", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_incremental_present extension", &members}; + FeatureInfo supportsAndroidHardwareBuffer = { + "supportsAndroidHardwareBuffer", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer extension", + &members, + }; - // Whether texture copies on cube map targets should be done on GPU. This is a workaround for - // Intel drivers on windows that have an issue with creating single-layer views on cube map - // textures. - Feature forceCPUPathForCubeMapCopy = { - "forceCPUPathForCubeMapCopy", FeatureCategory::VulkanWorkarounds, - "Some drivers have an issue with creating single-layer views on cube map textures", - &members}; + FeatureInfo supportsGGPFrameToken = { + "supportsGGPFrameToken", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_GGP_frame_token extension", + &members, + }; - // Whether the VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer - // extension, on which the EGL_ANDROID_image_native_buffer extension can be layered. - Feature supportsAndroidHardwareBuffer = { - "supportsAndroidHardwareBuffer", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_ANDROID_external_memory_android_hardware_buffer extension", - &members}; + FeatureInfo supportsExternalMemoryFd = { + "supportsExternalMemoryFd", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_external_memory_fd extension", + &members, + }; - // Whether the VkDevice supports the VK_GGP_frame_token extension, on which - // the EGL_ANGLE_swap_with_frame_token extension can be layered. - Feature supportsGGPFrameToken = {"supportsGGPFrameToken", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_GGP_frame_token extension", - &members}; + FeatureInfo supportsExternalMemoryFuchsia = { + "supportsExternalMemoryFuchsia", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_FUCHSIA_external_memory extension", + &members, + }; - // Whether the VkDevice supports the VK_KHR_external_memory_fd extension, on which the - // GL_EXT_memory_object_fd extension can be layered. - Feature supportsExternalMemoryFd = {"supportsExternalMemoryFd", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_external_memory_fd extension", - &members}; + FeatureInfo supportsFilteringPrecision = { + "supportsFilteringPrecision", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_GOOGLE_sampler_filtering_precision extension", + &members, + }; - // Whether the VkDevice supports the VK_FUCHSIA_external_memory - // extension, on which the GL_ANGLE_memory_object_fuchsia extension can be layered. - Feature supportsExternalMemoryFuchsia = { - "supportsExternalMemoryFuchsia", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_FUCHSIA_external_memory extension", &members}; + FeatureInfo supportsExternalFenceCapabilities = { + "supportsExternalFenceCapabilities", + FeatureCategory::VulkanFeatures, + "VkInstance supports the VK_KHR_external_fence_capabilities extension", + &members, + }; - Feature supportsFilteringPrecision = { - "supportsFilteringPrecision", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_GOOGLE_sampler_filtering_precision extension", &members}; - - // Whether the VkDevice supports the VK_KHR_external_fence_capabilities extension. - Feature supportsExternalFenceCapabilities = { - "supportsExternalFenceCapabilities", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_external_fence_capabilities extension", &members}; + FeatureInfo supportsExternalSemaphoreCapabilities = { + "supportsExternalSemaphoreCapabilities", + FeatureCategory::VulkanFeatures, + "VkInstance supports the VK_KHR_external_semaphore_capabilities extension", + &members, + }; - // Whether the VkDevice supports the VK_KHR_external_semaphore_capabilities extension. - Feature supportsExternalSemaphoreCapabilities = { - "supportsExternalSemaphoreCapabilities", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_external_semaphore_capabilities extension", &members}; - - // Whether the VkDevice supports the VK_KHR_external_semaphore_fd extension, on which the - // GL_EXT_semaphore_fd extension can be layered. - Feature supportsExternalSemaphoreFd = { - "supportsExternalSemaphoreFd", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_external_semaphore_fd extension", &members}; + FeatureInfo supportsExternalSemaphoreFd = { + "supportsExternalSemaphoreFd", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_external_semaphore_fd extension", + &members, + }; - // Whether the VkDevice supports the VK_FUCHSIA_external_semaphore - // extension, on which the GL_ANGLE_semaphore_fuchsia extension can be layered. - angle::Feature supportsExternalSemaphoreFuchsia = { - "supportsExternalSemaphoreFuchsia", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_FUCHSIA_external_semaphore extension", &members}; + FeatureInfo supportsExternalSemaphoreFuchsia = { + "supportsExternalSemaphoreFuchsia", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_FUCHSIA_external_semaphore extension", + &members, + }; - // Whether the VkDevice supports the VK_KHR_external_fence_fd extension, on which the - // EGL_ANDROID_native_fence extension can be layered. - Feature supportsExternalFenceFd = {"supportsExternalFenceFd", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_external_fence_fd extension", - &members, "http://anglebug.com/2517"}; + FeatureInfo supportsExternalFenceFd = { + "supportsExternalFenceFd", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_external_fence_fd extension", &members, + "http://anglebug.com/2517"}; - // Whether the VkDevice can support EGL_ANDROID_native_fence_sync extension. - Feature supportsAndroidNativeFenceSync = { + FeatureInfo supportsAndroidNativeFenceSync = { "supportsAndroidNativeFenceSync", FeatureCategory::VulkanFeatures, "VkDevice supports the EGL_ANDROID_native_fence_sync extension", &members, "http://anglebug.com/2517"}; - // Whether the VkDevice can support imageCubeArray feature properly. - Feature supportsImageCubeArray = {"supportsImageCubeArray", FeatureCategory::VulkanFeatures, - "VkDevice supports the imageCubeArray feature properly", - &members, "http://anglebug.com/3584"}; + FeatureInfo supportsImageCubeArray = {"supportsImageCubeArray", FeatureCategory::VulkanFeatures, + "VkDevice supports the imageCubeArray feature properly", + &members, "http://anglebug.com/3584"}; + + FeatureInfo supportsPipelineStatisticsQuery = { + "supportsPipelineStatisticsQuery", FeatureCategory::VulkanFeatures, + "VkDevice supports the pipelineStatisticsQuery feature", &members, + "http://anglebug.com/5430"}; - // Whether the VkDevice supports the VK_EXT_shader_stencil_export extension, which is used to - // perform multisampled resolve of stencil buffer. A multi-step workaround is used instead if - // this extension is not available. - Feature supportsShaderStencilExport = { - "supportsShaderStencilExport", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_EXT_shader_stencil_export extension", &members}; + FeatureInfo supportsShaderStencilExport = { + "supportsShaderStencilExport", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_EXT_shader_stencil_export extension", + &members, + }; - // Whether the VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension, which is needed - // to support Ycbcr conversion with external images. - Feature supportsYUVSamplerConversion = { - "supportsYUVSamplerConversion", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension", &members}; + FeatureInfo supportsYUVSamplerConversion = { + "supportsYUVSamplerConversion", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_sampler_ycbcr_conversion extension", + &members, + }; - // Where VK_EXT_transform_feedback is not support, an emulation path is used. - // http://anglebug.com/3205 - Feature emulateTransformFeedback = { + FeatureInfo emulateTransformFeedback = { "emulateTransformFeedback", FeatureCategory::VulkanFeatures, "Emulate transform feedback as the VK_EXT_transform_feedback is not present.", &members, "http://anglebug.com/3205"}; - // Where VK_EXT_transform_feedback is supported, it's preferred over an emulation path. - // http://anglebug.com/3206 - Feature supportsTransformFeedbackExtension = { + FeatureInfo supportsTransformFeedbackExtension = { "supportsTransformFeedbackExtension", FeatureCategory::VulkanFeatures, "Transform feedback uses the VK_EXT_transform_feedback extension.", &members, "http://anglebug.com/3206"}; - // Whether the VkDevice supports the VK_EXT_index_type_uint8 extension - // http://anglebug.com/4405 - Feature supportsIndexTypeUint8 = {"supportsIndexTypeUint8", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_EXT_index_type_uint8 extension", - &members, "http://anglebug.com/4405"}; + FeatureInfo supportsGeometryStreamsCapability = { + "supportsGeometryStreamsCapability", FeatureCategory::VulkanFeatures, + "Implementation supports the GeometryStreams SPIR-V capability.", &members, + "http://anglebug.com/3206"}; + + FeatureInfo supportsIndexTypeUint8 = {"supportsIndexTypeUint8", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_EXT_index_type_uint8 extension", + &members, "http://anglebug.com/4405"}; - // Whether the VkDevice supports the VK_KHR_depth_stencil_resolve extension with the - // independentResolveNone feature. - // http://anglebug.com/4836 - Feature supportsDepthStencilResolve = {"supportsDepthStencilResolve", - FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_depth_stencil_resolve " - "extension with the independentResolveNone feature", - &members, "http://anglebug.com/4836"}; + FeatureInfo supportsCustomBorderColor = { + "supportsCustomBorderColor", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_EXT_custom_border_color extension", &members, + "http://anglebug.com/3577"}; - // Whether the VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension. - // http://anglebug.com/4836 - Feature supportsMultisampledRenderToSingleSampled = { + FeatureInfo supportsMultiDrawIndirect = { + "supportsMultiDrawIndirect", FeatureCategory::VulkanFeatures, + "VkDevice supports the multiDrawIndirect extension", &members, "http://anglebug.com/6439"}; + + FeatureInfo supportsDepthStencilResolve = {"supportsDepthStencilResolve", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_depth_stencil_resolve " + "extension with the independentResolveNone feature", + &members, "http://anglebug.com/4836"}; + + FeatureInfo supportsMultisampledRenderToSingleSampled = { "supportsMultisampledRenderToSingleSampled", FeatureCategory::VulkanFeatures, "VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension", &members, "http://anglebug.com/4836"}; - // VK_PRESENT_MODE_FIFO_KHR causes random timeouts on Linux Intel. http://anglebug.com/3153 - Feature disableFifoPresentMode = {"disableFifoPresentMode", FeatureCategory::VulkanWorkarounds, - "VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, - "http://anglebug.com/3153"}; + FeatureInfo supportsMultiview = {"supportsMultiview", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_multiview extension", &members, + "http://anglebug.com/6048"}; - // On Qualcomm, gaps in bound descriptor set indices causes the post-gap sets to misbehave. - // For example, binding only descriptor set 3 results in zero being read from a uniform buffer - // object within that set. This flag results in empty descriptor sets being bound for any - // unused descriptor set to work around this issue. http://anglebug.com/2727 - Feature bindEmptyForUnusedDescriptorSets = { + FeatureInfo disableFifoPresentMode = { + "disableFifoPresentMode", FeatureCategory::VulkanWorkarounds, + "VK_PRESENT_MODE_FIFO_KHR causes random timeouts", &members, "http://anglebug.com/3153"}; + + FeatureInfo bindEmptyForUnusedDescriptorSets = { "bindEmptyForUnusedDescriptorSets", FeatureCategory::VulkanWorkarounds, "Gaps in bound descriptor set indices causes the post-gap sets to misbehave", &members, "http://anglebug.com/2727"}; - // OES_depth_texture is a commonly expected feature on Android. However it - // requires that D16_UNORM support texture filtering - // (e.g. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT) and some devices - // do not. Work-around this by setting saying D16_UNORM supports filtering - // anyway. - Feature forceD16TexFilter = { + FeatureInfo forceD16TexFilter = { "forceD16TexFilter", FeatureCategory::VulkanWorkarounds, "VK_FORMAT_D16_UNORM does not support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT, " "which prevents OES_depth_texture from being supported.", &members, "http://anglebug.com/3452"}; - // On some android devices, vkCmdBlitImage with flipped coordinates blits incorrectly. This - // workaround makes sure this path is avoided. http://anglebug.com/3498 - Feature disableFlippingBlitWithCommand = { + FeatureInfo disableFlippingBlitWithCommand = { "disableFlippingBlitWithCommand", FeatureCategory::VulkanWorkarounds, "vkCmdBlitImage with flipped coordinates blits incorrectly.", &members, "http://anglebug.com/3498"}; - // On platform with Intel or AMD GPU, a window resizing would not trigger the vulkan driver to - // return VK_ERROR_OUT_OF_DATE on swapchain present. Work-around by query current window extent - // every frame to detect a window resizing. - // http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625 - Feature perFrameWindowSizeQuery = { + FeatureInfo perFrameWindowSizeQuery = { "perFrameWindowSizeQuery", FeatureCategory::VulkanWorkarounds, "Vulkan swapchain is not returning VK_ERROR_OUT_OF_DATE when window resizing", &members, "http://anglebug.com/3623, http://anglebug.com/3624, http://anglebug.com/3625"}; - // Seamful cube map emulation misbehaves on the AMD windows driver, so it's disallowed. - Feature disallowSeamfulCubeMapEmulation = { + FeatureInfo disallowSeamfulCubeMapEmulation = { "disallowSeamfulCubeMapEmulation", FeatureCategory::VulkanWorkarounds, "Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members, "http://anglebug.com/3243"}; - // Vulkan considers vertex attribute accesses to count up to the last multiple of the stride. - // This additional access supports AMD's robust buffer access implementation. - // AMDVLK in particular will return incorrect values when the vertex access extends into the - // range that would be the stride padding and the buffer is too small. - // This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a reasonable value and pads out - // every buffer allocation size to be large enough to support a maximum vertex stride. - // http://anglebug.com/4428 - Feature padBuffersToMaxVertexAttribStride = { + FeatureInfo padBuffersToMaxVertexAttribStride = { "padBuffersToMaxVertexAttribStride", FeatureCategory::VulkanWorkarounds, "Vulkan considers vertex attribute accesses to count up to the last multiple of the " "stride. This additional access supports AMD's robust buffer access implementation. " "AMDVLK in particular will return incorrect values when the vertex access extends into " "the range that would be the stride padding and the buffer is too small. " "This workaround limits GL_MAX_VERTEX_ATTRIB_STRIDE to a maximum value and " "pads up every buffer allocation size to be a multiple of the maximum stride.", &members, "http://anglebug.com/4428"}; - // Whether the VkDevice supports the VK_EXT_swapchain_colorspace extension - // http://anglebug.com/2514 - Feature supportsSwapchainColorspace = { - "supportsSwapchainColorspace", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_EXT_swapchain_colorspace extension", &members, - "http://anglebug.com/2514"}; + FeatureInfo supportsExternalMemoryDmaBufAndModifiers = { + "supportsExternalMemoryDmaBufAndModifiers", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_EXT_external_memory_dma_buf and VK_EXT_image_drm_format_modifier " + "extensions", + &members, "http://anglebug.com/6248"}; - // Whether the VkDevice supports the VK_EXT_external_memory_host extension, on which the - // ANGLE_iosurface_client_buffer extension can be layered. - Feature supportsExternalMemoryHost = { - "supportsExternalMemoryHost", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_EXT_external_memory_host extension", &members}; + FeatureInfo supportsExternalMemoryHost = { + "supportsExternalMemoryHost", + FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_EXT_external_memory_host extension", + &members, + }; - // Whether to fill new buffers and textures with nonzero data to sanitize robust resource - // initialization and flush out assumptions about zero init. - Feature allocateNonZeroMemory = { + FeatureInfo allocateNonZeroMemory = { "allocateNonZeroMemory", FeatureCategory::VulkanFeatures, "Fill new allocations with non-zero values to flush out errors.", &members, "http://anglebug.com/4384"}; - // Whether to log each callback from the VK_EXT_device_memory_report extension. This feature is - // used for trying to debug GPU memory leaks. - Feature logMemoryReportCallbacks = {"logMemoryReportCallbacks", FeatureCategory::VulkanFeatures, - "Log each callback from VK_EXT_device_memory_report", - &members}; + FeatureInfo logMemoryReportCallbacks = { + "logMemoryReportCallbacks", + FeatureCategory::VulkanFeatures, + "Log each callback from VK_EXT_device_memory_report", + &members, + }; - // Whether to log statistics from the VK_EXT_device_memory_report extension each eglSwapBuffer. - Feature logMemoryReportStats = {"logMemoryReportStats", FeatureCategory::VulkanFeatures, - "Log stats from VK_EXT_device_memory_report each swap", - &members}; + FeatureInfo logMemoryReportStats = { + "logMemoryReportStats", + FeatureCategory::VulkanFeatures, + "Log stats from VK_EXT_device_memory_report each swap", + &members, + }; - // Allocate a "shadow" buffer for GL buffer objects. For GPU-read only buffers - // glMap* latency can be reduced by maintaining a copy of the buffer which is - // writeable only by the CPU. We then return this shadow buffer on glMap* calls. - Feature shadowBuffers = { + FeatureInfo shadowBuffers = { "shadowBuffers", FeatureCategory::VulkanFeatures, "Allocate a shadow buffer for GL buffer objects to reduce glMap* latency.", &members, "http://anglebug.com/4339"}; - // Persistently map buffer memory until destroy, saves on map/unmap IOCTL overhead - // for buffers that are updated frequently. - Feature persistentlyMappedBuffers = { + FeatureInfo preferCPUForBufferSubData = { + "preferCPUForBufferSubData", FeatureCategory::VulkanFeatures, + "Prefer use CPU to do bufferSubData instead of staged update.", &members, + "http://issuetracker.google.com/200067929"}; + + FeatureInfo persistentlyMappedBuffers = { "persistentlyMappedBuffers", FeatureCategory::VulkanFeatures, "Persistently map buffer memory to reduce map/unmap IOCTL overhead.", &members, "http://anglebug.com/2162"}; - // Android needs to pre-rotate surfaces that are not oriented per the native device's - // orientation (e.g. a landscape application on a Pixel phone). This feature works for - // full-screen applications. http://anglebug.com/3502 - Feature enablePreRotateSurfaces = {"enablePreRotateSurfaces", FeatureCategory::VulkanFeatures, - "Enable Android pre-rotation for landscape applications", - &members, "http://anglebug.com/3502"}; + FeatureInfo enablePreRotateSurfaces = {"enablePreRotateSurfaces", + FeatureCategory::VulkanFeatures, + "Enable Android pre-rotation for landscape applications", + &members, "http://anglebug.com/3502"}; - // Enable precision qualifiers for shaders generated by Vulkan backend http://anglebug.com/3078 - Feature enablePrecisionQualifiers = { + FeatureInfo enablePrecisionQualifiers = { "enablePrecisionQualifiers", FeatureCategory::VulkanFeatures, "Enable precision qualifiers in shaders", &members, "http://anglebug.com/3078"}; - // Desktop (at least NVIDIA) drivers prefer combining barriers into one vkCmdPipelineBarrier - // call over issuing multiple barrier calls with fine grained dependency information to have - // better performance. http://anglebug.com/4633 - Feature preferAggregateBarrierCalls = { + FeatureInfo preferAggregateBarrierCalls = { "preferAggregateBarrierCalls", FeatureCategory::VulkanWorkarounds, "Single barrier call is preferred over multiple calls with " "fine grained pipeline stage dependency information", &members, "http://anglebug.com/4633"}; - // Tell the Vulkan back-end to use the async command queue to dispatch work to the GPU. Command - // buffer work will happened in a worker thread. Otherwise use Renderer::CommandQueue directly. - Feature asyncCommandQueue = {"asyncCommandQueue", FeatureCategory::VulkanFeatures, - "Use CommandQueue worker thread to dispatch work to GPU.", - &members, "http://anglebug.com/4324"}; + FeatureInfo preferSkippingInvalidateForEmulatedFormats = { + "preferSkippingInvalidateForEmulatedFormats", FeatureCategory::VulkanWorkarounds, + "Skipping invalidate is preferred for emulated formats that have extra channels over " + "re-clearing the image", + &members, "http://anglebug.com/6860"}; - // Whether the VkDevice supports the VK_KHR_shader_float16_int8 extension and has the - // shaderFloat16 feature. - Feature supportsShaderFloat16 = {"supportsShaderFloat16", FeatureCategory::VulkanFeatures, - "VkDevice supports the VK_KHR_shader_float16_int8 extension " - "and has the shaderFloat16 feature", - &members, "http://anglebug.com/4551"}; + FeatureInfo asyncCommandQueue = {"asyncCommandQueue", FeatureCategory::VulkanFeatures, + "Use CommandQueue worker thread to dispatch work to GPU.", + &members, "http://anglebug.com/4324"}; - // Some devices don't meet the limits required to perform mipmap generation using the built-in - // compute shader. On some other devices, VK_IMAGE_USAGE_STORAGE_BIT is detrimental to - // performance, making this solution impractical. - Feature allowGenerateMipmapWithCompute = { + FeatureInfo supportsShaderFloat16 = { + "supportsShaderFloat16", FeatureCategory::VulkanFeatures, + "VkDevice supports the VK_KHR_shader_float16_int8 extension " + "and has the shaderFloat16 feature", + &members, "http://anglebug.com/4551"}; + + FeatureInfo allowGenerateMipmapWithCompute = { "allowGenerateMipmapWithCompute", FeatureCategory::VulkanFeatures, "Use the compute path to generate mipmaps on devices that meet the minimum requirements, " "and the performance is better.", &members, "http://anglebug.com/4551"}; - // Whether the VkDevice supports the VK_QCOM_render_pass_store_ops extension - // http://anglebug.com/5505 - Feature supportsRenderPassStoreOpNoneQCOM = { + FeatureInfo supportsRenderPassStoreOpNoneQCOM = { "supportsRenderPassStoreOpNoneQCOM", FeatureCategory::VulkanFeatures, "VkDevice supports VK_QCOM_render_pass_store_ops extension.", &members, "http://anglebug.com/5055"}; - // Force maxUniformBufferSize to 16K on Qualcomm's Adreno 540. Pixel2's Adreno540 reports - // maxUniformBufferSize 64k but various tests failed with that size. For that specific - // device, we set to 16k for now which is known to pass all tests. - // https://issuetracker.google.com/161903006 - Feature forceMaxUniformBufferSize16KB = { + FeatureInfo supportsRenderPassLoadStoreOpNone = { + "supportsRenderPassLoadStoreOpNone", FeatureCategory::VulkanFeatures, + "VkDevice supports VK_EXT_load_store_op_none extension.", &members, + "http://anglebug.com/5371"}; + + FeatureInfo supportsDepthClipControl = { + "supportsDepthClipControl", FeatureCategory::VulkanFeatures, + "VkDevice supports VK_EXT_depth_clip_control extension.", &members, + "http://anglebug.com/5421"}; + + FeatureInfo supportsBlendOperationAdvanced = { + "supportsBlendOperationAdvanced", FeatureCategory::VulkanFeatures, + "VkDevice supports VK_EXT_blend_operation_advanced extension.", &members, + "http://anglebug.com/3586"}; + + FeatureInfo forceMaxUniformBufferSize16KB = { "forceMaxUniformBufferSize16KB", FeatureCategory::VulkanWorkarounds, "Force max uniform buffer size to 16K on some device due to bug", &members, "https://issuetracker.google.com/161903006"}; - // Enable mutable bit by default for ICD's that support VK_KHR_image_format_list. - // http://anglebug.com/5281 - Feature supportsImageFormatList = { + FeatureInfo supportsImageFormatList = { "supportsImageFormatList", FeatureCategory::VulkanFeatures, "Enable VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT by default for ICDs " "that support VK_KHR_image_format_list", &members, "http://anglebug.com/5281"}; - // Swiftshader on mac fails to initialize WebGL context when EXT_multisampled_render_to_texture - // is used by Chromium. - // http://anglebug.com/4937 - Feature enableMultisampledRenderToTexture = { + FeatureInfo enableMultisampledRenderToTexture = { "enableMultisampledRenderToTexture", FeatureCategory::VulkanWorkarounds, "Expose EXT_multisampled_render_to_texture", &members, "http://anglebug.com/4937"}; - // Qualcomm fails some tests when reducing the preferred block size to 4M. - // http://anglebug.com/4995 - Feature preferredLargeHeapBlockSize4MB = { - "preferredLargeHeapBlockSize4MB", FeatureCategory::VulkanWorkarounds, - "Use 4 MB preferred large heap block size with AMD allocator", &members, - "http://anglebug.com/4995"}; - - // Manhattan is calling glFlush in the middle of renderpass which breaks renderpass and hurts - // performance on tile based GPU. When this is enabled, we will defer the glFlush call made in - // the middle of renderpass to the end of renderpass. - // https://issuetracker.google.com/issues/166475273 - Feature deferFlushUntilEndRenderPass = { + FeatureInfo deferFlushUntilEndRenderPass = { "deferFlushUntilEndRenderPass", FeatureCategory::VulkanWorkarounds, "Allow glFlush to be deferred until renderpass ends", &members, "https://issuetracker.google.com/issues/166475273"}; - // Android mistakenly destroys oldSwapchain passed to vkCreateSwapchainKHR, causing crashes on - // certain drivers. http://anglebug.com/5061 - Feature waitIdleBeforeSwapchainRecreation = { + FeatureInfo waitIdleBeforeSwapchainRecreation = { "waitIdleBeforeSwapchainRecreation", FeatureCategory::VulkanWorkarounds, "Before passing an oldSwapchain to VkSwapchainCreateInfoKHR, wait for queue to be idle. " "Works around a bug on platforms which destroy oldSwapchain in vkCreateSwapchainKHR.", &members, "http://anglebug.com/5061"}; - // Allow forcing an LOD offset on all sampling operations for performance comparisons. ANGLE is - // non-conformant if this feature is enabled. - std::array forceTextureLODOffset = { - angle::Feature{"force_texture_lod_offset_1", angle::FeatureCategory::VulkanWorkarounds, - "Increase the minimum texture level-of-detail by 1 when sampling.", - &members}, - angle::Feature{"force_texture_lod_offset_2", angle::FeatureCategory::VulkanWorkarounds, - "Increase the minimum texture level-of-detail by 2 when sampling.", - &members}, - angle::Feature{"force_texture_lod_offset_3", angle::FeatureCategory::VulkanWorkarounds, - "Increase the minimum texture level-of-detail by 3 when sampling.", - &members}, - angle::Feature{"force_texture_lod_offset_4", angle::FeatureCategory::VulkanWorkarounds, - "Increase the minimum texture level-of-detail by 4 when sampling.", - &members}, + FeatureInfo forceTextureLodOffset1 = { + "force_texture_lod_offset_1", + FeatureCategory::VulkanWorkarounds, + "Increase the minimum texture level-of-detail by 1 when sampling.", + &members, + }; + + FeatureInfo forceTextureLodOffset2 = { + "force_texture_lod_offset_2", + FeatureCategory::VulkanWorkarounds, + "Increase the minimum texture level-of-detail by 2 when sampling.", + &members, + }; + + FeatureInfo forceTextureLodOffset3 = { + "force_texture_lod_offset_3", + FeatureCategory::VulkanWorkarounds, + "Increase the minimum texture level-of-detail by 3 when sampling.", + &members, }; - // Translate non-nearest filtering modes to nearest for all samplers for performance - // comparisons. ANGLE is non-conformant if this feature is enabled. - Feature forceNearestFiltering = {"force_nearest_filtering", FeatureCategory::VulkanWorkarounds, - "Force nearest filtering when sampling.", &members}; + FeatureInfo forceTextureLodOffset4 = { + "force_texture_lod_offset_4", + FeatureCategory::VulkanWorkarounds, + "Increase the minimum texture level-of-detail by 4 when sampling.", + &members, + }; - // Translate non-nearest mip filtering modes to nearest mip for all samplers for performance - // comparisons. ANGLE is non-conformant if this feature is enabled. - Feature forceNearestMipFiltering = {"forceNearestMipFiltering", - FeatureCategory::VulkanWorkarounds, - "Force nearest mip filtering when sampling.", &members}; + FeatureInfo forceNearestFiltering = { + "force_nearest_filtering", + FeatureCategory::VulkanWorkarounds, + "Force nearest filtering when sampling.", + &members, + }; - // Compress float32 vertices in static buffers to float16 at draw time. ANGLE is non-conformant - // if this feature is enabled. - angle::Feature compressVertexData = {"compress_vertex_data", - angle::FeatureCategory::VulkanWorkarounds, - "Compress vertex data to smaller data types when " - "possible. Using this feature makes ANGLE non-conformant.", - &members}; + FeatureInfo forceNearestMipFiltering = { + "forceNearestMipFiltering", + FeatureCategory::VulkanWorkarounds, + "Force nearest mip filtering when sampling.", + &members, + }; - // Qualcomm missynchronizes vkCmdClearAttachments in the middle of render pass. - // https://issuetracker.google.com/166809097 - Feature preferDrawClearOverVkCmdClearAttachments = { + FeatureInfo compressVertexData = { + "compress_vertex_data", + FeatureCategory::VulkanWorkarounds, + "Compress vertex data to smaller data types when " + "possible. Using this feature makes ANGLE non-conformant.", + &members, + }; + + FeatureInfo preferDrawClearOverVkCmdClearAttachments = { "preferDrawClearOverVkCmdClearAttachments", FeatureCategory::VulkanWorkarounds, "On some hardware, clear using a draw call instead of vkCmdClearAttachments in the middle " "of render pass due to bugs", &members, "https://issuetracker.google.com/166809097"}; - // Whether prerotation is being emulated for testing. 90 degree rotation. - Feature emulatedPrerotation90 = {"emulatedPrerotation90", FeatureCategory::VulkanFeatures, - "Emulate 90-degree prerotation.", &members, - "http://anglebug.com/4901"}; + FeatureInfo emulatedPrerotation90 = {"emulatedPrerotation90", FeatureCategory::VulkanFeatures, + "Emulate 90-degree prerotation.", &members, + "http://anglebug.com/4901"}; + + FeatureInfo emulatedPrerotation180 = {"emulatedPrerotation180", FeatureCategory::VulkanFeatures, + "Emulate 180-degree prerotation.", &members, + "http://anglebug.com/4901"}; - // Whether prerotation is being emulated for testing. 180 degree rotation. - Feature emulatedPrerotation180 = {"emulatedPrerotation180", FeatureCategory::VulkanFeatures, - "Emulate 180-degree prerotation.", &members, - "http://anglebug.com/4901"}; + FeatureInfo emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures, + "Emulate 270-degree prerotation.", &members, + "http://anglebug.com/4901"}; - // Whether prerotation is being emulated for testing. 270 degree rotation. - Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures, - "Emulate 270-degree prerotation.", &members, - "http://anglebug.com/4901"}; + FeatureInfo generateSPIRVThroughGlslang = { + "generateSPIRVThroughGlslang", FeatureCategory::VulkanFeatures, + "Translate SPIR-V through glslang.", &members, "http://anglebug.com/4889"}; - // Whether we should use driver uniforms over specialization constants for some shader - // modifications like yflip and rotation. - Feature forceDriverUniformOverSpecConst = { + FeatureInfo forceDriverUniformOverSpecConst = { "forceDriverUniformOverSpecConst", FeatureCategory::VulkanWorkarounds, "Forces using driver uniforms instead of specialization constants.", &members, "http://issuetracker.google.com/173636783"}; - // Whether non-conformant configurations and extensions should be exposed. When an extension is - // in development, or a GLES version is not supported on a device, we may still want to expose - // them for partial testing. This feature is enabled by our test harness. - Feature exposeNonConformantExtensionsAndVersions = { + FeatureInfo exposeNonConformantExtensionsAndVersions = { "exposeNonConformantExtensionsAndVersions", FeatureCategory::VulkanWorkarounds, "Expose GLES versions and extensions that are not conformant.", &members, "http://anglebug.com/5375"}; - // imageAtomicExchange is expected to work for r32f formats, but support for atomic operations - // for VK_FORMAT_R32_SFLOAT is rare. This support is emulated by using an r32ui format for such - // images instead. - Feature emulateR32fImageAtomicExchange = { + FeatureInfo emulateR32fImageAtomicExchange = { "emulateR32fImageAtomicExchange", FeatureCategory::VulkanWorkarounds, "Emulate r32f images with r32ui to support imageAtomicExchange.", &members, "http://anglebug.com/5535"}; - Feature supportsNegativeViewport = { - "supportsNegativeViewport", FeatureCategory::VulkanFeatures, - "The driver supports inverting the viewport with a negative height.", &members}; + FeatureInfo supportsNegativeViewport = { + "supportsNegativeViewport", + FeatureCategory::VulkanFeatures, + "The driver supports inverting the viewport with a negative height.", + &members, + }; - // Whether we should force any highp precision in the fragment shader to mediump. - // ANGLE is non-conformant if this feature is enabled. - Feature forceFragmentShaderPrecisionHighpToMediump = { + FeatureInfo forceFragmentShaderPrecisionHighpToMediump = { "forceFragmentShaderPrecisionHighpToMediump", FeatureCategory::VulkanWorkarounds, "Forces highp precision in fragment shader to mediump.", &members, "https://issuetracker.google.com/184850002"}; - // Whether we should submit at each FBO boundary. - Feature preferSubmitAtFBOBoundary = { + FeatureInfo preferSubmitAtFBOBoundary = { "preferSubmitAtFBOBoundary", FeatureCategory::VulkanWorkarounds, "Submit commands to driver at each FBO boundary for performance improvements.", &members, "https://issuetracker.google.com/187425444"}; + + FeatureInfo useMultipleDescriptorsForExternalFormats = { + "useMultipleDescriptorsForExternalFormats", FeatureCategory::VulkanWorkarounds, + "Return a default descriptor count for external formats.", &members, + "http://anglebug.com/6141"}; + + FeatureInfo supportsProtectedMemory = { + "supportsProtectedMemory", FeatureCategory::VulkanFeatures, + "VkDevice supports protected memory", &members, "http://anglebug.com/3965"}; + + FeatureInfo supportsHostQueryReset = {"supportsHostQueryReset", FeatureCategory::VulkanFeatures, + "VkDevice supports VK_EXT_host_query_reset extension", + &members, "http://anglebug.com/6692"}; + + FeatureInfo supportsSurfaceCapabilities2Extension = { + "supportsSurfaceCapabilities2Extension", + FeatureCategory::VulkanFeatures, + "VkInstance supports the VK_KHR_get_surface_capabilities2 extension", + &members, + }; + + FeatureInfo supportsSurfaceProtectedCapabilitiesExtension = { + "supportsSurfaceProtectedCapabilitiesExtension", + FeatureCategory::VulkanFeatures, + "VkInstance supports the VK_KHR_surface_protected_capabilities extension", + &members, + }; + + FeatureInfo supportsSurfacelessQueryExtension = { + "supportsSurfacelessQueryExtension", + FeatureCategory::VulkanFeatures, + "VkInstance supports the VK_GOOGLE_surfaceless_query extension", + &members, + }; + + FeatureInfo supportsSurfaceProtectedSwapchains = { + "supportsSurfaceProtectedSwapchains", + FeatureCategory::VulkanFeatures, + "VkSurface supportsProtected for protected swapchains", + &members, + }; + + FeatureInfo overrideSurfaceFormatRGB8toRGBA8 = { + "overrideSurfaceFormatRGB8toRGBA8", FeatureCategory::VulkanWorkarounds, + "Override surface format GL_RGB8 to GL_RGBA8", &members, "http://anglebug.com/6651"}; + + FeatureInfo supportsSharedPresentableImageExtension = { + "supportsSharedPresentableImageExtension", + FeatureCategory::VulkanFeatures, + "VkSurface supports the VK_KHR_shared_presentable_images extension", + &members, + }; + + FeatureInfo supportsShaderFramebufferFetch = { + "supportsShaderFramebufferFetch", + FeatureCategory::VulkanFeatures, + "Whether the Vulkan backend supports coherent framebuffer fetch", + &members, + }; + + FeatureInfo supportsShaderFramebufferFetchNonCoherent = { + "supportsShaderFramebufferFetchNonCoherent", + FeatureCategory::VulkanFeatures, + "Whether the Vulkan backend supports non-coherent framebuffer fetch", + &members, + }; + + FeatureInfo supportsLockSurfaceExtension = { + "supportsLockSurfaceExtension", + FeatureCategory::VulkanFeatures, + "Surface supports the EGL_KHR_lock_surface3 extension", + &members, + }; + + FeatureInfo swapbuffersOnFlushOrFinishWithSingleBuffer = { + "swapbuffersOnFlushOrFinishWithSingleBuffer", FeatureCategory::VulkanFeatures, + "Bypass deferredFlush with calling swapbuffers on flush or finish when in Shared Present " + "mode", + &members, "http://anglebug.com/6878"}; + + FeatureInfo emulateDithering = {"emulateDithering", FeatureCategory::VulkanFeatures, + "Emulate OpenGL dithering", &members, + "http://anglebug.com/6755"}; + + FeatureInfo emulateAdvancedBlendEquations = { + "emulateAdvancedBlendEquations", FeatureCategory::VulkanFeatures, + "Emulate GL_KHR_blend_equation_advanced", &members, "http://anglebug.com/3586"}; + + FeatureInfo bottomLeftOriginPresentRegionRectangles = { + "bottomLeftOriginPresentRegionRectangles", + FeatureCategory::VulkanWorkarounds, + "On some platforms present region rectangles are expected to have a bottom-left origin, " + "instead of top-left origin as from spec", + &members, + }; + + FeatureInfo forceSubmitImmutableTextureUpdates = { + "forceSubmitImmutableTextureUpdates", FeatureCategory::VulkanAppWorkarounds, + "Force submit updates to immutable textures", &members, "http://anglebug.com/6929"}; + + FeatureInfo retainSpirvDebugInfo = {"retainSpirvDebugInfo", FeatureCategory::VulkanFeatures, + "Retain debug info in SPIR-V blob.", &members, + "http://anglebug.com/5901"}; + + FeatureInfo createPipelineDuringLink = { + "createPipelineDuringLink", FeatureCategory::VulkanFeatures, + "Create pipeline with default state during glLinkProgram", &members, + "http://anglebug.com/7046"}; }; inline FeaturesVk::FeaturesVk() = default; inline FeaturesVk::~FeaturesVk() = default; diff --git a/gfx/angle/checkout/include/platform/FrontendFeatures.h b/gfx/angle/checkout/include/platform/FrontendFeatures.h --- a/gfx/angle/checkout/include/platform/FrontendFeatures.h +++ b/gfx/angle/checkout/include/platform/FrontendFeatures.h @@ -1,7 +1,9 @@ +// GENERATED FILE - DO NOT EDIT. +// Generated by gen_features.py using data from frontend_features.json. // -// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Copyright 2022 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. // // FrontendFeatures.h: Features/workarounds for driver bugs and other behaviors seen @@ -13,71 +15,75 @@ #include "platform/Feature.h" namespace angle { -struct FrontendFeatures : angle::FeatureSetBase +struct FrontendFeatures : FeatureSetBase { FrontendFeatures(); ~FrontendFeatures(); - // Force the context to be lost (via KHR_robustness) if a GL_OUT_OF_MEMORY error occurs. The - // driver may be in an inconsistent state if this happens, and some users of ANGLE rely on this - // notification to prevent further execution. - angle::Feature loseContextOnOutOfMemory = { - "lose_context_on_out_of_memory", angle::FeatureCategory::FrontendWorkarounds, - "Some users rely on a lost context notification if a GL_OUT_OF_MEMORY " - "error occurs", - &members}; + FeatureInfo loseContextOnOutOfMemory = { + "lose_context_on_out_of_memory", + FeatureCategory::FrontendWorkarounds, + "Some users rely on a lost context notification if a GL_OUT_OF_MEMORY error occurs", + &members, + }; - // Program binaries don't contain transform feedback varyings on Qualcomm GPUs. - // Work around this by disabling the program cache for programs with transform feedback. - angle::Feature disableProgramCachingForTransformFeedback = { + FeatureInfo disableProgramCachingForTransformFeedback = { "disable_program_caching_for_transform_feedback", - angle::FeatureCategory::FrontendWorkarounds, - "On some GPUs, program binaries don't contain transform feedback varyings", &members}; + FeatureCategory::FrontendWorkarounds, + "On some GPUs, program binaries don't contain transform feedback varyings", + &members, + }; - // On Windows Intel OpenGL drivers TexImage sometimes seems to interact with the Framebuffer. - // Flaky crashes can occur unless we sync the Framebuffer bindings. The workaround is to add - // Framebuffer binding dirty bits to TexImage updates. See http://anglebug.com/2906 - angle::Feature syncFramebufferBindingsOnTexImage = { - "sync_framebuffer_bindings_on_tex_image", angle::FeatureCategory::FrontendWorkarounds, - "On some drivers TexImage sometimes seems to interact " - "with the Framebuffer", - &members}; - - angle::Feature scalarizeVecAndMatConstructorArgs = { - "scalarize_vec_and_mat_constructor_args", angle::FeatureCategory::FrontendWorkarounds, + FeatureInfo scalarizeVecAndMatConstructorArgs = { + "scalarize_vec_and_mat_constructor_args", FeatureCategory::FrontendWorkarounds, "Always rewrite vec/mat constructors to be consistent", &members, "http://crbug.com/1165751"}; - // Disable support for GL_OES_get_program_binary - angle::Feature disableProgramBinary = { - "disable_program_binary", angle::FeatureCategory::FrontendFeatures, - "Disable support for GL_OES_get_program_binary", &members, "http://anglebug.com/5007"}; + FeatureInfo disableProgramBinary = {"disable_program_binary", FeatureCategory::FrontendFeatures, + "Disable support for GL_OES_get_program_binary", &members, + "http://anglebug.com/5007"}; - // Allow disabling of GL_EXT_texture_filter_anisotropic through a runtime feature for - // performance comparisons. - angle::Feature disableAnisotropicFiltering = { - "disable_anisotropic_filtering", angle::FeatureCategory::FrontendWorkarounds, - "Disable support for anisotropic filtering", &members}; + FeatureInfo disableAnisotropicFiltering = { + "disable_anisotropic_filtering", + FeatureCategory::FrontendWorkarounds, + "Disable support for anisotropic filtering", + &members, + }; + + FeatureInfo allowCompressedFormats = { + "allow_compressed_formats", + FeatureCategory::FrontendWorkarounds, + "Allow compressed formats", + &members, + }; - // We can use this feature to override compressed format support for portability. - angle::Feature allowCompressedFormats = {"allow_compressed_formats", - angle::FeatureCategory::FrontendWorkarounds, - "Allow compressed formats", &members}; + FeatureInfo captureLimits = {"enable_capture_limits", FeatureCategory::FrontendFeatures, + "Set the context limits like frame capturing was enabled", + &members, "http://anglebug.com/5750"}; + + FeatureInfo enableCompressingPipelineCacheInThreadPool = { + "enableCompressingPipelineCacheInThreadPool", FeatureCategory::FrontendWorkarounds, + "Enable compressing pipeline cache in thread pool.", &members, "http://anglebug.com/4722"}; + + FeatureInfo forceRobustResourceInit = { + "forceRobustResourceInit", FeatureCategory::FrontendFeatures, + "Force-enable robust resource init", &members, "http://anglebug.com/6041"}; - angle::Feature captureLimits = {"enable_capture_limits", - angle::FeatureCategory::FrontendFeatures, - "Set the context limits like frame capturing was enabled", - &members, "http://anglebug.com/5750"}; + FeatureInfo forceInitShaderVariables = { + "forceInitShaderVariables", + FeatureCategory::FrontendFeatures, + "Force-enable shader variable initialization", + &members, + }; - // Whether we should compress pipeline cache in thread pool before it's stored in blob cache. - // http://anglebug.com/4722 - angle::Feature enableCompressingPipelineCacheInThreadPool = { - "enableCompressingPipelineCacheInThreadPool", angle::FeatureCategory::FrontendWorkarounds, - "Enable compressing pipeline cache in thread pool.", &members, "http://anglebug.com/4722"}; + FeatureInfo enableProgramBinaryForCapture = { + "enableProgramBinaryForCapture", FeatureCategory::FrontendFeatures, + "Even if FrameCapture is enabled, enable GL_OES_get_program_binary", &members, + "http://anglebug.com/5658"}; }; inline FrontendFeatures::FrontendFeatures() = default; inline FrontendFeatures::~FrontendFeatures() = default; diff --git a/gfx/angle/checkout/include/platform/PlatformMethods.h b/gfx/angle/checkout/include/platform/PlatformMethods.h --- a/gfx/angle/checkout/include/platform/PlatformMethods.h +++ b/gfx/angle/checkout/include/platform/PlatformMethods.h @@ -11,11 +11,11 @@ #include #include #include -#define EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX 0x3482 +#define EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX 0x6AFB #if !defined(ANGLE_PLATFORM_EXPORT) # if defined(_WIN32) # if !defined(LIBANGLE_IMPLEMENTATION) # define ANGLE_PLATFORM_EXPORT __declspec(dllimport) @@ -215,27 +215,10 @@ inline void DefaultHistogramSparse(PlatformMethods *platform, const char *name, int sample) {} // Boolean histograms track two-state variables. using HistogramBooleanFunc = void (*)(PlatformMethods *platform, const char *name, bool sample); inline void DefaultHistogramBoolean(PlatformMethods *platform, const char *name, bool sample) {} -// Allows us to programatically override ANGLE's default workarounds for testing purposes. -using OverrideWorkaroundsD3DFunc = void (*)(PlatformMethods *platform, - angle::FeaturesD3D *featuresD3D); -inline void DefaultOverrideWorkaroundsD3D(PlatformMethods *platform, - angle::FeaturesD3D *featuresD3D) -{} - -using OverrideFeaturesVkFunc = void (*)(PlatformMethods *platform, - angle::FeaturesVk *featuresVulkan); -inline void DefaultOverrideFeaturesVk(PlatformMethods *platform, angle::FeaturesVk *featuresVulkan) -{} - -using OverrideFeaturesMtlFunc = void (*)(PlatformMethods *platform, - angle::FeaturesMtl *featuresMetal); -inline void DefaultOverrideFeaturesMtl(PlatformMethods *platform, angle::FeaturesMtl *featuresMetal) -{} - // Callback on a successful program link with the program binary. Can be used to store // shaders to disk. Keys are a 160-bit SHA-1 hash. using ProgramKeyType = std::array; using CacheProgramFunc = void (*)(PlatformMethods *platform, const ProgramKeyType &key, @@ -251,10 +234,17 @@ using PostWorkerTaskFunc = void (*)(PlatformMethods *platform, PostWorkerTaskCallback callback, void *userData); constexpr PostWorkerTaskFunc DefaultPostWorkerTask = nullptr; +// Placeholder values where feature override callbacks used to be. They are deprecated in favor of +// EGL_ANGLE_feature_control. The placeholders are there to keep the layout of the PlatformMethods +// constant to support drop-in replacement of ANGLE's .so files in applications built with an older +// header. +using PlaceholderCallbackFunc = void (*)(...); +inline void DefaultPlaceholderCallback(...) {} + // Platform methods are enumerated here once. #define ANGLE_PLATFORM_OP(OP) \ OP(currentTime, CurrentTime) \ OP(monotonicallyIncreasingTime, MonotonicallyIncreasingTime) \ OP(logError, LogError) \ @@ -265,14 +255,14 @@ OP(updateTraceEventDuration, UpdateTraceEventDuration) \ OP(histogramCustomCounts, HistogramCustomCounts) \ OP(histogramEnumeration, HistogramEnumeration) \ OP(histogramSparse, HistogramSparse) \ OP(histogramBoolean, HistogramBoolean) \ - OP(overrideWorkaroundsD3D, OverrideWorkaroundsD3D) \ - OP(overrideFeaturesVk, OverrideFeaturesVk) \ + OP(placeholder1, PlaceholderCallback) \ + OP(placeholder2, PlaceholderCallback) \ OP(cacheProgram, CacheProgram) \ - OP(overrideFeaturesMtl, OverrideFeaturesMtl) \ + OP(placeholder3, PlaceholderCallback) \ OP(postWorkerTask, PostWorkerTask) #define ANGLE_PLATFORM_METHOD_DEF(Name, CapsName) CapsName##Func Name = Default##CapsName; struct ANGLE_PLATFORM_EXPORT PlatformMethods @@ -292,10 +282,15 @@ #undef ANGLE_PLATFORM_METHOD_DEF // Subtract one to account for the context pointer. constexpr unsigned int g_NumPlatformMethods = (sizeof(PlatformMethods) / sizeof(uintptr_t)) - 1; +// No further uses of platform methods is allowed. EGL extensions should be used instead. While +// methods are being removed, use PlaceholderCallback to keep the layout of PlatformMethods +// constant. +static_assert(g_NumPlatformMethods == 17, "Avoid adding methods to PlatformMethods"); + #define ANGLE_PLATFORM_METHOD_STRING(Name) #Name #define ANGLE_PLATFORM_METHOD_STRING2(Name, CapsName) ANGLE_PLATFORM_METHOD_STRING(Name), constexpr const char *const g_PlatformMethodNames[g_NumPlatformMethods] = { ANGLE_PLATFORM_OP(ANGLE_PLATFORM_METHOD_STRING2)}; diff --git a/gfx/angle/checkout/include/vulkan/vulkan_fuchsia_ext.h b/gfx/angle/checkout/include/vulkan/vulkan_fuchsia_ext.h --- a/gfx/angle/checkout/include/vulkan/vulkan_fuchsia_ext.h +++ b/gfx/angle/checkout/include/vulkan/vulkan_fuchsia_ext.h @@ -2,12 +2,12 @@ // Copyright 2019 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. // // vulkan_fuchsia_ext: -// Defines Fuchsia-specific Vulkan extensions that haven't been -// upstreamed to the official Vulkan headers. +// Defines Fuchsia-specific Vulkan extensions when compiling on other +// platforms. // #ifndef COMMON_VULKAN_FUCHSIA_EXT_H_ #define COMMON_VULKAN_FUCHSIA_EXT_H_ @@ -15,135 +15,17 @@ # define VK_NO_PROTOTYPES #endif #include -#if defined(ANGLE_PLATFORM_FUCHSIA) -# include -#else +// If this is not Fuchsia then define Fuchsia-specific types explicitly and include +// vulkan_fuchsia.h to make it possible to compile the code on other platforms. +// +// TODO(https://anglebug.com/6040): Update all code to avoid dependencies on +// Fuchsia-specific types when compiling on other platforms. Then remove this header. +#if !defined(ANGLE_PLATFORM_FUCHSIA) typedef uint32_t zx_handle_t; # define ZX_HANDLE_INVALID ((zx_handle_t)0) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -const VkStructureType VK_STRUCTURE_TYPE_TEMP_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA = - static_cast(1001005000); -const VkStructureType VK_STRUCTURE_TYPE_TEMP_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA = - static_cast(1001005001); -const VkStructureType VK_STRUCTURE_TYPE_TEMP_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA = - static_cast(1001005002); -const VkStructureType VK_STRUCTURE_TYPE_TEMP_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA = - static_cast(1001006000); -const VkStructureType VK_STRUCTURE_TYPE_TEMP_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA = - static_cast(1001006001); - -const VkExternalMemoryHandleTypeFlagBits - VK_EXTERNAL_MEMORY_HANDLE_TYPE_TEMP_ZIRCON_VMO_BIT_FUCHSIA = - static_cast(0x00100000); - -const VkExternalSemaphoreHandleTypeFlagBits - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA = - static_cast(0x00100000); - -#ifndef VK_FUCHSIA_external_memory -# define VK_FUCHSIA_external_memory 1 -# define VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION 1 -# define VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME "VK_FUCHSIA_external_memory" - -typedef struct VkImportMemoryZirconHandleInfoFUCHSIA -{ - VkStructureType sType; - const void *pNext; - VkExternalMemoryHandleTypeFlagBits handleType; - zx_handle_t handle; -} VkImportMemoryZirconHandleInfoFUCHSIA; - -typedef struct VkMemoryZirconHandlePropertiesFUCHSIA -{ - VkStructureType sType; - void *pNext; - zx_handle_t memoryTypeBits; -} VkMemoryZirconHandlePropertiesFUCHSIA; - -typedef struct VkMemoryGetZirconHandleInfoFUCHSIA -{ - VkStructureType sType; - const void *pNext; - VkDeviceMemory memory; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkMemoryGetZirconHandleInfoFUCHSIA; - -typedef VkResult(VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)( - VkDevice device, - const VkMemoryGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo, - zx_handle_t *pZirconHandle); -typedef VkResult(VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)( - VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t ZirconHandle, - VkMemoryZirconHandlePropertiesFUCHSIA *pMemoryZirconHandleProperties); - -# ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL -vkGetMemoryZirconHandleFUCHSIA(VkDevice device, - const VkMemoryGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo, - zx_handle_t *pZirconHandle); - -VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA( - VkDevice device, - VkExternalMemoryHandleTypeFlagBits handleType, - zx_handle_t ZirconHandle, - VkMemoryZirconHandlePropertiesFUCHSIA *pMemoryZirconHandleProperties); -# endif -#endif - -#ifndef VK_FUCHSIA_external_semaphore -# define VK_FUCHSIA_external_semaphore 1 -# define VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION 1 -# define VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_FUCHSIA_external_semaphore" - -typedef struct VkImportSemaphoreZirconHandleInfoFUCHSIA -{ - VkStructureType sType; - const void *pNext; - VkSemaphore semaphore; - VkSemaphoreImportFlags flags; - VkExternalSemaphoreHandleTypeFlagBits handleType; - zx_handle_t zirconHandle; -} VkImportSemaphoreZirconHandleInfoFUCHSIA; - -typedef struct VkSemaphoreGetZirconHandleInfoFUCHSIA -{ - VkStructureType sType; - const void *pNext; - VkSemaphore semaphore; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkSemaphoreGetZirconHandleInfoFUCHSIA; - -typedef VkResult(VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)( - VkDevice device, - const VkImportSemaphoreZirconHandleInfoFUCHSIA *pImportSemaphoreZirconHandleInfo); -typedef VkResult(VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)( - VkDevice device, - const VkSemaphoreGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo, - zx_handle_t *pZirconHandle); - -# ifndef VK_NO_PROTOTYPES -VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA( - VkDevice device, - const VkImportSemaphoreZirconHandleInfoFUCHSIA *pImportSemaphoreZirconHandleInfo); - -VKAPI_ATTR VkResult VKAPI_CALL -vkGetSemaphoreZirconHandleFUCHSIA(VkDevice device, - const VkSemaphoreGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo, - zx_handle_t *pZirconHandle); -# endif -#endif - -#ifdef __cplusplus -} +# include #endif #endif // COMMON_VULKAN_FUCHSIA_EXT_H_ diff --git a/gfx/angle/checkout/out/gen/angle/angle_commit.h b/gfx/angle/checkout/out/gen/angle/angle_commit.h --- a/gfx/angle/checkout/out/gen/angle/angle_commit.h +++ b/gfx/angle/checkout/out/gen/angle/angle_commit.h @@ -1,4 +1,4 @@ -#define ANGLE_COMMIT_HASH "23851a53779d" +#define ANGLE_COMMIT_HASH "f2280c0c5f93" #define ANGLE_COMMIT_HASH_SIZE 12 -#define ANGLE_COMMIT_DATE "2021-09-14 18:27:26 -0700" -#define ANGLE_COMMIT_POSITION 15727 +#define ANGLE_COMMIT_DATE "2022-05-02 17:51:51 +0000" +#define ANGLE_COMMIT_POSITION 18358 diff --git a/gfx/angle/checkout/src/common/CircularBuffer.h b/gfx/angle/checkout/src/common/CircularBuffer.h new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/CircularBuffer.h @@ -0,0 +1,175 @@ +// +// Copyright 2021 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. +// +// CircularBuffer.h: +// An array class with an index that loops through the elements. +// + +#ifndef COMMON_CIRCULARBUFFER_H_ +#define COMMON_CIRCULARBUFFER_H_ + +#include "common/debug.h" + +#include +#include + +namespace angle +{ +template > +class CircularBuffer final +{ + public: + using value_type = typename Storage::value_type; + using size_type = typename Storage::size_type; + using reference = typename Storage::reference; + using const_reference = typename Storage::const_reference; + using pointer = typename Storage::pointer; + using const_pointer = typename Storage::const_pointer; + using iterator = typename Storage::iterator; + using const_iterator = typename Storage::const_iterator; + + CircularBuffer(); + CircularBuffer(const value_type &value); + + CircularBuffer(const CircularBuffer &other); + CircularBuffer(CircularBuffer &&other); + + CircularBuffer &operator=(const CircularBuffer &other); + CircularBuffer &operator=(CircularBuffer &&other); + + ~CircularBuffer(); + + // begin() and end() are used to iterate over all elements regardless of the current position of + // the front of the buffer. Useful for initialization and clean up, as otherwise only the front + // element is expected to be accessed. + iterator begin(); + const_iterator begin() const; + + iterator end(); + const_iterator end() const; + + size_type size() const; + + reference front(); + const_reference front() const; + + void swap(CircularBuffer &other); + + // Move the front forward to the next index, looping back to the beginning if the end of the + // array is reached. + void next(); + + private: + Storage mData; + size_type mFrontIndex; +}; + +template +CircularBuffer::CircularBuffer() : mFrontIndex(0) +{} + +template +CircularBuffer::CircularBuffer(const value_type &value) : CircularBuffer() +{ + std::fill(begin(), end(), value); +} + +template +CircularBuffer::CircularBuffer(const CircularBuffer &other) +{ + *this = other; +} + +template +CircularBuffer::CircularBuffer(CircularBuffer &&other) + : CircularBuffer() +{ + swap(other); +} + +template +CircularBuffer &CircularBuffer::operator=( + const CircularBuffer &other) +{ + std::copy(other.begin(), other.end(), begin()); + mFrontIndex = other.mFrontIndex; + return *this; +} + +template +CircularBuffer &CircularBuffer::operator=( + CircularBuffer &&other) +{ + swap(other); + return *this; +} + +template +CircularBuffer::~CircularBuffer() = default; + +template +ANGLE_INLINE typename CircularBuffer::iterator CircularBuffer::begin() +{ + return mData.begin(); +} + +template +ANGLE_INLINE typename CircularBuffer::const_iterator +CircularBuffer::begin() const +{ + return mData.begin(); +} + +template +ANGLE_INLINE typename CircularBuffer::iterator CircularBuffer::end() +{ + return mData.end(); +} + +template +ANGLE_INLINE typename CircularBuffer::const_iterator +CircularBuffer::end() const +{ + return mData.end(); +} + +template +ANGLE_INLINE typename CircularBuffer::size_type CircularBuffer::size() + const +{ + return N; +} + +template +ANGLE_INLINE typename CircularBuffer::reference +CircularBuffer::front() +{ + ASSERT(mFrontIndex < size()); + return mData[mFrontIndex]; +} + +template +ANGLE_INLINE typename CircularBuffer::const_reference +CircularBuffer::front() const +{ + ASSERT(mFrontIndex < size()); + return mData[mFrontIndex]; +} + +template +void CircularBuffer::swap(CircularBuffer &other) +{ + std::swap(mData, other.mData); + std::swap(mFrontIndex, other.mFrontIndex); +} + +template +void CircularBuffer::next() +{ + mFrontIndex = (mFrontIndex + 1) % size(); +} +} // namespace angle + +#endif // COMMON_CIRCULARBUFFER_H_ diff --git a/gfx/angle/checkout/src/common/FastVector.h b/gfx/angle/checkout/src/common/FastVector.h --- a/gfx/angle/checkout/src/common/FastVector.h +++ b/gfx/angle/checkout/src/common/FastVector.h @@ -39,10 +39,13 @@ FastVector(const FastVector &other); FastVector(FastVector &&other); FastVector(std::initializer_list init); + template ::value, bool> = true> + FastVector(InputIt first, InputIt last); + FastVector &operator=(const FastVector &other); FastVector &operator=(FastVector &&other); FastVector &operator=(std::initializer_list init); ~FastVector(); @@ -137,15 +140,12 @@ mSize = count; } template FastVector::FastVector(const FastVector &other) -{ - ensure_capacity(other.mSize); - mSize = other.mSize; - std::copy(other.begin(), other.end(), begin()); -} + : FastVector(other.begin(), other.end()) +{} template FastVector::FastVector(FastVector &&other) : FastVector() { swap(other); @@ -156,10 +156,20 @@ { assign_from_initializer_list(init); } template +template ::value, bool>> +FastVector::FastVector(InputIt first, InputIt last) +{ + size_t newSize = last - first; + ensure_capacity(newSize); + mSize = newSize; + std::copy(first, last, begin()); +} + +template FastVector &FastVector::operator=( const FastVector &other) { ensure_capacity(other.mSize); mSize = other.mSize; @@ -168,11 +178,11 @@ } template FastVector &FastVector::operator=(FastVector &&other) { - swap(*this, other); + swap(other); return *this; } template FastVector &FastVector::operator=( @@ -437,17 +447,17 @@ mReservedSize = newSize; } } template -class FastUnorderedMap final +class FlatUnorderedMap final { public: using Pair = std::pair; - FastUnorderedMap() {} - ~FastUnorderedMap() {} + FlatUnorderedMap() {} + ~FlatUnorderedMap() {} void insert(Key key, Value value) { ASSERT(!contains(key)); mData.push_back(Pair(key, value)); @@ -485,15 +495,15 @@ private: FastVector mData; }; template -class FastUnorderedSet final +class FlatUnorderedSet final { public: - FastUnorderedSet() {} - ~FastUnorderedSet() {} + FlatUnorderedSet() {} + ~FlatUnorderedSet() {} bool empty() const { return mData.empty(); } void insert(T value) { diff --git a/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h --- a/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h +++ b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h @@ -22,10 +22,24 @@ { template Enum FromEGLenum(EGLenum from); +enum class ColorSpace : uint8_t +{ + sRGB = 0, + Linear = 1, + + InvalidEnum = 2, + EnumCount = 2, +}; + +template <> +ColorSpace FromEGLenum(EGLenum from); +EGLenum ToEGLenum(ColorSpace from); +std::ostream &operator<<(std::ostream &os, ColorSpace value); + enum class CompositorTiming : uint8_t { CompositeDeadline = 0, CompositInterval = 1, CompositToPresentLatency = 2, diff --git a/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp --- a/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp +++ b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp @@ -14,10 +14,55 @@ namespace egl { template <> +ColorSpace FromEGLenum(EGLenum from) +{ + switch (from) + { + case EGL_COLORSPACE_sRGB: + return ColorSpace::sRGB; + case EGL_COLORSPACE_LINEAR: + return ColorSpace::Linear; + default: + return ColorSpace::InvalidEnum; + } +} + +EGLenum ToEGLenum(ColorSpace from) +{ + switch (from) + { + case ColorSpace::sRGB: + return EGL_COLORSPACE_sRGB; + case ColorSpace::Linear: + return EGL_COLORSPACE_LINEAR; + default: + UNREACHABLE(); + return 0; + } +} + +std::ostream &operator<<(std::ostream &os, ColorSpace value) +{ + switch (value) + { + case ColorSpace::sRGB: + os << "EGL_COLORSPACE_sRGB"; + break; + case ColorSpace::Linear: + os << "EGL_COLORSPACE_LINEAR"; + break; + default: + os << "GL_INVALID_ENUM"; + break; + } + return os; +} + +template <> CompositorTiming FromEGLenum(EGLenum from) { switch (from) { case EGL_COMPOSITE_DEADLINE_ANDROID: diff --git a/gfx/angle/checkout/src/common/PackedEnums.h b/gfx/angle/checkout/src/common/PackedEnums.h --- a/gfx/angle/checkout/src/common/PackedEnums.h +++ b/gfx/angle/checkout/src/common/PackedEnums.h @@ -339,34 +339,98 @@ Min = 1, // GLenum == 0x8007 Max = 2, // GLenum == 0x8008 Unused = 3, Subtract = 4, // GLenum == 0x800A ReverseSubtract = 5, // GLenum == 0x800B - InvalidEnum = 6, - EnumCount = 6 + + Multiply = 6, // GLenum == 0x9294 + Screen = 7, // GLenum == 0x9295 + Overlay = 8, // GLenum == 0x9296 + Darken = 9, // GLenum == 0x9297 + Lighten = 10, // GLenum == 0x9298 + Colordodge = 11, // GLenum == 0x9299 + Colorburn = 12, // GLenum == 0x929A + Hardlight = 13, // GLenum == 0x929B + Softlight = 14, // GLenum == 0x929C + Unused2 = 15, + Difference = 16, // GLenum == 0x929E + Unused3 = 17, + Exclusion = 18, // GLenum == 0x92A0 + + HslHue = 19, // GLenum == 0x92AD + HslSaturation = 20, // GLenum == 0x92AE + HslColor = 21, // GLenum == 0x92AF + HslLuminosity = 22, // GLenum == 0x92B0 + + InvalidEnum = 23, + EnumCount = InvalidEnum }; +using BlendEquationBitSet = angle::PackedEnumBitSet; + template <> constexpr BlendEquationType FromGLenum(GLenum from) { - const GLenum scaled = (from - GL_FUNC_ADD); - return (scaled == static_cast(BlendEquationType::Unused) || - scaled >= static_cast(BlendEquationType::EnumCount)) - ? BlendEquationType::InvalidEnum - : static_cast(scaled); + if (from <= GL_FUNC_REVERSE_SUBTRACT) + { + const GLenum scaled = (from - GL_FUNC_ADD); + return (scaled == static_cast(BlendEquationType::Unused)) + ? BlendEquationType::InvalidEnum + : static_cast(scaled); + } + if (from <= GL_EXCLUSION_KHR) + { + const GLenum scaled = + (from - GL_MULTIPLY_KHR + static_cast(BlendEquationType::Multiply)); + return (scaled == static_cast(BlendEquationType::Unused2) || + scaled == static_cast(BlendEquationType::Unused3)) + ? BlendEquationType::InvalidEnum + : static_cast(scaled); + } + if (from <= GL_HSL_LUMINOSITY_KHR) + { + return static_cast(from - GL_HSL_HUE_KHR + + static_cast(BlendEquationType::HslHue)); + } + return BlendEquationType::InvalidEnum; } constexpr GLenum ToGLenum(BlendEquationType from) { - return static_cast(from) + GL_FUNC_ADD; + if (from <= BlendEquationType::ReverseSubtract) + { + return static_cast(from) + GL_FUNC_ADD; + } + if (from <= BlendEquationType::Exclusion) + { + return static_cast(from) - static_cast(BlendEquationType::Multiply) + + GL_MULTIPLY_KHR; + } + return static_cast(from) - static_cast(BlendEquationType::HslHue) + + GL_HSL_HUE_KHR; } ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Add, GL_FUNC_ADD); ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Min, GL_MIN); ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Max, GL_MAX); ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Subtract, GL_FUNC_SUBTRACT); ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, ReverseSubtract, GL_FUNC_REVERSE_SUBTRACT); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Multiply, GL_MULTIPLY_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Screen, GL_SCREEN_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Overlay, GL_OVERLAY_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Darken, GL_DARKEN_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Lighten, GL_LIGHTEN_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Colordodge, GL_COLORDODGE_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Colorburn, GL_COLORBURN_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Hardlight, GL_HARDLIGHT_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Softlight, GL_SOFTLIGHT_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Difference, GL_DIFFERENCE_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, Exclusion, GL_EXCLUSION_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, HslHue, GL_HSL_HUE_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, HslSaturation, GL_HSL_SATURATION_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, HslColor, GL_HSL_COLOR_KHR); +ANGLE_VALIDATE_PACKED_ENUM(BlendEquationType, HslLuminosity, GL_HSL_LUMINOSITY_KHR); std::ostream &operator<<(std::ostream &os, BlendEquationType value); enum class BlendFactorType { diff --git a/gfx/angle/checkout/src/common/PackedEnums.cpp b/gfx/angle/checkout/src/common/PackedEnums.cpp --- a/gfx/angle/checkout/src/common/PackedEnums.cpp +++ b/gfx/angle/checkout/src/common/PackedEnums.cpp @@ -280,10 +280,13 @@ os << "GL_LINE_STRIP"; break; case PrimitiveMode::LineStripAdjacency: os << "GL_LINE_STRIP_ADJANCENCY"; break; + case PrimitiveMode::Patches: + os << "GL_PATCHES"; + break; case PrimitiveMode::Points: os << "GL_POINTS"; break; case PrimitiveMode::TriangleFan: os << "GL_TRIANGLE_FAN"; @@ -345,10 +348,55 @@ os << "GL_FUNC_SUBTRACT"; break; case BlendEquationType::ReverseSubtract: os << "GL_FUNC_REVERSE_SUBTRACT"; break; + case BlendEquationType::Multiply: + os << "GL_MULTIPLY_KHR"; + break; + case BlendEquationType::Screen: + os << "GL_SCREEN_KHR"; + break; + case BlendEquationType::Overlay: + os << "GL_OVERLAY_KHR"; + break; + case BlendEquationType::Darken: + os << "GL_DARKEN_KHR"; + break; + case BlendEquationType::Lighten: + os << "GL_LIGHTEN_KHR"; + break; + case BlendEquationType::Colordodge: + os << "GL_COLORDODGE_KHR"; + break; + case BlendEquationType::Colorburn: + os << "GL_COLORBURN_KHR"; + break; + case BlendEquationType::Hardlight: + os << "GL_HARDLIGHT_KHR"; + break; + case BlendEquationType::Softlight: + os << "GL_SOFTLIGHT_KHR"; + break; + case BlendEquationType::Difference: + os << "GL_DIFFERENCE_KHR"; + break; + case BlendEquationType::Exclusion: + os << "GL_EXCLUSION_KHR"; + break; + case BlendEquationType::HslHue: + os << "GL_HSL_HUE_KHR"; + break; + case BlendEquationType::HslSaturation: + os << "GL_HSL_SATURATION_KHR"; + break; + case BlendEquationType::HslColor: + os << "GL_HSL_COLOR_KHR"; + break; + case BlendEquationType::HslLuminosity: + os << "GL_HSL_LUMINOSITY_KHR"; + break; default: os << "GL_INVALID_ENUM"; break; } diff --git a/gfx/angle/checkout/src/common/PoolAlloc.h b/gfx/angle/checkout/src/common/PoolAlloc.h --- a/gfx/angle/checkout/src/common/PoolAlloc.h +++ b/gfx/angle/checkout/src/common/PoolAlloc.h @@ -2,12 +2,11 @@ // Copyright 2019 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. // // PoolAlloc.h: -// Defines the class interface for PoolAllocator and the Allocation -// class that it uses internally. +// Defines the class interface for PoolAllocator. // #ifndef COMMON_POOLALLOC_H_ #define COMMON_POOLALLOC_H_ @@ -30,83 +29,17 @@ // // Individual classes can use this allocator by supplying their own // new and delete methods. // -#include -#include -#include -#include - #include "angleutils.h" #include "common/debug.h" namespace angle { -// If we are using guard blocks, we must track each individual -// allocation. If we aren't using guard blocks, these -// never get instantiated, so won't have any impact. -// - -class Allocation -{ - public: - Allocation(size_t size, unsigned char *mem, Allocation *prev = 0) - : mSize(size), mMem(mem), mPrevAlloc(prev) - { -// Allocations are bracketed: -// [allocationHeader][initialGuardBlock][userData][finalGuardBlock] -// This would be cleaner with if (kGuardBlockSize)..., but that -// makes the compiler print warnings about 0 length memsets, -// even with the if() protecting them. -#if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - memset(preGuard(), kGuardBlockBeginVal, kGuardBlockSize); - memset(data(), kUserDataFill, mSize); - memset(postGuard(), kGuardBlockEndVal, kGuardBlockSize); -#endif - } - - void check() const - { - checkGuardBlock(preGuard(), kGuardBlockBeginVal, "before"); - checkGuardBlock(postGuard(), kGuardBlockEndVal, "after"); - } - - void checkAllocList() const; - - // Return total size needed to accommodate user buffer of 'size', - // plus our tracking data. - static size_t AllocationSize(size_t size) { return size + 2 * kGuardBlockSize + HeaderSize(); } - - // Offset from surrounding buffer to get to user data buffer. - static unsigned char *OffsetAllocation(unsigned char *m) - { - return m + kGuardBlockSize + HeaderSize(); - } - - private: - void checkGuardBlock(unsigned char *blockMem, unsigned char val, const char *locText) const; - - // Find offsets to pre and post guard blocks, and user data buffer - unsigned char *preGuard() const { return mMem + HeaderSize(); } - unsigned char *data() const { return preGuard() + kGuardBlockSize; } - unsigned char *postGuard() const { return data() + mSize; } - size_t mSize; // size of the user data area - unsigned char *mMem; // beginning of our allocation (pts to header) - Allocation *mPrevAlloc; // prior allocation in the chain - - static constexpr unsigned char kGuardBlockBeginVal = 0xfb; - static constexpr unsigned char kGuardBlockEndVal = 0xfe; - static constexpr unsigned char kUserDataFill = 0xcd; -#if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - static constexpr size_t kGuardBlockSize = 16; - static constexpr size_t HeaderSize() { return sizeof(Allocation); } -#else - static constexpr size_t kGuardBlockSize = 0; - static constexpr size_t HeaderSize() { return 0; } -#endif -}; +class Allocation; +class PageHeader; // // There are several stacks. One is to track the pushing and popping // of the user, and not yet implemented. The others are simply a // repositories of free pages or used pages. @@ -121,11 +54,11 @@ // pages is likely most optimal. // class PoolAllocator : angle::NonCopyable { public: - static const int kDefaultAlignment = 16; + static const int kDefaultAlignment = sizeof(void *); // // Create PoolAllocator. If alignment is set to 1 byte then fastAllocate() // function can be used to make allocations with less overhead. // PoolAllocator(int growthIncrement = 8 * 1024, int allocationAlignment = kDefaultAlignment); @@ -171,11 +104,11 @@ #if defined(ANGLE_DISABLE_POOL_ALLOC) return reinterpret_cast(allocate(numBytes)); #else ASSERT(mAlignment == 1); // No multi-page allocations - ASSERT(numBytes <= (mPageSize - mHeaderSkip)); + ASSERT(numBytes <= (mPageSize - mPageHeaderSkip)); // // Do the allocation, most likely case inline first, for efficiency. // if (numBytes <= mPageSize - mCurrentPageOffset) { @@ -184,89 +117,56 @@ // uint8_t *memory = reinterpret_cast(mInUseList) + mCurrentPageOffset; mCurrentPageOffset += numBytes; return memory; } - return reinterpret_cast(allocateNewPage(numBytes, numBytes)); + return allocateNewPage(numBytes); #endif } - // - // There is no deallocate. The point of this class is that - // deallocation can be skipped by the user of it, as the model - // of use is to simultaneously deallocate everything at once - // by calling pop(), and to not have to solve memory leak problems. - // + // There is no deallocate. The point of this class is that deallocation can be skipped by the + // user of it, as the model of use is to simultaneously deallocate everything at once by calling + // pop(), and to not have to solve memory leak problems. // Catch unwanted allocations. // TODO(jmadill): Remove this when we remove the global allocator. void lock(); void unlock(); private: size_t mAlignment; // all returned allocations will be aligned at // this granularity, which will be a power of 2 - size_t mAlignmentMask; #if !defined(ANGLE_DISABLE_POOL_ALLOC) - friend struct Header; - - struct Header - { - Header(Header *nextPage, size_t pageCount) - : nextPage(nextPage), - pageCount(pageCount) -# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - , - lastAllocation(0) -# endif - {} - - ~Header() - { -# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - if (lastAllocation) - lastAllocation->checkAllocList(); -# endif - } - - Header *nextPage; - size_t pageCount; -# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - Allocation *lastAllocation; -# endif - }; - struct AllocState { size_t offset; - Header *page; + PageHeader *page; }; using AllocStack = std::vector; // Slow path of allocation when we have to get a new page. - void *allocateNewPage(size_t numBytes, size_t allocationSize); + uint8_t *allocateNewPage(size_t numBytes); // Track allocations if and only if we're using guard blocks - void *initializeAllocation(Header *block, unsigned char *memory, size_t numBytes) - { -# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - new (memory) Allocation(numBytes + mAlignment, memory, block->lastAllocation); - block->lastAllocation = reinterpret_cast(memory); -# endif - // The OffsetAllocation() call is optimized away if !defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) - void *unalignedPtr = Allocation::OffsetAllocation(memory); - size_t alignedBytes = numBytes + mAlignment; - return std::align(mAlignment, numBytes, unalignedPtr, alignedBytes); - } + void *initializeAllocation(uint8_t *memory, size_t numBytes); - size_t mPageSize; // granularity of allocation from the OS - size_t mHeaderSkip; // amount of memory to skip to make room for the - // header (basically, size of header, rounded - // up to make it aligned - size_t mCurrentPageOffset; // next offset in top of inUseList to allocate from - Header *mFreeList; // list of popped memory - Header *mInUseList; // list of all memory currently being used - AllocStack mStack; // stack of where to allocate from, to partition pool + // Granularity of allocation from the OS + size_t mPageSize; + // Amount of memory to skip to make room for the page header (which is the size of the page + // header, or PageHeader in PoolAlloc.cpp) + size_t mPageHeaderSkip; + // Next offset in top of inUseList to allocate from. This offset is not necessarily aligned to + // anything. When an allocation is made, the data is aligned to mAlignment, and the header (if + // any) will align to pointer size by extension (since mAlignment is made aligned to at least + // pointer size). + size_t mCurrentPageOffset; + // List of popped memory + PageHeader *mFreeList; + // List of all memory currently being used. The head of this list is where allocations are + // currently being made from. + PageHeader *mInUseList; + // Stack of where to allocate from, to partition pool + AllocStack mStack; int mNumCalls; // just an interesting statistic size_t mTotalBytes; // just an interesting statistic #else // !defined(ANGLE_DISABLE_POOL_ALLOC) diff --git a/gfx/angle/checkout/src/common/PoolAlloc.cpp b/gfx/angle/checkout/src/common/PoolAlloc.cpp --- a/gfx/angle/checkout/src/common/PoolAlloc.cpp +++ b/gfx/angle/checkout/src/common/PoolAlloc.cpp @@ -19,21 +19,150 @@ #include "common/platform.h" #include "common/tls.h" namespace angle { +// If we are using guard blocks, we must track each individual allocation. If we aren't using guard +// blocks, these never get instantiated, so won't have any impact. + +class Allocation +{ + public: + Allocation(size_t size, unsigned char *mem, Allocation *prev = 0) + : mSize(size), mMem(mem), mPrevAlloc(prev) + { + // Allocations are bracketed: + // + // [allocationHeader][initialGuardBlock][userData][finalGuardBlock] + // + // This would be cleaner with if (kGuardBlockSize)..., but that makes the compiler print + // warnings about 0 length memsets, even with the if() protecting them. +#if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + memset(preGuard(), kGuardBlockBeginVal, kGuardBlockSize); + memset(data(), kUserDataFill, mSize); + memset(postGuard(), kGuardBlockEndVal, kGuardBlockSize); +#endif + } + + void checkAllocList() const; + + static size_t AlignedHeaderSize(uint8_t *allocationBasePtr, size_t alignment) + { + // Make sure that the data offset after the header is aligned to the given alignment. + size_t base = reinterpret_cast(allocationBasePtr); + return rx::roundUpPow2(base + kGuardBlockSize + HeaderSize(), alignment) - base; + } + + // Return total size needed to accommodate user buffer of 'size', + // plus our tracking data and any necessary alignments. + static size_t AllocationSize(uint8_t *allocationBasePtr, + size_t size, + size_t alignment, + size_t *preAllocationPaddingOut) + { + // The allocation will be laid out as such: + // + // Aligned to |alignment| + // ^ + // preAllocationPaddingOut | + // ___^___ | + // / \ | + // [header][guard][data][guard] + // \___________ __________/ + // V + // dataOffset + // + // Note that alignment is at least as much as a pointer alignment, so the pointers in the + // header are also necessarily aligned appropriately. + // + size_t dataOffset = AlignedHeaderSize(allocationBasePtr, alignment); + *preAllocationPaddingOut = dataOffset - HeaderSize() - kGuardBlockSize; + + return dataOffset + size + kGuardBlockSize; + } + + // Given memory pointing to |header|, returns |data|. + static uint8_t *GetDataPointer(uint8_t *memory, size_t alignment) + { + uint8_t *alignedPtr = memory + kGuardBlockSize + HeaderSize(); + + // |memory| must be aligned already such that user data is aligned to |alignment|. + ASSERT((reinterpret_cast(alignedPtr) & (alignment - 1)) == 0); + + return alignedPtr; + } + + private: + void checkGuardBlock(unsigned char *blockMem, unsigned char val, const char *locText) const; + + void checkAlloc() const + { + checkGuardBlock(preGuard(), kGuardBlockBeginVal, "before"); + checkGuardBlock(postGuard(), kGuardBlockEndVal, "after"); + } + + // Find offsets to pre and post guard blocks, and user data buffer + unsigned char *preGuard() const { return mMem + HeaderSize(); } + unsigned char *data() const { return preGuard() + kGuardBlockSize; } + unsigned char *postGuard() const { return data() + mSize; } + size_t mSize; // size of the user data area + unsigned char *mMem; // beginning of our allocation (points to header) + Allocation *mPrevAlloc; // prior allocation in the chain + + static constexpr unsigned char kGuardBlockBeginVal = 0xfb; + static constexpr unsigned char kGuardBlockEndVal = 0xfe; + static constexpr unsigned char kUserDataFill = 0xcd; +#if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + static constexpr size_t kGuardBlockSize = 16; + static constexpr size_t HeaderSize() { return sizeof(Allocation); } +#else + static constexpr size_t kGuardBlockSize = 0; + static constexpr size_t HeaderSize() { return 0; } +#endif +}; + +#if !defined(ANGLE_DISABLE_POOL_ALLOC) +class PageHeader +{ + public: + PageHeader(PageHeader *nextPage, size_t pageCount) + : nextPage(nextPage), + pageCount(pageCount) +# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + , + lastAllocation(nullptr) +# endif + {} + + ~PageHeader() + { +# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + if (lastAllocation) + { + lastAllocation->checkAllocList(); + } +# endif + } + + PageHeader *nextPage; + size_t pageCount; +# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + Allocation *lastAllocation; +# endif +}; +#endif // // Implement the functionality of the PoolAllocator class, which // is documented in PoolAlloc.h. // PoolAllocator::PoolAllocator(int growthIncrement, int allocationAlignment) : mAlignment(allocationAlignment), #if !defined(ANGLE_DISABLE_POOL_ALLOC) mPageSize(growthIncrement), - mFreeList(0), - mInUseList(0), + mFreeList(nullptr), + mInUseList(nullptr), mNumCalls(0), mTotalBytes(0), #endif mLocked(false) { @@ -42,47 +171,37 @@ void PoolAllocator::initialize(int pageSize, int alignment) { mAlignment = alignment; #if !defined(ANGLE_DISABLE_POOL_ALLOC) - mPageSize = pageSize; - if (mAlignment == 1) - { - // This is a special fast-path where fastAllocation() is enabled - mAlignmentMask = 0; - mHeaderSkip = sizeof(Header); - } - else + mPageSize = pageSize; + mPageHeaderSkip = sizeof(PageHeader); + + // Alignment == 1 is a special fast-path where fastAllocate() is enabled + if (mAlignment != 1) { #endif - // // Adjust mAlignment to be at least pointer aligned and // power of 2. // size_t minAlign = sizeof(void *); - mAlignment &= ~(minAlign - 1); if (mAlignment < minAlign) + { mAlignment = minAlign; - mAlignment = gl::ceilPow2(static_cast(mAlignment)); - mAlignmentMask = mAlignment - 1; - + } + mAlignment = gl::ceilPow2(static_cast(mAlignment)); #if !defined(ANGLE_DISABLE_POOL_ALLOC) - // - // Align header skip - // - mHeaderSkip = minAlign; - if (mHeaderSkip < sizeof(Header)) - { - mHeaderSkip = rx::roundUpPow2(sizeof(Header), mAlignment); - } } // // Don't allow page sizes we know are smaller than all common // OS page sizes. // if (mPageSize < 4 * 1024) + { mPageSize = 4 * 1024; + } + // // A large mCurrentPageOffset indicates a new page needs to // be obtained to allocate memory. // mCurrentPageOffset = mPageSize; @@ -94,22 +213,22 @@ PoolAllocator::~PoolAllocator() { #if !defined(ANGLE_DISABLE_POOL_ALLOC) while (mInUseList) { - Header *next = mInUseList->nextPage; - mInUseList->~Header(); + PageHeader *next = mInUseList->nextPage; + mInUseList->~PageHeader(); delete[] reinterpret_cast(mInUseList); mInUseList = next; } // We should not check the guard blocks // here, because we did it already when the block was // placed into the free list. // while (mFreeList) { - Header *next = mFreeList->nextPage; + PageHeader *next = mFreeList->nextPage; delete[] reinterpret_cast(mFreeList); mFreeList = next; } #else // !defined(ANGLE_DISABLE_POOL_ALLOC) for (auto &allocs : mStack) @@ -159,34 +278,35 @@ #else // !defined(ANGLE_DISABLE_POOL_ALLOC) mStack.push_back({}); #endif } -// -// Do a mass-deallocation of all the individual allocations -// that have occurred since the last push(), or since the -// last pop(), or since the object's creation. +// Do a mass-deallocation of all the individual allocations that have occurred since the last +// push(), or since the last pop(), or since the object's creation. // // The deallocated pages are saved for future allocations. -// void PoolAllocator::pop() { if (mStack.size() < 1) + { return; + } #if !defined(ANGLE_DISABLE_POOL_ALLOC) - Header *page = mStack.back().page; + PageHeader *page = mStack.back().page; mCurrentPageOffset = mStack.back().offset; while (mInUseList != page) { // invoke destructor to free allocation list - mInUseList->~Header(); + mInUseList->~PageHeader(); - Header *nextInUse = mInUseList->nextPage; + PageHeader *nextInUse = mInUseList->nextPage; if (mInUseList->pageCount > 1) + { delete[] reinterpret_cast(mInUseList); + } else { mInUseList->nextPage = mFreeList; mFreeList = mInUseList; } @@ -222,100 +342,123 @@ // Just keep some interesting statistics. // ++mNumCalls; mTotalBytes += numBytes; - // If we are using guard blocks, all allocations are bracketed by - // them: [guardblock][allocation][guardblock]. numBytes is how - // much memory the caller asked for. allocationSize is the total - // size including guard blocks. In release build, - // kGuardBlockSize=0 and this all gets optimized away. - size_t allocationSize = Allocation::AllocationSize(numBytes) + mAlignment; - // Detect integer overflow. - if (allocationSize < numBytes) - return 0; + uint8_t *currentPagePtr = reinterpret_cast(mInUseList) + mCurrentPageOffset; - // + size_t preAllocationPadding = 0; + size_t allocationSize = + Allocation::AllocationSize(currentPagePtr, numBytes, mAlignment, &preAllocationPadding); + + // Integer overflow is unexpected. + ASSERT(allocationSize >= numBytes); + // Do the allocation, most likely case first, for efficiency. - // This step could be moved to be inline sometime. - // if (allocationSize <= mPageSize - mCurrentPageOffset) { - // - // Safe to allocate from mCurrentPageOffset. - // - unsigned char *memory = reinterpret_cast(mInUseList) + mCurrentPageOffset; + // There is enough room to allocate from the current page at mCurrentPageOffset. + uint8_t *memory = currentPagePtr + preAllocationPadding; mCurrentPageOffset += allocationSize; - mCurrentPageOffset = (mCurrentPageOffset + mAlignmentMask) & ~mAlignmentMask; - return initializeAllocation(mInUseList, memory, numBytes); + return initializeAllocation(memory, numBytes); } - if (allocationSize > mPageSize - mHeaderSkip) + if (allocationSize > mPageSize - mPageHeaderSkip) { - // - // Do a multi-page allocation. Don't mix these with the others. - // The OS is efficient in allocating and freeing multiple pages. - // - size_t numBytesToAlloc = allocationSize + mHeaderSkip; - // Detect integer overflow. - if (numBytesToAlloc < allocationSize) - return 0; + // If the allocation is larger than a whole page, do a multi-page allocation. These are not + // mixed with the others. The OS is efficient in allocating and freeing multiple pages. + + // We don't know what the alignment of the new allocated memory will be, so conservatively + // allocate enough memory for up to alignment extra bytes being needed. + allocationSize = Allocation::AllocationSize(reinterpret_cast(mPageHeaderSkip), + numBytes, mAlignment, &preAllocationPadding); - Header *memory = reinterpret_cast
(::new char[numBytesToAlloc]); - if (memory == 0) - return 0; + size_t numBytesToAlloc = allocationSize + mPageHeaderSkip + mAlignment; + + // Integer overflow is unexpected. + ASSERT(numBytesToAlloc >= allocationSize); + + PageHeader *memory = reinterpret_cast(::new char[numBytesToAlloc]); + if (memory == nullptr) + { + return nullptr; + } // Use placement-new to initialize header - new (memory) Header(mInUseList, (numBytesToAlloc + mPageSize - 1) / mPageSize); + new (memory) PageHeader(mInUseList, (numBytesToAlloc + mPageSize - 1) / mPageSize); mInUseList = memory; - mCurrentPageOffset = mPageSize; // make next allocation come from a new page + // Make next allocation come from a new page + mCurrentPageOffset = mPageSize; + + // Now that we actually have the pointer, make sure the data pointer will be aligned. + currentPagePtr = reinterpret_cast(memory) + mPageHeaderSkip; + Allocation::AllocationSize(currentPagePtr, numBytes, mAlignment, &preAllocationPadding); - // No guard blocks for multi-page allocations (yet) - void *unalignedPtr = - reinterpret_cast(reinterpret_cast(memory) + mHeaderSkip); - return std::align(mAlignment, numBytes, unalignedPtr, allocationSize); + return initializeAllocation(currentPagePtr + preAllocationPadding, numBytes); } - unsigned char *newPageAddr = - static_cast(allocateNewPage(numBytes, allocationSize)); - return initializeAllocation(mInUseList, newPageAddr, numBytes); + + uint8_t *newPageAddr = allocateNewPage(numBytes); + return initializeAllocation(newPageAddr, numBytes); + #else // !defined(ANGLE_DISABLE_POOL_ALLOC) - void *alloc = malloc(numBytes + mAlignmentMask); + + void *alloc = malloc(numBytes + mAlignment - 1); mStack.back().push_back(alloc); intptr_t intAlloc = reinterpret_cast(alloc); - intAlloc = (intAlloc + mAlignmentMask) & ~mAlignmentMask; + intAlloc = rx::roundUpPow2(intAlloc, mAlignment); return reinterpret_cast(intAlloc); #endif } #if !defined(ANGLE_DISABLE_POOL_ALLOC) -void *PoolAllocator::allocateNewPage(size_t numBytes, size_t allocationSize) +uint8_t *PoolAllocator::allocateNewPage(size_t numBytes) { - // - // Need a simple page to allocate from. - // - Header *memory; + // Need a simple page to allocate from. Pick a page from the free list, if any. Otherwise need + // to make the allocation. + PageHeader *memory; if (mFreeList) { memory = mFreeList; mFreeList = mFreeList->nextPage; } else { - memory = reinterpret_cast
(::new char[mPageSize]); - if (memory == 0) - return 0; + memory = reinterpret_cast(::new char[mPageSize]); + if (memory == nullptr) + { + return nullptr; + } } // Use placement-new to initialize header - new (memory) Header(mInUseList, 1); + new (memory) PageHeader(mInUseList, 1); mInUseList = memory; - unsigned char *ret = reinterpret_cast(mInUseList) + mHeaderSkip; - mCurrentPageOffset = (mHeaderSkip + allocationSize + mAlignmentMask) & ~mAlignmentMask; - return ret; + // Leave room for the page header. + mCurrentPageOffset = mPageHeaderSkip; + uint8_t *currentPagePtr = reinterpret_cast(mInUseList) + mCurrentPageOffset; + + size_t preAllocationPadding = 0; + size_t allocationSize = + Allocation::AllocationSize(currentPagePtr, numBytes, mAlignment, &preAllocationPadding); + + mCurrentPageOffset += allocationSize; + + // The new allocation is made after the page header and any alignment required before it. + return reinterpret_cast(mInUseList) + mPageHeaderSkip + preAllocationPadding; +} + +void *PoolAllocator::initializeAllocation(uint8_t *memory, size_t numBytes) +{ +# if defined(ANGLE_POOL_ALLOC_GUARD_BLOCKS) + new (memory) Allocation(numBytes, memory, mInUseList->lastAllocation); + mInUseList->lastAllocation = reinterpret_cast(memory); +# endif + + return Allocation::GetDataPointer(memory, mAlignment); } #endif void PoolAllocator::lock() { @@ -332,10 +475,12 @@ // // Check all allocations in a list for damage by calling check on each. // void Allocation::checkAllocList() const { - for (const Allocation *alloc = this; alloc != 0; alloc = alloc->mPrevAlloc) - alloc->check(); + for (const Allocation *alloc = this; alloc != nullptr; alloc = alloc->mPrevAlloc) + { + alloc->checkAlloc(); + } } } // namespace angle diff --git a/gfx/angle/checkout/src/common/Spinlock.h b/gfx/angle/checkout/src/common/Spinlock.h new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/Spinlock.h @@ -0,0 +1,71 @@ +// +// Copyright 2021 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. +// +// Spinlock.h: +// Spinlock is a lock that loops actively until it gets the resource. +// Only use it when the lock will be granted in reasonably short time. + +#ifndef COMMON_SPINLOCK_H_ +#define COMMON_SPINLOCK_H_ + +#include + +// TODO(jplate) Add pause for ARM, http://anglebug.com:6067 +#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) +extern "C" void _mm_pause(); +# pragma intrinsic(_mm_pause) +# define ANGLE_SMT_PAUSE() _mm_pause() +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# define ANGLE_SMT_PAUSE() __asm__ __volatile__("pause;") +#else +# define ANGLE_SMT_PAUSE() static_cast(0) +#endif + +namespace angle +{ + +class Spinlock +{ + public: + Spinlock() noexcept; + + bool try_lock() noexcept; + void lock() noexcept; + void unlock() noexcept; + + private: + std::atomic_bool mLock; +}; + +inline Spinlock::Spinlock() noexcept : mLock(false) {} + +inline bool Spinlock::try_lock() noexcept +{ + // Relaxed check first to prevent unnecessary cache misses. + return !mLock.load(std::memory_order_relaxed) && + !mLock.exchange(true, std::memory_order_acquire); +} + +inline void Spinlock::lock() noexcept +{ + while (mLock.exchange(true, std::memory_order_acquire)) + { + // Relaxed wait to prevent unnecessary cache misses. + while (mLock.load(std::memory_order_relaxed)) + { + // Optimization for simultaneous multithreading. + ANGLE_SMT_PAUSE(); + } + } +} + +inline void Spinlock::unlock() noexcept +{ + mLock.store(false, std::memory_order_release); +} + +} // namespace angle + +#endif // COMMON_SPINLOCK_H_ diff --git a/gfx/angle/checkout/src/common/SynchronizedValue.h b/gfx/angle/checkout/src/common/SynchronizedValue.h new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/SynchronizedValue.h @@ -0,0 +1,540 @@ +// +// Copyright 2021 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. +// +// SynchronizedValue.h: +// A class that ensures that the correct mutex is locked when the encapsulated data is accessed. +// Based on boost::synchronized_value, which probably becomes part of the next C++ standard. +// https://www.boost.org/doc/libs/1_76_0/doc/html/thread/sds.html#thread.sds.synchronized_valuesxxx + +#ifndef COMMON_SYNCHRONIZEDVALUE_H_ +#define COMMON_SYNCHRONIZEDVALUE_H_ + +#include "common/debug.h" + +#include +#include + +namespace angle +{ + +template +class ConstStrictLockPtr +{ + public: + using value_type = T; + using mutex_type = Lockable; + + ConstStrictLockPtr(const T &value, Lockable &mutex) : mLock(mutex), mValue(value) {} + ConstStrictLockPtr(const T &value, Lockable &mutex, std::adopt_lock_t) noexcept + : mLock(mutex, std::adopt_lock), mValue(value) + {} + + ConstStrictLockPtr(ConstStrictLockPtr &&other) noexcept + : mLock(std::move(other.mLock)), mValue(other.mValue) + {} + + ConstStrictLockPtr(const ConstStrictLockPtr &) = delete; + ConstStrictLockPtr &operator=(const ConstStrictLockPtr &) = delete; + + ~ConstStrictLockPtr() = default; + + const T *operator->() const { return &mValue; } + const T &operator*() const { return mValue; } + + protected: + std::unique_lock mLock; + T const &mValue; +}; + +template +class StrictLockPtr : public ConstStrictLockPtr +{ + private: + using BaseType = ConstStrictLockPtr; + + public: + StrictLockPtr(T &value, Lockable &mutex) : BaseType(value, mutex) {} + StrictLockPtr(T &value, Lockable &mutex, std::adopt_lock_t) noexcept + : BaseType(value, mutex, std::adopt_lock) + {} + + StrictLockPtr(StrictLockPtr &&other) noexcept + : BaseType(std::move(static_cast(other))) + {} + + StrictLockPtr(const StrictLockPtr &) = delete; + StrictLockPtr &operator=(const StrictLockPtr &) = delete; + + ~StrictLockPtr() = default; + + T *operator->() { return const_cast(&this->mValue); } + T &operator*() { return const_cast(this->mValue); } +}; + +template +struct SynchronizedValueStrictLockPtr +{ + using type = StrictLockPtr; +}; + +template +struct SynchronizedValueStrictLockPtr +{ + using type = ConstStrictLockPtr; +}; + +template +class ConstUniqueLockPtr : public std::unique_lock +{ + private: + using BaseType = std::unique_lock; + + public: + using value_type = T; + using mutex_type = Lockable; + + ConstUniqueLockPtr(const T &value, Lockable &mutex) : BaseType(mutex), mValue(value) {} + ConstUniqueLockPtr(const T &value, Lockable &mutex, std::adopt_lock_t) noexcept + : BaseType(mutex, std::adopt_lock), mValue(value) + {} + ConstUniqueLockPtr(const T &value, Lockable &mutex, std::defer_lock_t) noexcept + : BaseType(mutex, std::defer_lock), mValue(value) + {} + ConstUniqueLockPtr(const T &value, Lockable &mutex, std::try_to_lock_t) noexcept + : BaseType(mutex, std::try_to_lock), mValue(value) + {} + + ConstUniqueLockPtr(ConstUniqueLockPtr &&other) noexcept + : BaseType(std::move(static_cast(other))), mValue(other.mValue) + {} + + ConstUniqueLockPtr(const ConstUniqueLockPtr &) = delete; + ConstUniqueLockPtr &operator=(const ConstUniqueLockPtr &) = delete; + + ~ConstUniqueLockPtr() = default; + + const T *operator->() const + { + ASSERT(this->owns_lock()); + return &mValue; + } + const T &operator*() const + { + ASSERT(this->owns_lock()); + return mValue; + } + + protected: + T const &mValue; +}; + +template +class UniqueLockPtr : public ConstUniqueLockPtr +{ + private: + using BaseType = ConstUniqueLockPtr; + + public: + UniqueLockPtr(T &value, Lockable &mutex) : BaseType(value, mutex) {} + UniqueLockPtr(T &value, Lockable &mutex, std::adopt_lock_t) noexcept + : BaseType(value, mutex, std::adopt_lock) + {} + UniqueLockPtr(T &value, Lockable &mutex, std::defer_lock_t) noexcept + : BaseType(value, mutex, std::defer_lock) + {} + UniqueLockPtr(T &value, Lockable &mutex, std::try_to_lock_t) noexcept + : BaseType(value, mutex, std::try_to_lock) + {} + + UniqueLockPtr(UniqueLockPtr &&other) noexcept + : BaseType(std::move(static_cast(other))) + {} + + UniqueLockPtr(const UniqueLockPtr &) = delete; + UniqueLockPtr &operator=(const UniqueLockPtr &) = delete; + + ~UniqueLockPtr() = default; + + T *operator->() + { + ASSERT(this->owns_lock()); + return const_cast(&this->mValue); + } + T &operator*() + { + ASSERT(this->owns_lock()); + return const_cast(this->mValue); + } +}; + +template +struct SynchronizedValueUniqueLockPtr +{ + using type = UniqueLockPtr; +}; + +template +struct SynchronizedValueUniqueLockPtr +{ + using type = ConstUniqueLockPtr; +}; + +template +class SynchronizedValue +{ + public: + using value_type = T; + using mutex_type = Lockable; + + SynchronizedValue() noexcept(std::is_nothrow_default_constructible::value) : mValue() {} + + SynchronizedValue(const T &other) noexcept(std::is_nothrow_copy_constructible::value) + : mValue(other) + {} + + SynchronizedValue(T &&other) noexcept(std::is_nothrow_move_constructible::value) + : mValue(std::move(other)) + {} + + template + SynchronizedValue(Args &&... args) noexcept(noexcept(T(std::forward(args)...))) + : mValue(std::forward(args)...) + {} + + SynchronizedValue(const SynchronizedValue &other) + { + std::lock_guard lock(other.mMutex); + mValue = other.mValue; + } + + SynchronizedValue(SynchronizedValue &&other) + { + std::lock_guard lock(other.mMutex); + mValue = std::move(other.mValue); + } + + SynchronizedValue &operator=(const SynchronizedValue &other) + { + if (&other != this) + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + mValue = other.mValue; + } + return *this; + } + + SynchronizedValue &operator=(SynchronizedValue &&other) + { + if (&other != this) + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + mValue = std::move(other.mValue); + } + return *this; + } + + SynchronizedValue &operator=(const T &value) + { + { + std::lock_guard lock(mMutex); + mValue = value; + } + return *this; + } + + SynchronizedValue &operator=(T &&value) + { + { + std::lock_guard lock(mMutex); + mValue = std::move(value); + } + return *this; + } + + T get() const + { + std::lock_guard lock(mMutex); + return mValue; + } + + explicit operator T() const { return get(); } + + void swap(SynchronizedValue &other) + { + if (this == &other) + { + return; + } + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + std::swap(mValue, other.mValue); + } + + void swap(T &other) + { + std::lock_guard lock(mMutex); + std::swap(mValue, other); + } + + StrictLockPtr operator->() { return StrictLockPtr(mValue, mMutex); } + ConstStrictLockPtr operator->() const + { + return ConstStrictLockPtr(mValue, mMutex); + } + + StrictLockPtr synchronize() { return StrictLockPtr(mValue, mMutex); } + ConstStrictLockPtr synchronize() const + { + return ConstStrictLockPtr(mValue, mMutex); + } + + UniqueLockPtr unique_synchronize() + { + return UniqueLockPtr(mValue, mMutex); + } + ConstUniqueLockPtr unique_synchronize() const + { + return ConstUniqueLockPtr(mValue, mMutex); + } + + UniqueLockPtr defer_synchronize() noexcept + { + return UniqueLockPtr(mValue, mMutex, std::defer_lock); + } + ConstUniqueLockPtr defer_synchronize() const noexcept + { + return ConstUniqueLockPtr(mValue, mMutex, std::defer_lock); + } + + UniqueLockPtr try_to_synchronize() noexcept + { + return UniqueLockPtr(mValue, mMutex, std::try_to_lock); + } + ConstUniqueLockPtr try_to_synchronize() const noexcept + { + return ConstUniqueLockPtr(mValue, mMutex, std::try_to_lock); + } + + UniqueLockPtr adopt_synchronize() noexcept + { + return UniqueLockPtr(mValue, mMutex, std::adopt_lock); + } + ConstUniqueLockPtr adopt_synchronize() const noexcept + { + return ConstUniqueLockPtr(mValue, mMutex, std::adopt_lock); + } + + class DerefValue + { + public: + DerefValue(DerefValue &&other) : mLock(std::move(other.mLock)), mValue(other.mValue) {} + + DerefValue(const DerefValue &) = delete; + DerefValue &operator=(const DerefValue &) = delete; + + operator T &() { return mValue; } + + DerefValue &operator=(const T &other) + { + mValue = other; + return *this; + } + + private: + explicit DerefValue(SynchronizedValue &outer) : mLock(outer.mMutex), mValue(outer.mValue) {} + + std::unique_lock mLock; + T &mValue; + + friend class SynchronizedValue; + }; + + class ConstDerefValue + { + public: + ConstDerefValue(ConstDerefValue &&other) + : mLock(std::move(other.mLock)), mValue(other.mValue) + {} + + ConstDerefValue(const ConstDerefValue &) = delete; + ConstDerefValue &operator=(const ConstDerefValue &) = delete; + + operator const T &() { return mValue; } + + private: + explicit ConstDerefValue(const SynchronizedValue &outer) + : mLock(outer.mMutex), mValue(outer.mValue) + {} + + std::unique_lock mLock; + const T &mValue; + + friend class SynchronizedValue; + }; + + DerefValue operator*() { return DerefValue(*this); } + ConstDerefValue operator*() const { return ConstDerefValue(*this); } + + template + void save(OStream &os) const + { + std::lock_guard lock(mMutex); + os << mValue; + } + + template + void load(IStream &is) + { + std::lock_guard lock(mMutex); + is >> mValue; + } + + bool operator==(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue == other.mValue; + } + + bool operator!=(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue != other.mValue; + } + + bool operator<(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue < other.mValue; + } + + bool operator>(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue > other.mValue; + } + + bool operator<=(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue <= other.mValue; + } + + bool operator>=(const SynchronizedValue &other) const + { + std::unique_lock lock1(mMutex, std::defer_lock); + std::unique_lock lock2(other.mMutex, std::defer_lock); + std::lock(lock1, lock2); + return mValue >= other.mValue; + } + + bool operator==(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue == other; + } + + bool operator!=(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue != other; + } + + bool operator<(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue < other; + } + + bool operator>(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue > other; + } + + bool operator<=(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue <= other; + } + + bool operator>=(const T &other) const + { + std::lock_guard lock(mMutex); + return mValue >= other; + } + + private: + T mValue; + mutable Lockable mMutex; +}; + +template +inline OStream &operator<<(OStream &os, SynchronizedValue const &sv) +{ + sv.save(os); + return os; +} + +template +inline IStream &operator>>(IStream &is, SynchronizedValue &sv) +{ + sv.load(is); + return is; +} + +template +bool operator==(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs == lhs; +} + +template +bool operator!=(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs != lhs; +} + +template +bool operator<(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs < lhs; +} + +template +bool operator>(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs > lhs; +} + +template +bool operator<=(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs <= lhs; +} + +template +bool operator>=(const T &lhs, const SynchronizedValue &rhs) +{ + return rhs >= lhs; +} + +} // namespace angle + +#endif // COMMON_SYNCHRONIZEDVALUE_H_ diff --git a/gfx/angle/checkout/src/common/android_util.h b/gfx/angle/checkout/src/common/android_util.h --- a/gfx/angle/checkout/src/common/android_util.h +++ b/gfx/angle/checkout/src/common/android_util.h @@ -40,11 +40,12 @@ void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer, int *width, int *height, int *depth, - int *pixelFormat); + int *pixelFormat, + uint64_t *usage); GLenum NativePixelFormatToGLInternalFormat(int pixelFormat); int GLInternalFormatToNativePixelFormat(GLenum internalFormat); bool NativePixelFormatIsYUV(int pixelFormat); diff --git a/gfx/angle/checkout/src/common/android_util.cpp b/gfx/angle/checkout/src/common/android_util.cpp --- a/gfx/angle/checkout/src/common/android_util.cpp +++ b/gfx/angle/checkout/src/common/android_util.cpp @@ -191,10 +191,12 @@ * cube-maps or multi-layered textures. */ AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 = 0x23, #endif // ANGLE_AHARDWARE_BUFFER_SUPPORT + + AHARDWAREBUFFER_FORMAT_YV12 = 0x32315659 }; // clang-format on namespace { @@ -255,10 +257,11 @@ case AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: return GL_DEPTH32F_STENCIL8; case AHARDWAREBUFFER_FORMAT_S8_UINT: return GL_STENCIL_INDEX8; case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: + case AHARDWAREBUFFER_FORMAT_YV12: *isYUV = true; return GL_RGB8; default: // Treat unknown formats as RGB. They are vendor-specific YUV formats that would sample // as RGB. @@ -324,25 +327,28 @@ { return nullptr; } return AHardwareBufferToClientBuffer(aHardwareBuffer); +#else + return nullptr; #endif // ANGLE_AHARDWARE_BUFFER_SUPPORT - return nullptr; } void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer, int *width, int *height, int *depth, - int *pixelFormat) + int *pixelFormat, + uint64_t *usage) { *width = buffer->width; *height = buffer->height; *depth = static_cast(buffer->layerCount); *height = buffer->height; *pixelFormat = buffer->format; + *usage = buffer->usage; } GLenum NativePixelFormatToGLInternalFormat(int pixelFormat) { bool isYuv = false; diff --git a/gfx/angle/checkout/src/common/angle_version_info.h b/gfx/angle/checkout/src/common/angle_version_info.h new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/angle_version_info.h @@ -0,0 +1,19 @@ +// +// Copyright 2021 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. +// +// angle_version_info.h: ANGLE version queries. + +#ifndef COMMON_VERSION_H_ +#define COMMON_VERSION_H_ + +namespace angle +{ +int GetANGLERevision(); +const char *GetANGLEVersionString(); +const char *GetANGLECommitHash(); +int GetANGLECommitHashSize(); +} // namespace angle + +#endif // COMMON_VERSION_H_ diff --git a/gfx/angle/checkout/src/common/angle_version_info.cpp b/gfx/angle/checkout/src/common/angle_version_info.cpp new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/angle_version_info.cpp @@ -0,0 +1,31 @@ +// +// Copyright 2021 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. +// +// angle_version_info.cpp: ANGLE version queries. + +#include "common/angle_version.h" + +namespace angle +{ +int GetANGLERevision() +{ + return ANGLE_REVISION; +} + +const char *GetANGLEVersionString() +{ + return ANGLE_VERSION_STRING; +} + +const char *GetANGLECommitHash() +{ + return ANGLE_COMMIT_HASH; +} + +int GetANGLECommitHashSize() +{ + return ANGLE_COMMIT_HASH_SIZE; +} +} // namespace angle diff --git a/gfx/angle/checkout/src/common/angleutils.h b/gfx/angle/checkout/src/common/angleutils.h --- a/gfx/angle/checkout/src/common/angleutils.h +++ b/gfx/angle/checkout/src/common/angleutils.h @@ -11,23 +11,27 @@ #include "common/platform.h" #if defined(ANGLE_USE_ABSEIL) # include "absl/container/flat_hash_map.h" +# include "absl/container/flat_hash_set.h" #endif // defined(ANGLE_USE_ABSEIL) #if defined(ANGLE_WITH_LSAN) # include #endif // defined(ANGLE_WITH_LSAN) #include #include #include +#include +#include #include #include #include #include +#include #include // A helper class to disallow copy and assignment operators namespace angle { @@ -35,15 +39,19 @@ #if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11) using Microsoft::WRL::ComPtr; #endif // defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11) #if defined(ANGLE_USE_ABSEIL) -template -using HashMap = absl::flat_hash_map; +template > +using HashMap = absl::flat_hash_map; +template > +using HashSet = absl::flat_hash_set; #else -template -using HashMap = std::unordered_map; +template > +using HashMap = std::unordered_map; +template > +using HashSet = std::unordered_set; #endif // defined(ANGLE_USE_ABSEIL) class NonCopyable { protected: @@ -55,10 +63,135 @@ void operator=(const NonCopyable &) = delete; }; extern const uintptr_t DirtyPointer; +struct SaveFileHelper +{ + public: + // We always use ios::binary to avoid inconsistent line endings when captured on Linux vs Win. + SaveFileHelper(const std::string &filePathIn); + ~SaveFileHelper(); + + template + SaveFileHelper &operator<<(const T &value) + { + mOfs << value; + checkError(); + return *this; + } + + void write(const uint8_t *data, size_t size); + + private: + void checkError(); + + std::ofstream mOfs; + std::string mFilePath; +}; + +// AMD_performance_monitor helpers. +constexpr char kPerfMonitorExtensionName[] = "GL_AMD_performance_monitor"; + +struct PerfMonitorCounter +{ + PerfMonitorCounter(); + ~PerfMonitorCounter(); + + std::string name; + uint32_t value; +}; +using PerfMonitorCounters = std::vector; + +struct PerfMonitorCounterGroup +{ + PerfMonitorCounterGroup(); + ~PerfMonitorCounterGroup(); + + std::string name; + PerfMonitorCounters counters; +}; +using PerfMonitorCounterGroups = std::vector; + +uint32_t GetPerfMonitorCounterIndex(const PerfMonitorCounters &counters, const std::string &name); +const PerfMonitorCounter &GetPerfMonitorCounter(const PerfMonitorCounters &counters, + const std::string &name); +PerfMonitorCounter &GetPerfMonitorCounter(PerfMonitorCounters &counters, const std::string &name); +uint32_t GetPerfMonitorCounterGroupIndex(const PerfMonitorCounterGroups &groups, + const std::string &name); +const PerfMonitorCounterGroup &GetPerfMonitorCounterGroup(const PerfMonitorCounterGroups &groups, + const std::string &name); +PerfMonitorCounterGroup &GetPerfMonitorCounterGroup(PerfMonitorCounterGroups &groups, + const std::string &name); + +struct PerfMonitorTriplet +{ + uint32_t group; + uint32_t counter; + uint32_t value; +}; + +#define ANGLE_VK_PERF_COUNTERS_X(FN) \ + FN(primaryBuffers) \ + FN(renderPasses) \ + FN(submittedCommands) \ + FN(writeDescriptorSets) \ + FN(flushedOutsideRenderPassCommandBuffers) \ + FN(swapchainResolveInSubpass) \ + FN(swapchainResolveOutsideSubpass) \ + FN(resolveImageCommands) \ + FN(colorLoadOpClears) \ + FN(colorLoadOpLoads) \ + FN(colorLoadOpNones) \ + FN(colorStoreOpStores) \ + FN(colorStoreOpNones) \ + FN(colorClearAttachments) \ + FN(depthLoadOpClears) \ + FN(depthLoadOpLoads) \ + FN(depthLoadOpNones) \ + FN(depthStoreOpStores) \ + FN(depthStoreOpNones) \ + FN(depthClearAttachments) \ + FN(stencilLoadOpClears) \ + FN(stencilLoadOpLoads) \ + FN(stencilLoadOpNones) \ + FN(stencilStoreOpStores) \ + FN(stencilStoreOpNones) \ + FN(stencilClearAttachments) \ + FN(colorAttachmentUnresolves) \ + FN(depthAttachmentUnresolves) \ + FN(stencilAttachmentUnresolves) \ + FN(colorAttachmentResolves) \ + FN(depthAttachmentResolves) \ + FN(stencilAttachmentResolves) \ + FN(readOnlyDepthStencilRenderPasses) \ + FN(descriptorSetAllocations) \ + FN(descriptorSetCacheTotalSize) \ + FN(descriptorSetCacheKeySizeBytes) \ + FN(uniformsAndXfbDescriptorSetCacheHits) \ + FN(uniformsAndXfbDescriptorSetCacheMisses) \ + FN(uniformsAndXfbDescriptorSetCacheTotalSize) \ + FN(textureDescriptorSetCacheHits) \ + FN(textureDescriptorSetCacheMisses) \ + FN(textureDescriptorSetCacheTotalSize) \ + FN(shaderBuffersDescriptorSetCacheHits) \ + FN(shaderBuffersDescriptorSetCacheMisses) \ + FN(shaderBuffersDescriptorSetCacheTotalSize) \ + FN(buffersGhosted) \ + FN(vertexArraySyncStateCalls) \ + FN(allocateNewBufferBlockCalls) \ + FN(dynamicBufferAllocations) + +#define ANGLE_DECLARE_PERF_COUNTER(COUNTER) uint32_t COUNTER; + +struct VulkanPerfCounters +{ + ANGLE_VK_PERF_COUNTERS_X(ANGLE_DECLARE_PERF_COUNTER) +}; + +#undef ANGLE_DECLARE_PERF_COUNTER + } // namespace angle template constexpr inline size_t ArraySize(T (&)[N]) { @@ -188,12 +321,10 @@ std::stringstream strstr; strstr << i; return strstr.str(); } -size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector &buffer); - template std::string ToString(const T &value) { std::ostringstream o; o << value; @@ -205,10 +336,36 @@ constexpr uint32_t kEndiannessTest = 1; const bool isLittleEndian = *reinterpret_cast(&kEndiannessTest) == 1; return isLittleEndian; } +// Helper class to use a mutex with the control of boolean. +class ConditionalMutex final : angle::NonCopyable +{ + public: + ConditionalMutex() : mUseMutex(true) {} + void init(bool useMutex) { mUseMutex = useMutex; } + void lock() + { + if (mUseMutex) + { + mMutex.lock(); + } + } + void unlock() + { + if (mUseMutex) + { + mMutex.unlock(); + } + } + + private: + std::mutex mMutex; + bool mUseMutex; +}; + // snprintf is not defined with MSVC prior to to msvc14 #if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif @@ -288,14 +445,10 @@ #define GL_X2_RGB10_USCALED_ANGLEX 0x6AF5 #define GL_X2_RGB10_SSCALED_ANGLEX 0x6AF6 #define GL_X2_RGB10_UNORM_ANGLEX 0x6AF7 #define GL_X2_RGB10_SNORM_ANGLEX 0x6AF8 -// YUV formats -#define GL_G8_B8_R8_3PLANE_420_UNORM_ANGLEX 0x6B00 -#define GL_G8_B8R8_2PLANE_420_UNORM_ANGLEX 0x6B01 - #define ANGLE_CHECK_GL_ALLOC(context, result) \ ANGLE_CHECK(context, result, "Failed to allocate host memory", GL_OUT_OF_MEMORY) #define ANGLE_CHECK_GL_MATH(context, result) \ ANGLE_CHECK(context, result, "Integer overflow.", GL_INVALID_OPERATION) @@ -308,10 +461,26 @@ # define ANGLE_SCOPED_DISABLE_LSAN() __lsan::ScopedDisabler lsanDisabler #else # define ANGLE_SCOPED_DISABLE_LSAN() #endif +// The ANGLE_NO_SANITIZE_MEMORY macro suppresses MemorySanitizer checks for +// use-of-uninitialized-data. It can be used to decorate functions with known +// false positives. +#ifdef __clang__ +# define ANGLE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) +#else +# define ANGLE_NO_SANITIZE_MEMORY +#endif + +// Similar to the above, but for thread sanitization. +#ifdef __clang__ +# define ANGLE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) +#else +# define ANGLE_NO_SANITIZE_THREAD +#endif + // The below inlining code lifted from V8. #if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute)) # define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline)) # define ANGLE_HAS___FORCEINLINE 0 #elif defined(_MSC_VER) @@ -350,10 +519,13 @@ # endif #else # define ANGLE_FORMAT_PRINTF(fmt, args) #endif +ANGLE_FORMAT_PRINTF(1, 0) +size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector &buffer); + // Format messes up the # inside the macro. // clang-format off #ifndef ANGLE_STRINGIFY # define ANGLE_STRINGIFY(x) #x #endif @@ -384,6 +556,48 @@ # define ANGLE_REQUIRE_CONSTANT_INIT [[require_constant_initialization]] #else # define ANGLE_REQUIRE_CONSTANT_INIT #endif // __has_cpp_attribute(require_constant_initialization) +#if __has_cpp_attribute(clang::fallthrough) +# define ANGLE_FALLTHROUGH [[clang::fallthrough]] +#else +# define ANGLE_FALLTHROUGH +#endif + +// Compiler configs. +inline bool IsASan() +{ +#if defined(ANGLE_WITH_ASAN) + return true; +#else + return false; +#endif // defined(ANGLE_WITH_ASAN) +} + +inline bool IsMSan() +{ +#if defined(ANGLE_WITH_MSAN) + return true; +#else + return false; +#endif // defined(ANGLE_WITH_MSAN) +} + +inline bool IsTSan() +{ +#if defined(ANGLE_WITH_TSAN) + return true; +#else + return false; +#endif // defined(ANGLE_WITH_TSAN) +} + +inline bool IsUBSan() +{ +#if defined(ANGLE_WITH_UBSAN) + return true; +#else + return false; +#endif // defined(ANGLE_WITH_UBSAN) +} #endif // COMMON_ANGLEUTILS_H_ diff --git a/gfx/angle/checkout/src/common/angleutils.cpp b/gfx/angle/checkout/src/common/angleutils.cpp --- a/gfx/angle/checkout/src/common/angleutils.cpp +++ b/gfx/angle/checkout/src/common/angleutils.cpp @@ -15,10 +15,102 @@ namespace angle { // dirtyPointer is a special value that will make the comparison with any valid pointer fail and // force the renderer to re-apply the state. const uintptr_t DirtyPointer = std::numeric_limits::max(); + +SaveFileHelper::SaveFileHelper(const std::string &filePathIn) + : mOfs(filePathIn, std::ios::binary | std::ios::out), mFilePath(filePathIn) +{ + if (!mOfs.is_open()) + { + FATAL() << "Could not open " << filePathIn; + } +} + +SaveFileHelper::~SaveFileHelper() +{ + printf("Saved '%s'.\n", mFilePath.c_str()); +} + +void SaveFileHelper::checkError() +{ + if (mOfs.bad()) + { + FATAL() << "Error writing to " << mFilePath; + } +} + +void SaveFileHelper::write(const uint8_t *data, size_t size) +{ + mOfs.write(reinterpret_cast(data), size); +} + +// AMD_performance_monitor helpers. + +PerfMonitorCounter::PerfMonitorCounter() = default; + +PerfMonitorCounter::~PerfMonitorCounter() = default; + +PerfMonitorCounterGroup::PerfMonitorCounterGroup() = default; + +PerfMonitorCounterGroup::~PerfMonitorCounterGroup() = default; + +uint32_t GetPerfMonitorCounterIndex(const PerfMonitorCounters &counters, const std::string &name) +{ + for (uint32_t counterIndex = 0; counterIndex < static_cast(counters.size()); + ++counterIndex) + { + if (counters[counterIndex].name == name) + { + return counterIndex; + } + } + + return std::numeric_limits::max(); +} + +uint32_t GetPerfMonitorCounterGroupIndex(const PerfMonitorCounterGroups &groups, + const std::string &name) +{ + for (uint32_t groupIndex = 0; groupIndex < static_cast(groups.size()); ++groupIndex) + { + if (groups[groupIndex].name == name) + { + return groupIndex; + } + } + + return std::numeric_limits::max(); +} + +const PerfMonitorCounter &GetPerfMonitorCounter(const PerfMonitorCounters &counters, + const std::string &name) +{ + return GetPerfMonitorCounter(const_cast(counters), name); +} + +PerfMonitorCounter &GetPerfMonitorCounter(PerfMonitorCounters &counters, const std::string &name) +{ + uint32_t counterIndex = GetPerfMonitorCounterIndex(counters, name); + ASSERT(counterIndex < static_cast(counters.size())); + return counters[counterIndex]; +} + +const PerfMonitorCounterGroup &GetPerfMonitorCounterGroup(const PerfMonitorCounterGroups &groups, + const std::string &name) +{ + return GetPerfMonitorCounterGroup(const_cast(groups), name); +} + +PerfMonitorCounterGroup &GetPerfMonitorCounterGroup(PerfMonitorCounterGroups &groups, + const std::string &name) +{ + uint32_t groupIndex = GetPerfMonitorCounterGroupIndex(groups, name); + ASSERT(groupIndex < static_cast(groups.size())); + return groups[groupIndex]; +} } // namespace angle std::string ArrayString(unsigned int i) { // We assume that UINT_MAX and GL_INVALID_INDEX are equal. diff --git a/gfx/angle/checkout/src/common/apple_platform_utils.h b/gfx/angle/checkout/src/common/apple_platform_utils.h --- a/gfx/angle/checkout/src/common/apple_platform_utils.h +++ b/gfx/angle/checkout/src/common/apple_platform_utils.h @@ -13,26 +13,34 @@ // These are macros for substitution of Apple specific directive @available: // TARGET_OS_MACCATALYST only available in MacSDK 10.15 +#if TARGET_OS_MACCATALYST // ANGLE_APPLE_AVAILABLE_XCI: check if either of the 3 platforms (OSX/Catalyst/iOS) min verions is // available: -#if TARGET_OS_MACCATALYST # define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \ @available(macOS macVer, macCatalyst macCatalystVer, iOS iOSVer, *) // ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is // available: # define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) \ @available(macOS macVer, macCatalyst macCatalystVer, *) +// ANGLE_APPLE_AVAILABLE_CI: check if either of the 2 platforms (Catalyst/iOS) min verions is +// available: +# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) \ + @available(macCatalyst macCatalystVer, iOS iOSVer, *) #else # define ANGLE_APPLE_AVAILABLE_XCI(macVer, macCatalystVer, iOSVer) \ ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) -// ANGLE_APPLE_AVAILABLE_XC: check if either of the 2 platforms (OSX/Catalyst) min verions is -// available: + # define ANGLE_APPLE_AVAILABLE_XC(macVer, macCatalystVer) @available(macOS macVer, *) +# define ANGLE_APPLE_AVAILABLE_CI(macCatalystVer, iOSVer) @available(iOS iOSVer, tvOS iOSVer, *) #endif // ANGLE_APPLE_AVAILABLE_XI: check if either of the 2 platforms (OSX/iOS) min verions is available: -#define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) @available(macOS macVer, iOS iOSVer, *) +#define ANGLE_APPLE_AVAILABLE_XI(macVer, iOSVer) \ + @available(macOS macVer, iOS iOSVer, tvOS iOSVer, *) + +// ANGLE_APPLE_AVAILABLE_I: check if a particular iOS version is available +#define ANGLE_APPLE_AVAILABLE_I(iOSVer) @available(iOS iOSVer, tvOS iOSVer, *) #endif diff --git a/gfx/angle/checkout/src/common/bitset_utils.h b/gfx/angle/checkout/src/common/bitset_utils.h --- a/gfx/angle/checkout/src/common/bitset_utils.h +++ b/gfx/angle/checkout/src/common/bitset_utils.h @@ -19,19 +19,31 @@ #include "common/mathutil.h" #include "common/platform.h" namespace angle { +// Given x, create 1 << x. template -constexpr static BitsT Bit(ParamT x) +constexpr BitsT Bit(ParamT x) { // It's undefined behavior if the shift size is equal to or larger than the width of the type. ASSERT(static_cast(x) < sizeof(BitsT) * 8); return (static_cast(1) << static_cast(x)); } +// Given x, create (1 << x) - 1, i.e. a mask with x bits set. +template +constexpr BitsT BitMask(ParamT x) +{ + if (static_cast(x) == 0) + { + return 0; + } + return ((Bit(static_cast(static_cast(x) - 1)) - 1) << 1) | 1; +} + template class BitSetT final { public: class Reference final @@ -149,14 +161,11 @@ constexpr ParamT first() const; constexpr ParamT last() const; // Produces a mask of ones up to the "x"th bit. - constexpr static BitsT Mask(std::size_t x) - { - return ((Bit(static_cast(x - 1)) - 1) << 1) + 1; - } + constexpr static BitsT Mask(std::size_t x) { return BitMask(static_cast(x)); } private: BitsT mBits; }; @@ -174,12 +183,13 @@ template constexpr BitSetT::BitSetT(std::initializer_list init) : mBits(0) { for (ParamT element : init) { - mBits |= Bit(element) & Mask(N); + mBits |= Bit(element); } + ASSERT(mBits == (mBits & Mask(N))); } template constexpr BitSetT::BitSetT(const BitSetT &other) : mBits(other.mBits) {} @@ -277,18 +287,20 @@ } template constexpr BitSetT &BitSetT::operator|=(BitsT value) { - mBits |= value & Mask(N); + mBits |= value; + ASSERT(mBits == (mBits & Mask(N))); return *this; } template constexpr BitSetT &BitSetT::operator^=(BitsT value) { - mBits ^= value & Mask(N); + mBits ^= value; + ASSERT(mBits == (mBits & Mask(N))); return *this; } template constexpr BitSetT BitSetT::operator<<(std::size_t pos) const @@ -297,11 +309,11 @@ } template constexpr BitSetT &BitSetT::operator<<=(std::size_t pos) { - mBits = (mBits << pos & Mask(N)); + mBits = mBits << pos & Mask(N); return *this; } template constexpr BitSetT BitSetT::operator>>(std::size_t pos) const @@ -310,11 +322,11 @@ } template constexpr BitSetT &BitSetT::operator>>=(std::size_t pos) { - mBits = ((mBits >> pos) & Mask(N)); + mBits = (mBits >> pos) & Mask(N); return *this; } template constexpr BitSetT &BitSetT::set() @@ -325,19 +337,20 @@ } template constexpr BitSetT &BitSetT::set(ParamT pos, bool value) { - ASSERT(mBits == (mBits & Mask(N))); + ASSERT(static_cast(pos) < N); if (value) { - mBits |= Bit(pos) & Mask(N); + mBits |= Bit(pos); } else { reset(pos); } + ASSERT(mBits == (mBits & Mask(N))); return *this; } template constexpr BitSetT &BitSetT::reset() @@ -348,10 +361,11 @@ } template constexpr BitSetT &BitSetT::reset(ParamT pos) { + ASSERT(static_cast(pos) < N); ASSERT(mBits == (mBits & Mask(N))); mBits &= ~Bit(pos); return *this; } @@ -364,12 +378,13 @@ } template constexpr BitSetT &BitSetT::flip(ParamT pos) { + ASSERT(static_cast(pos) < N); + mBits ^= Bit(pos); ASSERT(mBits == (mBits & Mask(N))); - mBits ^= Bit(pos) & Mask(N); return *this; } template constexpr ParamT BitSetT::first() const @@ -726,17 +741,18 @@ template typename BitSetArray::Iterator &BitSetArray::Iterator::operator++() { ++mCurrentIterator; - if (mCurrentIterator == mCurrentParent->mBaseBitSetArray[mIndex].end()) + while (mCurrentIterator == mCurrentParent->mBaseBitSetArray[mIndex].end()) { mIndex++; - if (mIndex < mCurrentParent->kArraySize) + if (mIndex >= mCurrentParent->kArraySize) { - mCurrentIterator = mCurrentParent->mBaseBitSetArray[mIndex].begin(); + break; } + mCurrentIterator = mCurrentParent->mBaseBitSetArray[mIndex].begin(); } return *this; } template diff --git a/gfx/angle/checkout/src/common/debug.h b/gfx/angle/checkout/src/common/debug.h --- a/gfx/angle/checkout/src/common/debug.h +++ b/gfx/angle/checkout/src/common/debug.h @@ -21,20 +21,26 @@ #include "common/angleutils.h" #include "common/entry_points_enum_autogen.h" #include "common/platform.h" +#if defined(ANGLE_PLATFORM_WINDOWS) +# include +typedef unsigned long DWORD; +typedef _Return_type_success_(return >= 0) long HRESULT; +#endif + #if !defined(TRACE_OUTPUT_FILE) # define TRACE_OUTPUT_FILE "angle_debug.txt" #endif namespace gl { class Context; -// Pairs a D3D begin event with an end event. -class ScopedPerfEventHelper : angle::NonCopyable +// Pairs a begin event with an end event. +class ANGLE_NO_DISCARD ScopedPerfEventHelper : angle::NonCopyable { public: ScopedPerfEventHelper(Context *context, angle::EntryPoint entryPoint); ~ScopedPerfEventHelper(); ANGLE_FORMAT_PRINTF(2, 3) @@ -42,10 +48,11 @@ private: gl::Context *mContext; const angle::EntryPoint mEntryPoint; const char *mFunctionName; + bool mCalledBeginEvent; }; using LogSeverity = int; // Note: the log severities are used to index into the array of names, // see g_logSeverityNames. @@ -132,73 +139,84 @@ extern std::ostream *gSwallowStream; // Used by ANGLE_LOG_IS_ON to lazy-evaluate stream arguments. bool ShouldCreatePlatformLogMessage(LogSeverity severity); -template -std::ostream &FmtHex(std::ostream &os, T value) +// N is the width of the output to the stream. The output is padded with zeros +// if value is less than N characters. +// S is the stream type, either ostream for ANSI or wostream for wide character. +// T is the type of the value to output to the stream. +// C is the type of characters - either char for ANSI or wchar_t for wide char. +template +S &FmtHex(S &stream, T value, const C *zeroX, C zero) { - os << "0x"; + stream << zeroX; - std::ios_base::fmtflags oldFlags = os.flags(); - std::streamsize oldWidth = os.width(); - std::ostream::char_type oldFill = os.fill(); + std::ios_base::fmtflags oldFlags = stream.flags(); + std::streamsize oldWidth = stream.width(); + typename S::char_type oldFill = stream.fill(); - os << std::hex << std::uppercase << std::setw(N) << std::setfill('0') << value; + stream << std::hex << std::uppercase << std::setw(N) << std::setfill(zero) << value; - os.flags(oldFlags); - os.width(oldWidth); - os.fill(oldFill); + stream.flags(oldFlags); + stream.width(oldWidth); + stream.fill(oldFill); - return os; + return stream; } -template -std::ostream &FmtHexAutoSized(std::ostream &os, T value) +template +S &FmtHexAutoSized(S &stream, T value, const C *prefix, const C *zeroX, C zero) { + if (prefix) + { + stream << prefix; + } + constexpr int N = sizeof(T) * 2; - return priv::FmtHex(os, value); + return priv::FmtHex(stream, value, zeroX, zero); } -template +template class FmtHexHelper { public: - FmtHexHelper(const char *prefix, T value) : mPrefix(prefix), mValue(value) {} + FmtHexHelper(const C *prefix, T value) : mPrefix(prefix), mValue(value) {} explicit FmtHexHelper(T value) : mPrefix(nullptr), mValue(value) {} private: - const char *mPrefix; + const C *mPrefix; T mValue; friend std::ostream &operator<<(std::ostream &os, const FmtHexHelper &fmt) { - if (fmt.mPrefix) - { - os << fmt.mPrefix; - } - return FmtHexAutoSized(os, fmt.mValue); + return FmtHexAutoSized(os, fmt.mValue, fmt.mPrefix, "0x", '0'); + } + + friend std::wostream &operator<<(std::wostream &wos, const FmtHexHelper &fmt) + { + return FmtHexAutoSized(wos, fmt.mValue, fmt.mPrefix, L"0x", L'0'); } }; } // namespace priv -template -priv::FmtHexHelper FmtHex(T value) +template +priv::FmtHexHelper FmtHex(T value) { - return priv::FmtHexHelper(value); + return priv::FmtHexHelper(value); } #if defined(ANGLE_PLATFORM_WINDOWS) -priv::FmtHexHelper FmtHR(HRESULT value); -priv::FmtHexHelper FmtErr(DWORD value); +priv::FmtHexHelper FmtHR(HRESULT value); +priv::FmtHexHelper FmtErr(DWORD value); #endif // defined(ANGLE_PLATFORM_WINDOWS) template std::ostream &FmtHex(std::ostream &os, T value) { - return priv::FmtHexAutoSized(os, value); + return priv::FmtHexAutoSized(os, value, "", "0x", '0'); } // A few definitions of macros that don't generate much code. These are used // by ANGLE_LOG(). Since these are used all over our code, it's // better to have compact code for these operations. @@ -242,11 +260,11 @@ #if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS) # define ANGLE_TRACE_ENABLED #endif -#if !defined(NDEBUG) || defined(ANGLE_ENABLE_RELEASE_ASSERTS) +#if !defined(NDEBUG) || defined(ANGLE_ASSERT_ALWAYS_ON) # define ANGLE_ENABLE_ASSERTS #endif #define INFO() ANGLE_LOG(INFO) #define WARN() ANGLE_LOG(WARN) @@ -439,20 +457,10 @@ # define ANGLE_DISABLE_DESTRUCTOR_OVERRIDE_WARNING # define ANGLE_REENABLE_DESTRUCTOR_OVERRIDE_WARNING #endif #if defined(__clang__) -# define ANGLE_DISABLE_WEAK_TEMPLATE_VTABLES_WARNING \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wweak-template-vtables\"") -# define ANGLE_REENABLE_WEAK_TEMPLATE_VTABLES_WARNING _Pragma("clang diagnostic pop") -#else -# define ANGLE_DISABLE_WEAK_TEMPLATE_VTABLES_WARNING -# define ANGLE_REENABLE_WEAK_TEMPLATE_VTABLES_WARNING -#endif - -#if defined(__clang__) # define ANGLE_DISABLE_UNUSED_FUNCTION_WARNING \ _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wunused-function\"") # define ANGLE_REENABLE_UNUSED_FUNCTION_WARNING _Pragma("clang diagnostic pop") #else # define ANGLE_DISABLE_UNUSED_FUNCTION_WARNING diff --git a/gfx/angle/checkout/src/common/debug.cpp b/gfx/angle/checkout/src/common/debug.cpp --- a/gfx/angle/checkout/src/common/debug.cpp +++ b/gfx/angle/checkout/src/common/debug.cpp @@ -23,10 +23,14 @@ #if defined(ANGLE_PLATFORM_APPLE) # include #endif +#if defined(ANGLE_PLATFORM_WINDOWS) +# include +#endif + #include "anglebase/no_destructor.h" #include "common/Optional.h" #include "common/angleutils.h" #include "common/entry_points_enum_autogen.h" #include "common/system_utils.h" @@ -128,17 +132,19 @@ ASSERT(g_debugMutex); return *g_debugMutex; } ScopedPerfEventHelper::ScopedPerfEventHelper(gl::Context *context, angle::EntryPoint entryPoint) - : mContext(context), mEntryPoint(entryPoint), mFunctionName(nullptr) + : mContext(context), mEntryPoint(entryPoint), mFunctionName(nullptr), mCalledBeginEvent(false) {} ScopedPerfEventHelper::~ScopedPerfEventHelper() { - // EGL_Terminate() can set g_debugAnnotator to nullptr; must call DebugAnnotationsActive() here - if (mFunctionName && DebugAnnotationsActive()) + // EGL_Initialize() and EGL_Terminate() can change g_debugAnnotator. Must check the value of + // g_debugAnnotator and whether ScopedPerfEventHelper::begin() initiated a begine that must be + // ended now. + if (DebugAnnotationsInitialized() && mCalledBeginEvent) { g_debugAnnotator->endEvent(mContext, mFunctionName, mEntryPoint); } } @@ -154,10 +160,11 @@ va_end(vararg); ANGLE_LOG(EVENT) << std::string(&buffer[0], len); if (DebugAnnotationsInitialized()) { + mCalledBeginEvent = true; g_debugAnnotator->beginEvent(mContext, mEntryPoint, mFunctionName, buffer.data()); } } LogMessage::LogMessage(const char *file, const char *function, int line, LogSeverity severity) @@ -223,11 +230,11 @@ break; } } if (severity == LOG_FATAL || severity == LOG_ERR || severity == LOG_WARN || -#if defined(ANGLE_ENABLE_TRACE_ANDROID_LOGCAT) +#if defined(ANGLE_ENABLE_TRACE_ANDROID_LOGCAT) || defined(ANGLE_ENABLE_TRACE_EVENTS) severity == LOG_EVENT || #endif severity == LOG_INFO) { #if defined(ANGLE_PLATFORM_ANDROID) @@ -324,17 +331,17 @@ { return mStream.str(); } #if defined(ANGLE_PLATFORM_WINDOWS) -priv::FmtHexHelper FmtHR(HRESULT value) +priv::FmtHexHelper FmtHR(HRESULT value) { - return priv::FmtHexHelper("HRESULT: ", value); + return priv::FmtHexHelper("HRESULT: ", value); } -priv::FmtHexHelper FmtErr(DWORD value) +priv::FmtHexHelper FmtErr(DWORD value) { - return priv::FmtHexHelper("error: ", value); + return priv::FmtHexHelper("error: ", value); } #endif // defined(ANGLE_PLATFORM_WINDOWS) } // namespace gl diff --git a/gfx/angle/checkout/src/common/entry_points_enum_autogen.h b/gfx/angle/checkout/src/common/entry_points_enum_autogen.h --- a/gfx/angle/checkout/src/common/entry_points_enum_autogen.h +++ b/gfx/angle/checkout/src/common/entry_points_enum_autogen.h @@ -160,10 +160,12 @@ EGLDestroyStreamKHR, EGLDestroySurface, EGLDestroySync, EGLDestroySyncKHR, EGLDupNativeFenceFDANDROID, + EGLExportVkImageANGLE, + EGLForceGPUSwitchANGLE, EGLGetCompositorTimingANDROID, EGLGetCompositorTimingSupportedANDROID, EGLGetConfigAttrib, EGLGetConfigs, EGLGetCurrentContext, @@ -183,12 +185,14 @@ EGLGetSyncAttribKHR, EGLGetSyncValuesCHROMIUM, EGLHandleGPUSwitchANGLE, EGLInitialize, EGLLabelObjectKHR, + EGLLockSurfaceKHR, EGLMakeCurrent, EGLPostSubBufferNV, + EGLPrepareSwapBuffersANGLE, EGLPresentationTimeANDROID, EGLProgramCacheGetAttribANGLE, EGLProgramCachePopulateANGLE, EGLProgramCacheQueryANGLE, EGLProgramCacheResizeANGLE, @@ -197,22 +201,26 @@ EGLQueryDebugKHR, EGLQueryDeviceAttribEXT, EGLQueryDeviceStringEXT, EGLQueryDisplayAttribANGLE, EGLQueryDisplayAttribEXT, + EGLQueryDmaBufFormatsEXT, + EGLQueryDmaBufModifiersEXT, EGLQueryStreamKHR, EGLQueryStreamu64KHR, EGLQueryString, EGLQueryStringiANGLE, EGLQuerySurface, + EGLQuerySurface64KHR, EGLQuerySurfacePointerANGLE, EGLReacquireHighPowerGPUANGLE, EGLReleaseDeviceANGLE, EGLReleaseHighPowerGPUANGLE, EGLReleaseTexImage, EGLReleaseThread, EGLSetBlobCacheFuncsANDROID, + EGLSetDamageRegionKHR, EGLSignalSyncKHR, EGLStreamAttribKHR, EGLStreamConsumerAcquireKHR, EGLStreamConsumerGLTextureExternalAttribsNV, EGLStreamConsumerGLTextureExternalKHR, @@ -222,26 +230,29 @@ EGLSwapBuffers, EGLSwapBuffersWithDamageKHR, EGLSwapBuffersWithFrameTokenANGLE, EGLSwapInterval, EGLTerminate, + EGLUnlockSurfaceKHR, EGLWaitClient, EGLWaitGL, EGLWaitNative, EGLWaitSync, EGLWaitSyncKHR, GLAccum, + GLAcquireTexturesANGLE, GLActiveShaderProgram, GLActiveShaderProgramEXT, GLActiveTexture, GLAlphaFunc, GLAlphaFuncx, GLAreTexturesResident, GLArrayElement, GLAttachShader, GLBegin, GLBeginConditionalRender, + GLBeginPerfMonitorAMD, GLBeginQuery, GLBeginQueryEXT, GLBeginQueryIndexed, GLBeginTransformFeedback, GLBindAttribLocation, @@ -445,10 +456,11 @@ GLDeleteFencesNV, GLDeleteFramebuffers, GLDeleteFramebuffersOES, GLDeleteLists, GLDeleteMemoryObjectsEXT, + GLDeletePerfMonitorsAMD, GLDeleteProgram, GLDeleteProgramPipelines, GLDeleteProgramPipelinesEXT, GLDeleteQueries, GLDeleteQueriesEXT, @@ -521,11 +533,13 @@ GLDrawTransformFeedback, GLDrawTransformFeedbackInstanced, GLDrawTransformFeedbackStream, GLDrawTransformFeedbackStreamInstanced, GLEGLImageTargetRenderbufferStorageOES, + GLEGLImageTargetTexStorageEXT, GLEGLImageTargetTexture2DOES, + GLEGLImageTargetTextureStorageEXT, GLEdgeFlag, GLEdgeFlagPointer, GLEdgeFlagv, GLEnable, GLEnableClientState, @@ -535,10 +549,11 @@ GLEnableiEXT, GLEnableiOES, GLEnd, GLEndConditionalRender, GLEndList, + GLEndPerfMonitorAMD, GLEndQuery, GLEndQueryEXT, GLEndQueryIndexed, GLEndTransformFeedback, GLEvalCoord1d, @@ -572,10 +587,11 @@ GLFogiv, GLFogx, GLFogxv, GLFramebufferFetchBarrierEXT, GLFramebufferParameteri, + GLFramebufferParameteriMESA, GLFramebufferRenderbuffer, GLFramebufferRenderbufferOES, GLFramebufferTexture, GLFramebufferTexture1D, GLFramebufferTexture2D, @@ -584,19 +600,21 @@ GLFramebufferTexture3D, GLFramebufferTexture3DOES, GLFramebufferTextureEXT, GLFramebufferTextureLayer, GLFramebufferTextureMultiviewOVR, + GLFramebufferTextureOES, GLFrontFace, GLFrustum, GLFrustumf, GLFrustumx, GLGenBuffers, GLGenFencesNV, GLGenFramebuffers, GLGenFramebuffersOES, GLGenLists, + GLGenPerfMonitorsAMD, GLGenProgramPipelines, GLGenProgramPipelinesEXT, GLGenQueries, GLGenQueriesEXT, GLGenRenderbuffers, @@ -637,10 +655,11 @@ GLGetBufferSubData, GLGetClipPlane, GLGetClipPlanef, GLGetClipPlanex, GLGetCompressedTexImage, + GLGetCompressedTexImageANGLE, GLGetCompressedTextureImage, GLGetCompressedTextureSubImage, GLGetDebugMessageLog, GLGetDebugMessageLogKHR, GLGetDoublei_v, @@ -656,10 +675,11 @@ GLGetFragDataLocation, GLGetFramebufferAttachmentParameteriv, GLGetFramebufferAttachmentParameterivOES, GLGetFramebufferAttachmentParameterivRobustANGLE, GLGetFramebufferParameteriv, + GLGetFramebufferParameterivMESA, GLGetFramebufferParameterivRobustANGLE, GLGetGraphicsResetStatus, GLGetGraphicsResetStatusEXT, GLGetInteger64i_v, GLGetInteger64i_vRobustANGLE, @@ -696,10 +716,16 @@ GLGetObjectLabel, GLGetObjectLabelEXT, GLGetObjectLabelKHR, GLGetObjectPtrLabel, GLGetObjectPtrLabelKHR, + GLGetPerfMonitorCounterDataAMD, + GLGetPerfMonitorCounterInfoAMD, + GLGetPerfMonitorCounterStringAMD, + GLGetPerfMonitorCountersAMD, + GLGetPerfMonitorGroupStringAMD, + GLGetPerfMonitorGroupsAMD, GLGetPixelMapfv, GLGetPixelMapuiv, GLGetPixelMapusv, GLGetPointerv, GLGetPointervKHR, @@ -982,18 +1008,20 @@ GLMultTransposeMatrixf, GLMultiDrawArrays, GLMultiDrawArraysANGLE, GLMultiDrawArraysIndirect, GLMultiDrawArraysIndirectCount, + GLMultiDrawArraysIndirectEXT, GLMultiDrawArraysInstancedANGLE, GLMultiDrawArraysInstancedBaseInstanceANGLE, GLMultiDrawElements, GLMultiDrawElementsANGLE, GLMultiDrawElementsBaseVertex, GLMultiDrawElementsBaseVertexEXT, GLMultiDrawElementsIndirect, GLMultiDrawElementsIndirectCount, + GLMultiDrawElementsIndirectEXT, GLMultiDrawElementsInstancedANGLE, GLMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE, GLMultiTexCoord1d, GLMultiTexCoord1dv, GLMultiTexCoord1f, @@ -1104,10 +1132,11 @@ GLPopGroupMarkerEXT, GLPopMatrix, GLPopName, GLPrimitiveBoundingBox, GLPrimitiveBoundingBoxEXT, + GLPrimitiveBoundingBoxOES, GLPrimitiveRestartIndex, GLPrioritizeTextures, GLProgramBinary, GLProgramBinaryOES, GLProgramParameteri, @@ -1244,10 +1273,11 @@ GLRecti, GLRectiv, GLRects, GLRectsv, GLReleaseShaderCompiler, + GLReleaseTexturesANGLE, GLRenderMode, GLRenderbufferStorage, GLRenderbufferStorageMultisample, GLRenderbufferStorageMultisampleANGLE, GLRenderbufferStorageMultisampleEXT, @@ -1300,10 +1330,11 @@ GLSecondaryColor3usv, GLSecondaryColorP3ui, GLSecondaryColorP3uiv, GLSecondaryColorPointer, GLSelectBuffer, + GLSelectPerfMonitorCountersAMD, GLSemaphoreParameterui64vEXT, GLSetFenceNV, GLShadeModel, GLShaderBinary, GLShaderSource, diff --git a/gfx/angle/checkout/src/common/entry_points_enum_autogen.cpp b/gfx/angle/checkout/src/common/entry_points_enum_autogen.cpp --- a/gfx/angle/checkout/src/common/entry_points_enum_autogen.cpp +++ b/gfx/angle/checkout/src/common/entry_points_enum_autogen.cpp @@ -310,10 +310,14 @@ return "eglDestroySync"; case EntryPoint::EGLDestroySyncKHR: return "eglDestroySyncKHR"; case EntryPoint::EGLDupNativeFenceFDANDROID: return "eglDupNativeFenceFDANDROID"; + case EntryPoint::EGLExportVkImageANGLE: + return "eglExportVkImageANGLE"; + case EntryPoint::EGLForceGPUSwitchANGLE: + return "eglForceGPUSwitchANGLE"; case EntryPoint::EGLGetCompositorTimingANDROID: return "eglGetCompositorTimingANDROID"; case EntryPoint::EGLGetCompositorTimingSupportedANDROID: return "eglGetCompositorTimingSupportedANDROID"; case EntryPoint::EGLGetConfigAttrib: @@ -356,14 +360,18 @@ return "eglHandleGPUSwitchANGLE"; case EntryPoint::EGLInitialize: return "eglInitialize"; case EntryPoint::EGLLabelObjectKHR: return "eglLabelObjectKHR"; + case EntryPoint::EGLLockSurfaceKHR: + return "eglLockSurfaceKHR"; case EntryPoint::EGLMakeCurrent: return "eglMakeCurrent"; case EntryPoint::EGLPostSubBufferNV: return "eglPostSubBufferNV"; + case EntryPoint::EGLPrepareSwapBuffersANGLE: + return "eglPrepareSwapBuffersANGLE"; case EntryPoint::EGLPresentationTimeANDROID: return "eglPresentationTimeANDROID"; case EntryPoint::EGLProgramCacheGetAttribANGLE: return "eglProgramCacheGetAttribANGLE"; case EntryPoint::EGLProgramCachePopulateANGLE: @@ -384,20 +392,26 @@ return "eglQueryDeviceStringEXT"; case EntryPoint::EGLQueryDisplayAttribANGLE: return "eglQueryDisplayAttribANGLE"; case EntryPoint::EGLQueryDisplayAttribEXT: return "eglQueryDisplayAttribEXT"; + case EntryPoint::EGLQueryDmaBufFormatsEXT: + return "eglQueryDmaBufFormatsEXT"; + case EntryPoint::EGLQueryDmaBufModifiersEXT: + return "eglQueryDmaBufModifiersEXT"; case EntryPoint::EGLQueryStreamKHR: return "eglQueryStreamKHR"; case EntryPoint::EGLQueryStreamu64KHR: return "eglQueryStreamu64KHR"; case EntryPoint::EGLQueryString: return "eglQueryString"; case EntryPoint::EGLQueryStringiANGLE: return "eglQueryStringiANGLE"; case EntryPoint::EGLQuerySurface: return "eglQuerySurface"; + case EntryPoint::EGLQuerySurface64KHR: + return "eglQuerySurface64KHR"; case EntryPoint::EGLQuerySurfacePointerANGLE: return "eglQuerySurfacePointerANGLE"; case EntryPoint::EGLReacquireHighPowerGPUANGLE: return "eglReacquireHighPowerGPUANGLE"; case EntryPoint::EGLReleaseDeviceANGLE: @@ -408,10 +422,12 @@ return "eglReleaseTexImage"; case EntryPoint::EGLReleaseThread: return "eglReleaseThread"; case EntryPoint::EGLSetBlobCacheFuncsANDROID: return "eglSetBlobCacheFuncsANDROID"; + case EntryPoint::EGLSetDamageRegionKHR: + return "eglSetDamageRegionKHR"; case EntryPoint::EGLSignalSyncKHR: return "eglSignalSyncKHR"; case EntryPoint::EGLStreamAttribKHR: return "eglStreamAttribKHR"; case EntryPoint::EGLStreamConsumerAcquireKHR: @@ -434,10 +450,12 @@ return "eglSwapBuffersWithFrameTokenANGLE"; case EntryPoint::EGLSwapInterval: return "eglSwapInterval"; case EntryPoint::EGLTerminate: return "eglTerminate"; + case EntryPoint::EGLUnlockSurfaceKHR: + return "eglUnlockSurfaceKHR"; case EntryPoint::EGLWaitClient: return "eglWaitClient"; case EntryPoint::EGLWaitGL: return "eglWaitGL"; case EntryPoint::EGLWaitNative: @@ -446,10 +464,12 @@ return "eglWaitSync"; case EntryPoint::EGLWaitSyncKHR: return "eglWaitSyncKHR"; case EntryPoint::GLAccum: return "glAccum"; + case EntryPoint::GLAcquireTexturesANGLE: + return "glAcquireTexturesANGLE"; case EntryPoint::GLActiveShaderProgram: return "glActiveShaderProgram"; case EntryPoint::GLActiveShaderProgramEXT: return "glActiveShaderProgramEXT"; case EntryPoint::GLActiveTexture: @@ -466,10 +486,12 @@ return "glAttachShader"; case EntryPoint::GLBegin: return "glBegin"; case EntryPoint::GLBeginConditionalRender: return "glBeginConditionalRender"; + case EntryPoint::GLBeginPerfMonitorAMD: + return "glBeginPerfMonitorAMD"; case EntryPoint::GLBeginQuery: return "glBeginQuery"; case EntryPoint::GLBeginQueryEXT: return "glBeginQueryEXT"; case EntryPoint::GLBeginQueryIndexed: @@ -880,10 +902,12 @@ return "glDeleteFramebuffersOES"; case EntryPoint::GLDeleteLists: return "glDeleteLists"; case EntryPoint::GLDeleteMemoryObjectsEXT: return "glDeleteMemoryObjectsEXT"; + case EntryPoint::GLDeletePerfMonitorsAMD: + return "glDeletePerfMonitorsAMD"; case EntryPoint::GLDeleteProgram: return "glDeleteProgram"; case EntryPoint::GLDeleteProgramPipelines: return "glDeleteProgramPipelines"; case EntryPoint::GLDeleteProgramPipelinesEXT: @@ -1032,12 +1056,16 @@ return "glDrawTransformFeedbackStream"; case EntryPoint::GLDrawTransformFeedbackStreamInstanced: return "glDrawTransformFeedbackStreamInstanced"; case EntryPoint::GLEGLImageTargetRenderbufferStorageOES: return "glEGLImageTargetRenderbufferStorageOES"; + case EntryPoint::GLEGLImageTargetTexStorageEXT: + return "glEGLImageTargetTexStorageEXT"; case EntryPoint::GLEGLImageTargetTexture2DOES: return "glEGLImageTargetTexture2DOES"; + case EntryPoint::GLEGLImageTargetTextureStorageEXT: + return "glEGLImageTargetTextureStorageEXT"; case EntryPoint::GLEdgeFlag: return "glEdgeFlag"; case EntryPoint::GLEdgeFlagPointer: return "glEdgeFlagPointer"; case EntryPoint::GLEdgeFlagv: @@ -1060,10 +1088,12 @@ return "glEnd"; case EntryPoint::GLEndConditionalRender: return "glEndConditionalRender"; case EntryPoint::GLEndList: return "glEndList"; + case EntryPoint::GLEndPerfMonitorAMD: + return "glEndPerfMonitorAMD"; case EntryPoint::GLEndQuery: return "glEndQuery"; case EntryPoint::GLEndQueryEXT: return "glEndQueryEXT"; case EntryPoint::GLEndQueryIndexed: @@ -1134,10 +1164,12 @@ return "glFogxv"; case EntryPoint::GLFramebufferFetchBarrierEXT: return "glFramebufferFetchBarrierEXT"; case EntryPoint::GLFramebufferParameteri: return "glFramebufferParameteri"; + case EntryPoint::GLFramebufferParameteriMESA: + return "glFramebufferParameteriMESA"; case EntryPoint::GLFramebufferRenderbuffer: return "glFramebufferRenderbuffer"; case EntryPoint::GLFramebufferRenderbufferOES: return "glFramebufferRenderbufferOES"; case EntryPoint::GLFramebufferTexture: @@ -1158,10 +1190,12 @@ return "glFramebufferTextureEXT"; case EntryPoint::GLFramebufferTextureLayer: return "glFramebufferTextureLayer"; case EntryPoint::GLFramebufferTextureMultiviewOVR: return "glFramebufferTextureMultiviewOVR"; + case EntryPoint::GLFramebufferTextureOES: + return "glFramebufferTextureOES"; case EntryPoint::GLFrontFace: return "glFrontFace"; case EntryPoint::GLFrustum: return "glFrustum"; case EntryPoint::GLFrustumf: @@ -1176,10 +1210,12 @@ return "glGenFramebuffers"; case EntryPoint::GLGenFramebuffersOES: return "glGenFramebuffersOES"; case EntryPoint::GLGenLists: return "glGenLists"; + case EntryPoint::GLGenPerfMonitorsAMD: + return "glGenPerfMonitorsAMD"; case EntryPoint::GLGenProgramPipelines: return "glGenProgramPipelines"; case EntryPoint::GLGenProgramPipelinesEXT: return "glGenProgramPipelinesEXT"; case EntryPoint::GLGenQueries: @@ -1264,10 +1300,12 @@ return "glGetClipPlanef"; case EntryPoint::GLGetClipPlanex: return "glGetClipPlanex"; case EntryPoint::GLGetCompressedTexImage: return "glGetCompressedTexImage"; + case EntryPoint::GLGetCompressedTexImageANGLE: + return "glGetCompressedTexImageANGLE"; case EntryPoint::GLGetCompressedTextureImage: return "glGetCompressedTextureImage"; case EntryPoint::GLGetCompressedTextureSubImage: return "glGetCompressedTextureSubImage"; case EntryPoint::GLGetDebugMessageLog: @@ -1302,10 +1340,12 @@ return "glGetFramebufferAttachmentParameterivOES"; case EntryPoint::GLGetFramebufferAttachmentParameterivRobustANGLE: return "glGetFramebufferAttachmentParameterivRobustANGLE"; case EntryPoint::GLGetFramebufferParameteriv: return "glGetFramebufferParameteriv"; + case EntryPoint::GLGetFramebufferParameterivMESA: + return "glGetFramebufferParameterivMESA"; case EntryPoint::GLGetFramebufferParameterivRobustANGLE: return "glGetFramebufferParameterivRobustANGLE"; case EntryPoint::GLGetGraphicsResetStatus: return "glGetGraphicsResetStatus"; case EntryPoint::GLGetGraphicsResetStatusEXT: @@ -1382,10 +1422,22 @@ return "glGetObjectLabelKHR"; case EntryPoint::GLGetObjectPtrLabel: return "glGetObjectPtrLabel"; case EntryPoint::GLGetObjectPtrLabelKHR: return "glGetObjectPtrLabelKHR"; + case EntryPoint::GLGetPerfMonitorCounterDataAMD: + return "glGetPerfMonitorCounterDataAMD"; + case EntryPoint::GLGetPerfMonitorCounterInfoAMD: + return "glGetPerfMonitorCounterInfoAMD"; + case EntryPoint::GLGetPerfMonitorCounterStringAMD: + return "glGetPerfMonitorCounterStringAMD"; + case EntryPoint::GLGetPerfMonitorCountersAMD: + return "glGetPerfMonitorCountersAMD"; + case EntryPoint::GLGetPerfMonitorGroupStringAMD: + return "glGetPerfMonitorGroupStringAMD"; + case EntryPoint::GLGetPerfMonitorGroupsAMD: + return "glGetPerfMonitorGroupsAMD"; case EntryPoint::GLGetPixelMapfv: return "glGetPixelMapfv"; case EntryPoint::GLGetPixelMapuiv: return "glGetPixelMapuiv"; case EntryPoint::GLGetPixelMapusv: @@ -1954,10 +2006,12 @@ return "glMultiDrawArraysANGLE"; case EntryPoint::GLMultiDrawArraysIndirect: return "glMultiDrawArraysIndirect"; case EntryPoint::GLMultiDrawArraysIndirectCount: return "glMultiDrawArraysIndirectCount"; + case EntryPoint::GLMultiDrawArraysIndirectEXT: + return "glMultiDrawArraysIndirectEXT"; case EntryPoint::GLMultiDrawArraysInstancedANGLE: return "glMultiDrawArraysInstancedANGLE"; case EntryPoint::GLMultiDrawArraysInstancedBaseInstanceANGLE: return "glMultiDrawArraysInstancedBaseInstanceANGLE"; case EntryPoint::GLMultiDrawElements: @@ -1970,10 +2024,12 @@ return "glMultiDrawElementsBaseVertexEXT"; case EntryPoint::GLMultiDrawElementsIndirect: return "glMultiDrawElementsIndirect"; case EntryPoint::GLMultiDrawElementsIndirectCount: return "glMultiDrawElementsIndirectCount"; + case EntryPoint::GLMultiDrawElementsIndirectEXT: + return "glMultiDrawElementsIndirectEXT"; case EntryPoint::GLMultiDrawElementsInstancedANGLE: return "glMultiDrawElementsInstancedANGLE"; case EntryPoint::GLMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE: return "glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE"; case EntryPoint::GLMultiTexCoord1d: @@ -2198,10 +2254,12 @@ return "glPopName"; case EntryPoint::GLPrimitiveBoundingBox: return "glPrimitiveBoundingBox"; case EntryPoint::GLPrimitiveBoundingBoxEXT: return "glPrimitiveBoundingBoxEXT"; + case EntryPoint::GLPrimitiveBoundingBoxOES: + return "glPrimitiveBoundingBoxOES"; case EntryPoint::GLPrimitiveRestartIndex: return "glPrimitiveRestartIndex"; case EntryPoint::GLPrioritizeTextures: return "glPrioritizeTextures"; case EntryPoint::GLProgramBinary: @@ -2478,10 +2536,12 @@ return "glRects"; case EntryPoint::GLRectsv: return "glRectsv"; case EntryPoint::GLReleaseShaderCompiler: return "glReleaseShaderCompiler"; + case EntryPoint::GLReleaseTexturesANGLE: + return "glReleaseTexturesANGLE"; case EntryPoint::GLRenderMode: return "glRenderMode"; case EntryPoint::GLRenderbufferStorage: return "glRenderbufferStorage"; case EntryPoint::GLRenderbufferStorageMultisample: @@ -2590,10 +2650,12 @@ return "glSecondaryColorP3uiv"; case EntryPoint::GLSecondaryColorPointer: return "glSecondaryColorPointer"; case EntryPoint::GLSelectBuffer: return "glSelectBuffer"; + case EntryPoint::GLSelectPerfMonitorCountersAMD: + return "glSelectPerfMonitorCountersAMD"; case EntryPoint::GLSemaphoreParameterui64vEXT: return "glSemaphoreParameterui64vEXT"; case EntryPoint::GLSetFenceNV: return "glSetFenceNV"; case EntryPoint::GLShadeModel: diff --git a/gfx/angle/checkout/src/common/mathutil.h b/gfx/angle/checkout/src/common/mathutil.h --- a/gfx/angle/checkout/src/common/mathutil.h +++ b/gfx/angle/checkout/src/common/mathutil.h @@ -117,10 +117,42 @@ { // Since NaNs fail all comparison tests, a NaN value will default to min return x > min ? (x > max ? max : x) : min; } +template +T clampForBitCount(T value, size_t bitCount) +{ + static_assert(std::numeric_limits::is_integer, "T must be an integer."); + + if (bitCount == 0) + { + constexpr T kZero = 0; + return kZero; + } + ASSERT(bitCount <= sizeof(T) * 8); + + constexpr bool kIsSigned = std::numeric_limits::is_signed; + ASSERT((bitCount > 1) || !kIsSigned); + + T min = 0; + T max = 0; + if (bitCount == sizeof(T) * 8) + { + min = std::numeric_limits::min(); + max = std::numeric_limits::max(); + } + else + { + constexpr T kOne = 1; + min = (kIsSigned) ? -1 * (kOne << (bitCount - 1)) : 0; + max = (kIsSigned) ? (kOne << (bitCount - 1)) - 1 : (kOne << bitCount) - 1; + } + + return gl::clamp(value, min, max); +} + inline float clamp01(float x) { return clamp(x, 0.0f, 1.0f); } @@ -297,10 +329,11 @@ { // The number is too small to be represented as a normalized float11 // Convert it to a denormalized value. const unsigned int shift = (float32ExponentBias - float11ExponentBias) - (float32Val >> float32ExponentFirstBit); + ASSERT(shift < 32); float32Val = ((1 << float32ExponentFirstBit) | (float32Val & float32MantissaMask)) >> shift; } else { @@ -376,10 +409,11 @@ { // The number is too small to be represented as a normalized float10 // Convert it to a denormalized value. const unsigned int shift = (float32ExponentBias - float10ExponentBias) - (float32Val >> float32ExponentFirstBit); + ASSERT(shift < 32); float32Val = ((1 << float32ExponentFirstBit) | (float32Val & float32MantissaMask)) >> shift; } else { @@ -465,13 +499,12 @@ return bitCast(((exponent + 112) << 23) | (mantissa << 18)); } } -// Convers to and from float and 16.16 fixed point format. - -inline float ConvertFixedToFloat(uint32_t fixedInput) +// Converts to and from float and 16.16 fixed point format. +inline float ConvertFixedToFloat(int32_t fixedInput) { return static_cast(fixedInput) / 65536.0f; } inline uint32_t ConvertFloatToFixed(float floatInput) @@ -1376,10 +1409,17 @@ ASSERT(gl::isPow2(alignment)); return (value + alignment - 1) & ~(alignment - 1); } template +constexpr T roundDownPow2(const T value, const T alignment) +{ + ASSERT(gl::isPow2(alignment)); + return value & ~(alignment - 1); +} + +template angle::CheckedNumeric CheckedRoundUp(const T value, const T alignment) { angle::CheckedNumeric checkedValue(value); angle::CheckedNumeric checkedAlignment(alignment); return roundUp(checkedValue, checkedAlignment); diff --git a/gfx/angle/checkout/src/common/platform.h b/gfx/angle/checkout/src/common/platform.h --- a/gfx/angle/checkout/src/common/platform.h +++ b/gfx/angle/checkout/src/common/platform.h @@ -44,11 +44,10 @@ # ifndef NOMINMAX # define NOMINMAX 1 # endif # include -# include # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) # define ANGLE_ENABLE_WINDOWS_UWP 1 # endif @@ -132,30 +131,70 @@ # define ANGLE_PLATFORM_IOS_SIMULATOR 1 # endif # if TARGET_OS_MACCATALYST # define ANGLE_PLATFORM_MACCATALYST 1 # endif +# elif TARGET_OS_WATCH +# define ANGLE_PLATFORM_WATCHOS 1 +# if TARGET_OS_SIMULATOR +# define ANGLE_PLATFORM_IOS_SIMULATOR 1 +# endif +# elif TARGET_OS_TV +# define ANGLE_PLATFORM_APPLETV 1 +# if TARGET_OS_SIMULATOR +# define ANGLE_PLATFORM_IOS_SIMULATOR 1 +# endif # endif # // This might be useful globally. At the moment it is used # // to differentiate MacCatalyst on Intel and Apple Silicon. # if defined(__arm64__) || defined(__aarch64__) # define ANGLE_CPU_ARM64 1 # endif -// EAGL should be enabled on iOS, but not Mac Catalyst unless it is running on Apple Silicon. +# // EAGL should be enabled on iOS, but not Mac Catalyst unless it is running on Apple Silicon. # if (defined(ANGLE_PLATFORM_IOS) && !defined(ANGLE_PLATFORM_MACCATALYST)) || \ (defined(ANGLE_PLATFORM_MACCATALYST) && defined(ANGLE_CPU_ARM64)) # define ANGLE_ENABLE_EAGL # endif +# // Identify Metal API >= what shipped on macOS Catalina. +# if (defined(ANGLE_PLATFORM_MACOS) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500) || \ + (defined(ANGLE_PLATFORM_IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000) +# define ANGLE_WITH_MODERN_METAL_API 1 +# endif #endif // Define ANGLE_WITH_ASAN macro. #if defined(__has_feature) # if __has_feature(address_sanitizer) # define ANGLE_WITH_ASAN 1 # endif #endif +// Define ANGLE_WITH_MSAN macro. +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) +# define ANGLE_WITH_MSAN 1 +# endif +#endif + +// Define ANGLE_WITH_TSAN macro. +#if defined(__has_feature) +# if __has_feature(thread_sanitizer) +# define ANGLE_WITH_TSAN 1 +# endif +#endif + +// Define ANGLE_WITH_UBSAN macro. +#if defined(__has_feature) +# if __has_feature(undefined_behavior_sanitizer) +# define ANGLE_WITH_UBSAN 1 +# endif +#endif + +#if defined(ANGLE_WITH_ASAN) || defined(ANGLE_WITH_TSAN) || defined(ANGLE_WITH_UBSAN) +# define ANGLE_WITH_SANITIZER 1 +#endif // defined(ANGLE_WITH_ASAN) || defined(ANGLE_WITH_TSAN) || defined(ANGLE_WITH_UBSAN) + #include #if INTPTR_MAX == INT64_MAX # define ANGLE_IS_64_BIT_CPU 1 #else # define ANGLE_IS_32_BIT_CPU 1 diff --git a/gfx/angle/checkout/src/common/spirv/spirv_types.h b/gfx/angle/checkout/src/common/spirv/spirv_types.h --- a/gfx/angle/checkout/src/common/spirv/spirv_types.h +++ b/gfx/angle/checkout/src/common/spirv/spirv_types.h @@ -108,10 +108,22 @@ constexpr uint32_t kMinValidId = 1; // The SPIR-V blob is a sequence of uint32_t's using Blob = std::vector; +// Format of the SPIR-V header. +// SPIR-V 1.0 Table 1: First Words of Physical Layout +enum HeaderIndex +{ + kHeaderIndexMagic = 0, + kHeaderIndexVersion = 1, + kHeaderIndexGenerator = 2, + kHeaderIndexIndexBound = 3, + kHeaderIndexSchema = 4, + kHeaderIndexInstructions = 5, +}; + // Returns whether SPIR-V is valid. Useful for ASSERTs. Automatically generates a warning if // SPIR-V is not valid. bool Validate(const Blob &blob); } // namespace spirv diff --git a/gfx/angle/checkout/src/common/string_utils.h b/gfx/angle/checkout/src/common/string_utils.h --- a/gfx/angle/checkout/src/common/string_utils.h +++ b/gfx/angle/checkout/src/common/string_utils.h @@ -80,10 +80,15 @@ // Check if the string str ends with the given suffix. // str and suffix may not be NULL and need to be NULL terminated. // The comparison is case sensitive. bool EndsWith(const char *str, const char *suffix); +// Check if the given token string contains the given token. +// The tokens are separated by the given delimiter. +// The comparison is case sensitive. +bool ContainsToken(const std::string &tokenStr, char delimiter, const std::string &token); + // Convert to lower-case. void ToLower(std::string *str); // Convert to upper-case. void ToUpper(std::string *str); @@ -91,10 +96,15 @@ // Replaces the substring 'substring' in 'str' with 'replacement'. Returns true if successful. bool ReplaceSubstring(std::string *str, const std::string &substring, const std::string &replacement); +// Replaces all substrings 'substring' in 'str' with 'replacement'. Returns count of replacements. +int ReplaceAllSubstrings(std::string *str, + const std::string &substring, + const std::string &replacement); + // Split up a string parsed from an environment variable. std::vector GetStringsFromEnvironmentVarOrAndroidProperty(const char *varName, const char *propertyName, const char *separator); diff --git a/gfx/angle/checkout/src/common/string_utils.cpp b/gfx/angle/checkout/src/common/string_utils.cpp --- a/gfx/angle/checkout/src/common/string_utils.cpp +++ b/gfx/angle/checkout/src/common/string_utils.cpp @@ -204,10 +204,35 @@ bool EndsWith(const char *str, const char *suffix) { return EndsWithSuffix(str, strlen(str), suffix, strlen(suffix)); } +bool ContainsToken(const std::string &tokenStr, char delimiter, const std::string &token) +{ + if (token.empty()) + { + return false; + } + // Compare token with all sub-strings terminated by delimiter or end of string + std::string::size_type start = 0u; + do + { + std::string::size_type end = tokenStr.find(delimiter, start); + if (end == std::string::npos) + { + end = tokenStr.length(); + } + const std::string::size_type length = end - start; + if (length == token.length() && tokenStr.compare(start, length, token) == 0) + { + return true; + } + start = end + 1u; + } while (start < tokenStr.size()); + return false; +} + void ToLower(std::string *str) { for (char &ch : *str) { ch = static_cast(::tolower(ch)); @@ -233,10 +258,22 @@ } str->replace(replacePos, substring.size(), replacement); return true; } +int ReplaceAllSubstrings(std::string *str, + const std::string &substring, + const std::string &replacement) +{ + int count = 0; + while (ReplaceSubstring(str, substring, replacement)) + { + count++; + } + return count; +} + std::vector GetStringsFromEnvironmentVarOrAndroidProperty(const char *varName, const char *propertyName, const char *separator) { std::string environment = GetEnvironmentVarOrAndroidProperty(varName, propertyName); diff --git a/gfx/angle/checkout/src/common/system_utils.h b/gfx/angle/checkout/src/common/system_utils.h --- a/gfx/angle/checkout/src/common/system_utils.h +++ b/gfx/angle/checkout/src/common/system_utils.h @@ -10,35 +10,45 @@ #define COMMON_SYSTEM_UTILS_H_ #include "common/Optional.h" #include "common/angleutils.h" +#include #include +#include namespace angle { std::string GetExecutableName(); std::string GetExecutablePath(); std::string GetExecutableDirectory(); -std::string GetHelperExecutableDir(); +std::string GetModuleDirectory(); const char *GetSharedLibraryExtension(); const char *GetExecutableExtension(); char GetPathSeparator(); Optional GetCWD(); bool SetCWD(const char *dirName); bool SetEnvironmentVar(const char *variableName, const char *value); bool UnsetEnvironmentVar(const char *variableName); +bool GetBoolEnvironmentVar(const char *variableName); std::string GetEnvironmentVar(const char *variableName); std::string GetEnvironmentVarOrUnCachedAndroidProperty(const char *variableName, const char *propertyName); +std::string GetAndSetEnvironmentVarOrUnCachedAndroidProperty(const char *variableName, + const char *propertyName); std::string GetEnvironmentVarOrAndroidProperty(const char *variableName, const char *propertyName); const char *GetPathSeparatorForEnvironmentVar(); bool PrependPathToEnvironmentVar(const char *variableName, const char *path); bool IsDirectory(const char *filename); +bool IsFullPath(std::string dirName); +std::string GetRootDirectory(); +std::string ConcatenatePath(std::string first, std::string second); // Get absolute time in seconds. Use this function to get an absolute time with an unknown origin. -double GetCurrentTime(); +double GetCurrentSystemTime(); +// Get CPU time for current process in seconds. +double GetCurrentProcessCpuTime(); // Run an application and get the output. Gets a nullptr-terminated set of args to execute the // application with, and returns the stdout and stderr outputs as well as the exit code. // // Pass nullptr for stdoutOut/stderrOut if you don't need to capture. exitCodeOut is required. @@ -47,38 +57,159 @@ bool RunApp(const std::vector &args, std::string *stdoutOut, std::string *stderrOut, int *exitCodeOut); +// Use SYSTEM_DIR to bypass loading ANGLE libraries with the same name as system DLLS +// (e.g. opengl32.dll) +enum class SearchType +{ + // Try to find the library in the same directory as the current module + ModuleDir, + // Load the library from the system directories + SystemDir, + // Get a reference to an already loaded shared library. + AlreadyLoaded, +}; + +void *OpenSystemLibrary(const char *libraryName, SearchType searchType); +void *OpenSystemLibraryWithExtension(const char *libraryName, SearchType searchType); +void *OpenSystemLibraryAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut); +void *OpenSystemLibraryWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut); + +void *GetLibrarySymbol(void *libraryHandle, const char *symbolName); +std::string GetLibraryPath(void *libraryHandle); +void CloseSystemLibrary(void *libraryHandle); + class Library : angle::NonCopyable { public: - virtual ~Library() {} - virtual void *getSymbol(const char *symbolName) = 0; - virtual void *getNative() const = 0; + Library() {} + Library(void *libraryHandle) : mLibraryHandle(libraryHandle) {} + ~Library() { close(); } + + ANGLE_NO_DISCARD bool open(const char *libraryName, SearchType searchType) + { + close(); + mLibraryHandle = OpenSystemLibrary(libraryName, searchType); + return mLibraryHandle != nullptr; + } + + ANGLE_NO_DISCARD bool openWithExtension(const char *libraryName, SearchType searchType) + { + close(); + mLibraryHandle = OpenSystemLibraryWithExtension(libraryName, searchType); + return mLibraryHandle != nullptr; + } + + ANGLE_NO_DISCARD bool openAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) + { + close(); + mLibraryHandle = OpenSystemLibraryAndGetError(libraryName, searchType, errorOut); + return mLibraryHandle != nullptr; + } + + ANGLE_NO_DISCARD bool openWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) + { + close(); + mLibraryHandle = + OpenSystemLibraryWithExtensionAndGetError(libraryName, searchType, errorOut); + return mLibraryHandle != nullptr; + } + + void close() + { + if (mLibraryHandle) + { + CloseSystemLibrary(mLibraryHandle); + mLibraryHandle = nullptr; + } + } + + void *getSymbol(const char *symbolName) { return GetLibrarySymbol(mLibraryHandle, symbolName); } + + void *getNative() const { return mLibraryHandle; } + + std::string getPath() const { return GetLibraryPath(mLibraryHandle); } template void getAs(const char *symbolName, FuncT *funcOut) { *funcOut = reinterpret_cast(getSymbol(symbolName)); } -}; -// Use SYSTEM_DIR to bypass loading ANGLE libraries with the same name as system DLLS -// (e.g. opengl32.dll) -enum class SearchType -{ - ApplicationDir, - SystemDir + private: + void *mLibraryHandle = nullptr; }; Library *OpenSharedLibrary(const char *libraryName, SearchType searchType); -Library *OpenSharedLibraryWithExtension(const char *libraryName); +Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType searchType); +Library *OpenSharedLibraryAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut); +Library *OpenSharedLibraryWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut); // Returns true if the process is currently being debugged. bool IsDebuggerAttached(); // Calls system APIs to break into the debugger. void BreakDebugger(); + +uint64_t GetProcessMemoryUsageKB(); + +bool ProtectMemory(uintptr_t start, size_t size); +bool UnprotectMemory(uintptr_t start, size_t size); + +size_t GetPageSize(); + +// Return type of the PageFaultCallback +enum class PageFaultHandlerRangeType +{ + // The memory address was known by the page fault handler + InRange, + // The memory address was not in the page fault handler's range + // and the signal will be forwarded to the default page handler. + OutOfRange, +}; + +using PageFaultCallback = std::function; + +class PageFaultHandler : angle::NonCopyable +{ + public: + PageFaultHandler(PageFaultCallback callback); + virtual ~PageFaultHandler(); + + // Registers OS level page fault handler for memory protection signals + // and enables reception on PageFaultCallback + virtual bool enable() = 0; + + // Unregisters OS level page fault handler and deactivates PageFaultCallback + virtual bool disable() = 0; + + protected: + PageFaultCallback mCallback; +}; + +// Creates single instance page fault handler +PageFaultHandler *CreatePageFaultHandler(PageFaultCallback callback); + +#ifdef ANGLE_PLATFORM_WINDOWS +// Convert an UTF-16 wstring to an UTF-8 string. +std::string Narrow(const std::wstring_view &utf16); + +// Convert an UTF-8 string to an UTF-16 wstring. +std::wstring Widen(const std::string_view &utf8); +#endif } // namespace angle #endif // COMMON_SYSTEM_UTILS_H_ diff --git a/gfx/angle/checkout/src/common/system_utils.cpp b/gfx/angle/checkout/src/common/system_utils.cpp --- a/gfx/angle/checkout/src/common/system_utils.cpp +++ b/gfx/angle/checkout/src/common/system_utils.cpp @@ -45,12 +45,12 @@ } #endif return GetEnvironmentVarOrUnCachedAndroidProperty(variableName, propertyName); } -// Call out to 'getprop' on a shell to get an Android property. If the value was set, set an -// environment variable with that value. Return the value of the environment variable. +// On Android call out to 'getprop' on a shell to get an Android property. On desktop, return +// the value of the environment variable. std::string GetEnvironmentVarOrUnCachedAndroidProperty(const char *variableName, const char *propertyName) { #if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 26 std::string propertyValue; @@ -65,16 +65,41 @@ *propertyValue = value; }, &propertyValue); } - // Set the environment variable with the value. - SetEnvironmentVar(variableName, propertyValue.c_str()); return propertyValue; -#endif // ANGLE_PLATFORM_ANDROID +#else // Return the environment variable's value. return GetEnvironmentVar(variableName); +#endif // ANGLE_PLATFORM_ANDROID +} + +// Look up a property and add it to the application's environment. +// Adding to the env is a performance optimization, as getting properties is expensive. +// This should only be used in non-Release paths, i.e. when using FrameCapture or DebugUtils. +// It can cause race conditions in stress testing. See http://anglebug.com/6822 +std::string GetAndSetEnvironmentVarOrUnCachedAndroidProperty(const char *variableName, + const char *propertyName) +{ + std::string value = GetEnvironmentVarOrUnCachedAndroidProperty(variableName, propertyName); + +#if defined(ANGLE_PLATFORM_ANDROID) + if (!value.empty()) + { + // Set the environment variable with the value to improve future lookups (avoids + SetEnvironmentVar(variableName, value.c_str()); + } +#endif + + return value; +} + +bool GetBoolEnvironmentVar(const char *variableName) +{ + std::string envVarString = GetEnvironmentVar(variableName); + return (!envVarString.empty() && envVarString == "1"); } bool PrependPathToEnvironmentVar(const char *variableName, const char *path) { std::string oldValue = GetEnvironmentVar(variableName); @@ -91,6 +116,94 @@ buf += oldValue; newValue = buf.c_str(); } return SetEnvironmentVar(variableName, newValue); } + +bool IsFullPath(std::string dirName) +{ + if (dirName.find(GetRootDirectory()) == 0) + { + return true; + } + return false; +} + +std::string ConcatenatePath(std::string first, std::string second) +{ + if (first.empty()) + { + return second; + } + if (second.empty()) + { + return first; + } + if (IsFullPath(second)) + { + return second; + } + bool firstRedundantPathSeparator = first.find_last_of(GetPathSeparator()) == first.length() - 1; + bool secondRedundantPathSeparator = second.find(GetPathSeparator()) == 0; + if (firstRedundantPathSeparator && secondRedundantPathSeparator) + { + return first + second.substr(1); + } + else if (firstRedundantPathSeparator || secondRedundantPathSeparator) + { + return first + second; + } + return first + GetPathSeparator() + second; +} + +PageFaultHandler::PageFaultHandler(PageFaultCallback callback) : mCallback(callback) {} +PageFaultHandler::~PageFaultHandler() {} + +Library *OpenSharedLibrary(const char *libraryName, SearchType searchType) +{ + void *libraryHandle = OpenSystemLibraryAndGetError(libraryName, searchType, nullptr); + return new Library(libraryHandle); +} + +Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType searchType) +{ + void *libraryHandle = + OpenSystemLibraryWithExtensionAndGetError(libraryName, searchType, nullptr); + return new Library(libraryHandle); +} + +Library *OpenSharedLibraryAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) +{ + void *libraryHandle = OpenSystemLibraryAndGetError(libraryName, searchType, errorOut); + return new Library(libraryHandle); +} + +Library *OpenSharedLibraryWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) +{ + void *libraryHandle = + OpenSystemLibraryWithExtensionAndGetError(libraryName, searchType, errorOut); + return new Library(libraryHandle); +} + +void *OpenSystemLibrary(const char *libraryName, SearchType searchType) +{ + return OpenSystemLibraryAndGetError(libraryName, searchType, nullptr); +} + +void *OpenSystemLibraryWithExtension(const char *libraryName, SearchType searchType) +{ + return OpenSystemLibraryWithExtensionAndGetError(libraryName, searchType, nullptr); +} + +void *OpenSystemLibraryAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) +{ + std::string libraryWithExtension = std::string(libraryName) + "." + GetSharedLibraryExtension(); + return OpenSystemLibraryWithExtensionAndGetError(libraryWithExtension.c_str(), searchType, + errorOut); +} } // namespace angle diff --git a/gfx/angle/checkout/src/common/system_utils_apple.cpp b/gfx/angle/checkout/src/common/system_utils_apple.cpp --- a/gfx/angle/checkout/src/common/system_utils_apple.cpp +++ b/gfx/angle/checkout/src/common/system_utils_apple.cpp @@ -46,11 +46,11 @@ std::string executablePath = GetExecutablePath(); size_t lastPathSepLoc = executablePath.find_last_of("/"); return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : ""; } -double GetCurrentTime() +double GetCurrentSystemTime() { mach_timebase_info_data_t timebaseInfo; mach_timebase_info(&timebaseInfo); double secondCoeff = timebaseInfo.numer * 1e-9 / timebaseInfo.denom; diff --git a/gfx/angle/checkout/src/common/system_utils_linux.cpp b/gfx/angle/checkout/src/common/system_utils_linux.cpp --- a/gfx/angle/checkout/src/common/system_utils_linux.cpp +++ b/gfx/angle/checkout/src/common/system_utils_linux.cpp @@ -43,11 +43,11 @@ const char *GetSharedLibraryExtension() { return "so"; } -double GetCurrentTime() +double GetCurrentSystemTime() { struct timespec currentTime; clock_gettime(CLOCK_MONOTONIC, ¤tTime); return currentTime.tv_sec + currentTime.tv_nsec * 1e-9; } diff --git a/gfx/angle/checkout/src/common/system_utils_posix.cpp b/gfx/angle/checkout/src/common/system_utils_posix.cpp --- a/gfx/angle/checkout/src/common/system_utils_posix.cpp +++ b/gfx/angle/checkout/src/common/system_utils_posix.cpp @@ -4,23 +4,103 @@ // found in the LICENSE file. // // system_utils_posix.cpp: Implementation of POSIX OS-specific functions. +#include "common/debug.h" #include "system_utils.h" #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include #include +#include "common/string_utils.h" + +#ifdef ANGLE_PLATFORM_FUCHSIA +# include +# include +#else +# include +#endif + namespace angle { + +namespace +{ +std::string GetModulePath(void *moduleOrSymbol) +{ + Dl_info dlInfo; + if (dladdr(moduleOrSymbol, &dlInfo) == 0) + { + return ""; + } + + return dlInfo.dli_fname; +} + +void *OpenPosixLibrary(const std::string &fullPath, int extraFlags, std::string *errorOut) +{ + void *module = dlopen(fullPath.c_str(), RTLD_NOW | extraFlags); + if (module) + { + if (errorOut) + { + *errorOut = fullPath; + } + } + else if (errorOut) + { + *errorOut = "dlopen("; + *errorOut += fullPath; + *errorOut += ") failed with error: "; + *errorOut += dlerror(); + struct stat sfile; + if (-1 == stat(fullPath.c_str(), &sfile)) + { + *errorOut += ", stat() call failed."; + } + else + { + *errorOut += ", stat() info: "; + struct passwd *pwuser = getpwuid(sfile.st_uid); + if (pwuser) + { + *errorOut += "owner: "; + *errorOut += pwuser->pw_name; + *errorOut += ", "; + } + struct group *grpnam = getgrgid(sfile.st_gid); + if (grpnam) + { + *errorOut += "group: "; + *errorOut += grpnam->gr_name; + *errorOut += ", "; + } + *errorOut += "perms: "; + *errorOut += std::to_string(sfile.st_mode); + *errorOut += ", links: "; + *errorOut += std::to_string(sfile.st_nlink); + *errorOut += ", size: "; + *errorOut += std::to_string(sfile.st_size); + } + } + return module; +} +} // namespace + Optional GetCWD() { std::array pathBuf; char *result = getcwd(pathBuf.data(), pathBuf.size()); if (result == nullptr) @@ -54,76 +134,113 @@ const char *GetPathSeparatorForEnvironmentVar() { return ":"; } -std::string GetHelperExecutableDir() +std::string GetModuleDirectoryAndGetError(std::string *errorOut) { std::string directory; static int placeholderSymbol = 0; - Dl_info dlInfo; - if (dladdr(&placeholderSymbol, &dlInfo) != 0) + std::string moduleName = GetModulePath(&placeholderSymbol); + if (!moduleName.empty()) + { + directory = moduleName.substr(0, moduleName.find_last_of('/') + 1); + } + + // Ensure we return the full path to the module, not the relative path + if (!IsFullPath(directory)) { - std::string moduleName = dlInfo.dli_fname; - directory = moduleName.substr(0, moduleName.find_last_of('/') + 1); + if (errorOut) + { + *errorOut += "Directory: '"; + *errorOut += directory; + *errorOut += "' is not full path"; + } + Optional cwd = GetCWD(); + if (cwd.valid()) + { + directory = ConcatenatePath(cwd.value(), directory); + if (errorOut) + { + *errorOut += ", so it has been modified to: '"; + *errorOut += directory; + *errorOut += "'. "; + } + } + else if (errorOut) + { + *errorOut += " and getcwd was invalid. "; + } } return directory; } -class PosixLibrary : public Library +std::string GetModuleDirectory() { - public: - PosixLibrary(const std::string &fullPath) : mModule(dlopen(fullPath.c_str(), RTLD_NOW)) {} - - ~PosixLibrary() override - { - if (mModule) - { - dlclose(mModule); - } - } + return GetModuleDirectoryAndGetError(nullptr); +} - void *getSymbol(const char *symbolName) override - { - if (!mModule) - { - return nullptr; - } - - return dlsym(mModule, symbolName); - } - - void *getNative() const override { return mModule; } - - private: - void *mModule = nullptr; -}; - -Library *OpenSharedLibrary(const char *libraryName, SearchType searchType) +void *OpenSystemLibraryWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) { std::string directory; - if (searchType == SearchType::ApplicationDir) + if (searchType == SearchType::ModuleDir) { #if ANGLE_PLATFORM_IOS // On iOS, shared libraries must be loaded from within the app bundle. directory = GetExecutableDirectory() + "/Frameworks/"; +#elif ANGLE_PLATFORM_FUCHSIA + // On Fuchsia the dynamic loader always looks up libraries in /pkg/lib + // and disallows loading of libraries via absolute paths. + directory = ""; #else - directory = GetHelperExecutableDir(); + directory = GetModuleDirectoryAndGetError(errorOut); #endif } - std::string fullPath = directory + libraryName + "." + GetSharedLibraryExtension(); + int extraFlags = 0; + if (searchType == SearchType::AlreadyLoaded) + { + extraFlags = RTLD_NOLOAD; + } + + std::string fullPath = directory + libraryName; #if ANGLE_PLATFORM_IOS // On iOS, dlopen needs a suffix on the framework name to work. fullPath = fullPath + "/" + libraryName; #endif - return new PosixLibrary(fullPath); + + return OpenPosixLibrary(fullPath, extraFlags, errorOut); +} + +void *GetLibrarySymbol(void *libraryHandle, const char *symbolName) +{ + if (!libraryHandle) + { + return nullptr; + } + + return dlsym(libraryHandle, symbolName); } -Library *OpenSharedLibraryWithExtension(const char *libraryName) +std::string GetLibraryPath(void *libraryHandle) { - return new PosixLibrary(libraryName); + if (!libraryHandle) + { + return ""; + } + + return GetModulePath(libraryHandle); +} + +void CloseSystemLibrary(void *libraryHandle) +{ + if (libraryHandle) + { + dlclose(libraryHandle); + } } bool IsDirectory(const char *filename) { struct stat st; @@ -152,6 +269,172 @@ char GetPathSeparator() { return '/'; } + +std::string GetRootDirectory() +{ + return "/"; +} + +double GetCurrentProcessCpuTime() +{ +#ifdef ANGLE_PLATFORM_FUCHSIA + static zx_handle_t me = zx_process_self(); + zx_info_task_runtime_t task_runtime; + zx_object_get_info(me, ZX_INFO_TASK_RUNTIME, &task_runtime, sizeof(task_runtime), nullptr, + nullptr); + return static_cast(task_runtime.cpu_time) * 1e-9; +#else + // We could also have used /proc/stat, but that requires us to read the + // filesystem and convert from jiffies. /proc/stat also relies on jiffies + // (lower resolution) while getrusage can potentially use a sched_clock() + // underneath that has higher resolution. + struct rusage usage; + getrusage(RUSAGE_SELF, &usage); + double userTime = usage.ru_utime.tv_sec + usage.ru_utime.tv_usec * 1e-6; + double systemTime = usage.ru_stime.tv_sec + usage.ru_stime.tv_usec * 1e-6; + return userTime + systemTime; +#endif +} + +namespace +{ +bool SetMemoryProtection(uintptr_t start, size_t size, int protections) +{ + int ret = mprotect(reinterpret_cast(start), size, protections); + if (ret < 0) + { + perror("mprotect failed"); + } + return ret == 0; +} + +class PosixPageFaultHandler : public PageFaultHandler +{ + public: + PosixPageFaultHandler(PageFaultCallback callback) : PageFaultHandler(callback) {} + ~PosixPageFaultHandler() override {} + + bool enable() override; + bool disable() override; + void handle(int sig, siginfo_t *info, void *unused); + + private: + struct sigaction mDefaultBusAction = {}; + struct sigaction mDefaultSegvAction = {}; +}; + +PosixPageFaultHandler *gPosixPageFaultHandler = nullptr; +void SegfaultHandlerFunction(int sig, siginfo_t *info, void *unused) +{ + gPosixPageFaultHandler->handle(sig, info, unused); +} + +void PosixPageFaultHandler::handle(int sig, siginfo_t *info, void *unused) +{ + bool found = false; + if ((sig == SIGSEGV || sig == SIGBUS) && + (info->si_code == SEGV_ACCERR || info->si_code == SEGV_MAPERR)) + { + found = mCallback(reinterpret_cast(info->si_addr)) == + PageFaultHandlerRangeType::InRange; + } + + // Fall back to default signal handler + if (!found) + { + if (sig == SIGSEGV) + { + mDefaultSegvAction.sa_sigaction(sig, info, unused); + } + else if (sig == SIGBUS) + { + mDefaultBusAction.sa_sigaction(sig, info, unused); + } + else + { + UNREACHABLE(); + } + } +} + +bool PosixPageFaultHandler::disable() +{ + return sigaction(SIGSEGV, &mDefaultSegvAction, nullptr) == 0 && + sigaction(SIGBUS, &mDefaultBusAction, nullptr) == 0; +} + +bool PosixPageFaultHandler::enable() +{ + struct sigaction sigAction = {}; + sigAction.sa_flags = SA_SIGINFO; + sigAction.sa_sigaction = &SegfaultHandlerFunction; + sigemptyset(&sigAction.sa_mask); + + // Some POSIX implementations use SIGBUS for mprotect faults + return sigaction(SIGSEGV, &sigAction, &mDefaultSegvAction) == 0 && + sigaction(SIGBUS, &sigAction, &mDefaultBusAction) == 0; +} +} // namespace + +// Set write protection +bool ProtectMemory(uintptr_t start, size_t size) +{ + return SetMemoryProtection(start, size, PROT_READ); +} + +// Allow reading and writing +bool UnprotectMemory(uintptr_t start, size_t size) +{ + return SetMemoryProtection(start, size, PROT_READ | PROT_WRITE); +} + +size_t GetPageSize() +{ + long pageSize = sysconf(_SC_PAGE_SIZE); + if (pageSize < 0) + { + perror("Could not get sysconf page size"); + return 0; + } + return static_cast(pageSize); +} + +PageFaultHandler *CreatePageFaultHandler(PageFaultCallback callback) +{ + gPosixPageFaultHandler = new PosixPageFaultHandler(callback); + return gPosixPageFaultHandler; +} + +uint64_t GetProcessMemoryUsageKB() +{ + FILE *file = fopen("/proc/self/status", "r"); + + if (!file) + { + return 0; + } + + const char *kSearchString = "VmRSS:"; + constexpr size_t kMaxLineSize = 100; + std::array line = {}; + + uint64_t kb = 0; + + while (fgets(line.data(), line.size(), file) != nullptr) + { + if (strncmp(line.data(), kSearchString, strlen(kSearchString)) == 0) + { + std::vector strings; + SplitStringAlongWhitespace(line.data(), &strings); + + sscanf(strings[1].c_str(), "%" SCNu64, &kb); + break; + } + } + fclose(file); + + return kb; +} } // namespace angle diff --git a/gfx/angle/checkout/src/common/system_utils_win.cpp b/gfx/angle/checkout/src/common/system_utils_win.cpp --- a/gfx/angle/checkout/src/common/system_utils_win.cpp +++ b/gfx/angle/checkout/src/common/system_utils_win.cpp @@ -13,67 +13,115 @@ #include #include namespace angle { + +namespace +{ + +std::string GetPath(HMODULE module) +{ + std::array executableFileBuf; + DWORD executablePathLen = GetModuleFileNameW(module, executableFileBuf.data(), + static_cast(executableFileBuf.size())); + return Narrow(executablePathLen > 0 ? executableFileBuf.data() : L""); +} + +std::string GetDirectory(HMODULE module) +{ + std::string executablePath = GetPath(module); + size_t lastPathSepLoc = executablePath.find_last_of("\\/"); + return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : ""; +} + +} // anonymous namespace + std::string GetExecutablePath() { - std::array executableFileBuf; - DWORD executablePathLen = GetModuleFileNameA(nullptr, executableFileBuf.data(), - static_cast(executableFileBuf.size())); - return (executablePathLen > 0 ? std::string(executableFileBuf.data()) : ""); + return GetPath(nullptr); } std::string GetExecutableDirectory() { - std::string executablePath = GetExecutablePath(); - size_t lastPathSepLoc = executablePath.find_last_of("\\/"); - return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : ""; + return GetDirectory(nullptr); } const char *GetSharedLibraryExtension() { return "dll"; } Optional GetCWD() { - std::array pathBuf; - DWORD result = GetCurrentDirectoryA(static_cast(pathBuf.size()), pathBuf.data()); + std::array pathBuf; + DWORD result = GetCurrentDirectoryW(static_cast(pathBuf.size()), pathBuf.data()); if (result == 0) { return Optional::Invalid(); } - return std::string(pathBuf.data()); + return Narrow(pathBuf.data()); } bool SetCWD(const char *dirName) { - return (SetCurrentDirectoryA(dirName) == TRUE); + return (SetCurrentDirectoryW(Widen(dirName).c_str()) == TRUE); } const char *GetPathSeparatorForEnvironmentVar() { return ";"; } -double GetCurrentTime() +double GetCurrentSystemTime() { LARGE_INTEGER frequency = {}; QueryPerformanceFrequency(&frequency); LARGE_INTEGER curTime; QueryPerformanceCounter(&curTime); return static_cast(curTime.QuadPart) / frequency.QuadPart; } +double GetCurrentProcessCpuTime() +{ + FILETIME creationTime = {}; + FILETIME exitTime = {}; + FILETIME kernelTime = {}; + FILETIME userTime = {}; + + // Note this will not give accurate results if the current thread is + // scheduled for less than the tick rate, which is often 15 ms. In that + // case, GetProcessTimes will not return different values, making it + // possible to end up with 0 ms for a process that takes 93% of a core + // (14/15 ms)! An alternative is QueryProcessCycleTime but there is no + // simple way to convert cycles back to seconds, and on top of that, it's + // not supported pre-Windows Vista. + + // Returns 100-ns intervals, so we want to divide by 1e7 to get seconds + GetProcessTimes(GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime); + + ULARGE_INTEGER kernelInt64; + kernelInt64.LowPart = kernelTime.dwLowDateTime; + kernelInt64.HighPart = kernelTime.dwHighDateTime; + double systemTimeSeconds = static_cast(kernelInt64.QuadPart) * 1e-7; + + ULARGE_INTEGER userInt64; + userInt64.LowPart = userTime.dwLowDateTime; + userInt64.HighPart = userTime.dwHighDateTime; + double userTimeSeconds = static_cast(userInt64.QuadPart) * 1e-7; + + return systemTimeSeconds + userTimeSeconds; +} + bool IsDirectory(const char *filename) { WIN32_FILE_ATTRIBUTE_DATA fileInformation; - BOOL result = GetFileAttributesExA(filename, GetFileExInfoStandard, &fileInformation); + BOOL result = + GetFileAttributesExW(Widen(filename).c_str(), GetFileExInfoStandard, &fileInformation); if (result) { DWORD attribs = fileInformation.dwFileAttributes; return (attribs != INVALID_FILE_ATTRIBUTES) && ((attribs & FILE_ATTRIBUTE_DIRECTORY) > 0); } @@ -99,10 +147,91 @@ char GetPathSeparator() { return '\\'; } -std::string GetHelperExecutableDir() +std::string GetModuleDirectory() +{ +// GetModuleHandleEx is unavailable on UWP +#if !defined(ANGLE_IS_WINUWP) + static int placeholderSymbol = 0; + HMODULE module = nullptr; + if (GetModuleHandleExW( + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast(&placeholderSymbol), &module)) + { + return GetDirectory(module); + } +#endif + return GetDirectory(nullptr); +} + +std::string GetRootDirectory() +{ + return "C:\\"; +} + +std::string GetLibraryPath(void *libraryHandle) +{ + if (!libraryHandle) + { + return ""; + } + + std::array buffer; + if (GetModuleFileNameW(reinterpret_cast(libraryHandle), buffer.data(), + buffer.size()) == 0) + { + return ""; + } + + return Narrow(buffer.data()); +} + +void *GetLibrarySymbol(void *libraryHandle, const char *symbolName) { - return ""; + if (!libraryHandle) + { + fprintf(stderr, "Module was not loaded\n"); + return nullptr; + } + + return reinterpret_cast( + GetProcAddress(reinterpret_cast(libraryHandle), symbolName)); +} + +void CloseSystemLibrary(void *libraryHandle) +{ + if (libraryHandle) + { + FreeLibrary(reinterpret_cast(libraryHandle)); + } } +std::string Narrow(const std::wstring_view &utf16) +{ + if (utf16.empty()) + { + return {}; + } + int requiredSize = WideCharToMultiByte(CP_UTF8, 0, utf16.data(), static_cast(utf16.size()), + nullptr, 0, nullptr, nullptr); + std::string utf8(requiredSize, '\0'); + WideCharToMultiByte(CP_UTF8, 0, utf16.data(), static_cast(utf16.size()), &utf8[0], + requiredSize, nullptr, nullptr); + return utf8; +} + +std::wstring Widen(const std::string_view &utf8) +{ + if (utf8.empty()) + { + return {}; + } + int requiredSize = + MultiByteToWideChar(CP_UTF8, 0, utf8.data(), static_cast(utf8.size()), nullptr, 0); + std::wstring utf16(requiredSize, L'\0'); + MultiByteToWideChar(CP_UTF8, 0, utf8.data(), static_cast(utf8.size()), &utf16[0], + requiredSize); + return utf16; +} + } // namespace angle diff --git a/gfx/angle/checkout/src/common/system_utils_win32.cpp b/gfx/angle/checkout/src/common/system_utils_win32.cpp --- a/gfx/angle/checkout/src/common/system_utils_win32.cpp +++ b/gfx/angle/checkout/src/common/system_utils_win32.cpp @@ -3,98 +3,233 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // system_utils_win32.cpp: Implementation of OS-specific functions for Windows. +#include "common/FastVector.h" #include "system_utils.h" +#include + +// Must be included in this order. +// clang-format off #include -#include +#include +// clang-format on namespace angle { bool UnsetEnvironmentVar(const char *variableName) { - return (SetEnvironmentVariableA(variableName, nullptr) == TRUE); + return (SetEnvironmentVariableW(Widen(variableName).c_str(), nullptr) == TRUE); } bool SetEnvironmentVar(const char *variableName, const char *value) { - return (SetEnvironmentVariableA(variableName, value) == TRUE); + return (SetEnvironmentVariableW(Widen(variableName).c_str(), Widen(value).c_str()) == TRUE); } std::string GetEnvironmentVar(const char *variableName) { - std::array oldValue; - DWORD result = - GetEnvironmentVariableA(variableName, oldValue.data(), static_cast(oldValue.size())); + std::wstring variableNameUtf16 = Widen(variableName); + FastVector value; + + DWORD result; + + // First get the length of the variable, including the null terminator + result = GetEnvironmentVariableW(variableNameUtf16.c_str(), nullptr, 0); + + // Zero means the variable was not found, so return now. if (result == 0) { return std::string(); } - else - { - return std::string(oldValue.data()); - } + + // Now size the vector to fit the data, and read the environment variable. + value.resize(result, 0); + result = GetEnvironmentVariableW(variableNameUtf16.c_str(), value.data(), result); + + return Narrow(value.data()); } -class Win32Library : public Library -{ - public: - Win32Library(const char *libraryName, SearchType searchType) - { - switch (searchType) - { - case SearchType::ApplicationDir: - mModule = LoadLibraryA(libraryName); - break; - case SearchType::SystemDir: - mModule = LoadLibraryExA(libraryName, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); - break; - } - } - - ~Win32Library() override - { - if (mModule) - { - FreeLibrary(mModule); - } - } - - void *getSymbol(const char *symbolName) override - { - if (!mModule) - { - fprintf(stderr, "Module was not loaded\n"); - return nullptr; - } - - return reinterpret_cast(GetProcAddress(mModule, symbolName)); - } - - void *getNative() const override { return reinterpret_cast(mModule); } - - private: - HMODULE mModule = nullptr; -}; - -Library *OpenSharedLibrary(const char *libraryName, SearchType searchType) +void *OpenSystemLibraryWithExtensionAndGetError(const char *libraryName, + SearchType searchType, + std::string *errorOut) { char buffer[MAX_PATH]; int ret = snprintf(buffer, MAX_PATH, "%s.%s", libraryName, GetSharedLibraryExtension()); - if (ret > 0 && ret < MAX_PATH) - { - return new Win32Library(buffer, searchType); - } - else + if (ret <= 0 || ret >= MAX_PATH) { fprintf(stderr, "Error loading shared library: 0x%x", ret); return nullptr; } + + HMODULE libraryModule = nullptr; + + switch (searchType) + { + case SearchType::ModuleDir: + { + std::string moduleRelativePath = ConcatenatePath(GetModuleDirectory(), libraryName); + if (errorOut) + { + *errorOut = moduleRelativePath; + } + libraryModule = LoadLibraryW(Widen(moduleRelativePath).c_str()); + break; + } + + case SearchType::SystemDir: + { + if (errorOut) + { + *errorOut = libraryName; + } + libraryModule = + LoadLibraryExW(Widen(libraryName).c_str(), nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); + break; + } + + case SearchType::AlreadyLoaded: + { + if (errorOut) + { + *errorOut = libraryName; + } + libraryModule = GetModuleHandleW(Widen(libraryName).c_str()); + break; + } + } + + return reinterpret_cast(libraryModule); +} + +namespace +{ +class Win32PageFaultHandler : public PageFaultHandler +{ + public: + Win32PageFaultHandler(PageFaultCallback callback) : PageFaultHandler(callback) {} + ~Win32PageFaultHandler() override {} + + bool enable() override; + bool disable() override; + + LONG handle(PEXCEPTION_POINTERS pExceptionInfo); + + private: + void *mVectoredExceptionHandler = nullptr; +}; + +Win32PageFaultHandler *gWin32PageFaultHandler = nullptr; +static LONG CALLBACK VectoredExceptionHandler(PEXCEPTION_POINTERS info) +{ + return gWin32PageFaultHandler->handle(info); +} + +bool SetMemoryProtection(uintptr_t start, size_t size, DWORD protections) +{ + DWORD oldProtect; + BOOL res = VirtualProtect(reinterpret_cast(start), size, protections, &oldProtect); + if (!res) + { + DWORD lastError = GetLastError(); + fprintf(stderr, "VirtualProtect failed: 0x%lx\n", lastError); + return false; + } + + return true; } -Library *OpenSharedLibraryWithExtension(const char *libraryName) +LONG Win32PageFaultHandler::handle(PEXCEPTION_POINTERS info) +{ + bool found = false; + + if (info->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && + info->ExceptionRecord->NumberParameters >= 2 && + info->ExceptionRecord->ExceptionInformation[0] == 1) + { + found = mCallback(static_cast(info->ExceptionRecord->ExceptionInformation[1])) == + PageFaultHandlerRangeType::InRange; + } + + if (found) + { + return EXCEPTION_CONTINUE_EXECUTION; + } + else + { + return EXCEPTION_CONTINUE_SEARCH; + } +} + +bool Win32PageFaultHandler::disable() +{ + if (mVectoredExceptionHandler) + { + ULONG res = RemoveVectoredExceptionHandler(mVectoredExceptionHandler); + mVectoredExceptionHandler = nullptr; + if (res == 0) + { + DWORD lastError = GetLastError(); + fprintf(stderr, "RemoveVectoredExceptionHandler failed: 0x%lx\n", lastError); + return false; + } + } + return true; +} + +bool Win32PageFaultHandler::enable() { - return new Win32Library(libraryName, SearchType::SystemDir); + if (mVectoredExceptionHandler) + { + return true; + } + + PVECTORED_EXCEPTION_HANDLER handler = + reinterpret_cast(&VectoredExceptionHandler); + + mVectoredExceptionHandler = AddVectoredExceptionHandler(1, handler); + + if (!mVectoredExceptionHandler) + { + DWORD lastError = GetLastError(); + fprintf(stderr, "AddVectoredExceptionHandler failed: 0x%lx\n", lastError); + return false; + } + return true; +} +} // namespace + +// Set write protection +bool ProtectMemory(uintptr_t start, size_t size) +{ + return SetMemoryProtection(start, size, PAGE_READONLY); +} + +// Allow reading and writing +bool UnprotectMemory(uintptr_t start, size_t size) +{ + return SetMemoryProtection(start, size, PAGE_READWRITE); +} + +size_t GetPageSize() +{ + SYSTEM_INFO info; + GetSystemInfo(&info); + return static_cast(info.dwPageSize); +} + +PageFaultHandler *CreatePageFaultHandler(PageFaultCallback callback) +{ + gWin32PageFaultHandler = new Win32PageFaultHandler(callback); + return gWin32PageFaultHandler; +} + +uint64_t GetProcessMemoryUsageKB() +{ + PROCESS_MEMORY_COUNTERS_EX pmc; + ::GetProcessMemoryInfo(::GetCurrentProcess(), reinterpret_cast(&pmc), + sizeof(pmc)); + return static_cast(pmc.PrivateUsage) / 1024ull; } } // namespace angle diff --git a/gfx/angle/checkout/src/common/third_party/base/anglebase/numerics/checked_math.h b/gfx/angle/checkout/src/common/third_party/base/anglebase/numerics/checked_math.h new file mode 100644 --- /dev/null +++ b/gfx/angle/checkout/src/common/third_party/base/anglebase/numerics/checked_math.h @@ -0,0 +1,384 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_NUMERICS_CHECKED_MATH_H_ +#define BASE_NUMERICS_CHECKED_MATH_H_ + +#include + +#include +#include + +#include "anglebase/numerics/checked_math_impl.h" + +namespace angle +{ +namespace base +{ +namespace internal +{ + +template +class CheckedNumeric +{ + static_assert(std::is_arithmetic::value, "CheckedNumeric: T must be a numeric type."); + + public: + template + friend class CheckedNumeric; + + using type = T; + + constexpr CheckedNumeric() = default; + + // Copy constructor. + template + constexpr CheckedNumeric(const CheckedNumeric &rhs) + : state_(rhs.state_.value(), rhs.IsValid()) + {} + + // This is not an explicit constructor because we implicitly upgrade regular + // numerics to CheckedNumerics to make them easier to use. + template + constexpr CheckedNumeric(Src value) // NOLINT(runtime/explicit) + : state_(value) + { + static_assert(std::is_arithmetic::value, "Argument must be numeric."); + } + + // This is not an explicit constructor because we want a seamless conversion + // from StrictNumeric types. + template + constexpr CheckedNumeric(StrictNumeric value) // NOLINT(runtime/explicit) + : state_(static_cast(value)) + {} + + // IsValid() - The public API to test if a CheckedNumeric is currently valid. + // A range checked destination type can be supplied using the Dst template + // parameter. + template + constexpr bool IsValid() const + { + return state_.is_valid() && IsValueInRangeForNumericType(state_.value()); + } + + // AssignIfValid(Dst) - Assigns the underlying value if it is currently valid + // and is within the range supported by the destination type. Returns true if + // successful and false otherwise. + template +#if defined(__clang__) || defined(__GNUC__) + __attribute__((warn_unused_result)) +#elif defined(_MSC_VER) + _Check_return_ +#endif + constexpr bool + AssignIfValid(Dst *result) const + { + return BASE_NUMERICS_LIKELY(IsValid()) + ? ((*result = static_cast(state_.value())), true) + : false; + } + + // ValueOrDie() - The primary accessor for the underlying value. If the + // current state is not valid it will CHECK and crash. + // A range checked destination type can be supplied using the Dst template + // parameter, which will trigger a CHECK if the value is not in bounds for + // the destination. + // The CHECK behavior can be overridden by supplying a handler as a + // template parameter, for test code, etc. However, the handler cannot access + // the underlying value, and it is not available through other means. + template + constexpr StrictNumeric ValueOrDie() const + { + return BASE_NUMERICS_LIKELY(IsValid()) ? static_cast(state_.value()) + : CheckHandler::template HandleFailure(); + } + + // ValueOrDefault(T default_value) - A convenience method that returns the + // current value if the state is valid, and the supplied default_value for + // any other state. + // A range checked destination type can be supplied using the Dst template + // parameter. WARNING: This function may fail to compile or CHECK at runtime + // if the supplied default_value is not within range of the destination type. + template + constexpr StrictNumeric ValueOrDefault(const Src default_value) const + { + return BASE_NUMERICS_LIKELY(IsValid()) ? static_cast(state_.value()) + : checked_cast(default_value); + } + + // Returns a checked numeric of the specified type, cast from the current + // CheckedNumeric. If the current state is invalid or the destination cannot + // represent the result then the returned CheckedNumeric will be invalid. + template + constexpr CheckedNumeric::type> Cast() const + { + return *this; + } + + // This friend method is available solely for providing more detailed logging + // in the tests. Do not implement it in production code, because the + // underlying values may change at any time. + template + friend U GetNumericValueForTest(const CheckedNumeric &src); + + // Prototypes for the supported arithmetic operator overloads. + template + constexpr CheckedNumeric &operator+=(const Src rhs); + template + constexpr CheckedNumeric &operator-=(const Src rhs); + template + constexpr CheckedNumeric &operator*=(const Src rhs); + template + constexpr CheckedNumeric &operator/=(const Src rhs); + template + constexpr CheckedNumeric &operator%=(const Src rhs); + template + constexpr CheckedNumeric &operator<<=(const Src rhs); + template + constexpr CheckedNumeric &operator>>=(const Src rhs); + template + constexpr CheckedNumeric &operator&=(const Src rhs); + template + constexpr CheckedNumeric &operator|=(const Src rhs); + template + constexpr CheckedNumeric &operator^=(const Src rhs); + + constexpr CheckedNumeric operator-() const + { + // Use an optimized code path for a known run-time variable. + if (!MustTreatAsConstexpr(state_.value()) && std::is_signed::value && + std::is_floating_point::value) + { + return FastRuntimeNegate(); + } + // The negation of two's complement int min is int min. + const bool is_valid = + IsValid() && (!std::is_signed::value || std::is_floating_point::value || + NegateWrapper(state_.value()) != std::numeric_limits::lowest()); + return CheckedNumeric(NegateWrapper(state_.value()), is_valid); + } + + constexpr CheckedNumeric operator~() const + { + return CheckedNumeric(InvertWrapper(state_.value()), + IsValid()); + } + + constexpr CheckedNumeric Abs() const + { + return !IsValueNegative(state_.value()) ? *this : -*this; + } + + template + constexpr CheckedNumeric::type> Max(const U rhs) const + { + return CheckMax(*this, rhs); + } + + template + constexpr CheckedNumeric::type> Min(const U rhs) const + { + return CheckMin(*this, rhs); + } + + // This function is available only for integral types. It returns an unsigned + // integer of the same width as the source type, containing the absolute value + // of the source, and properly handling signed min. + constexpr CheckedNumeric::type> UnsignedAbs() const + { + return CheckedNumeric::type>( + SafeUnsignedAbs(state_.value()), state_.is_valid()); + } + + constexpr CheckedNumeric &operator++() + { + *this += 1; + return *this; + } + + constexpr CheckedNumeric operator++(int) + { + CheckedNumeric value = *this; + *this += 1; + return value; + } + + constexpr CheckedNumeric &operator--() + { + *this -= 1; + return *this; + } + + constexpr CheckedNumeric operator--(int) + { + // TODO(pkasting): Consider std::exchange() once it's constexpr in C++20. + const CheckedNumeric value = *this; + *this -= 1; + return value; + } + + // These perform the actual math operations on the CheckedNumerics. + // Binary arithmetic operations. + template