Bug 1717151 - Vendor angle/chromium/4515 with fixes. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D125747
This commit is contained in:
Jeff Gilbert 2021-09-16 18:24:29 +00:00
Родитель 6dcd4b1e5e
Коммит 5d9ba6c221
516 изменённых файлов: 103684 добавлений и 82940 удалений

Просмотреть файл

@ -6,34 +6,15 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $
** Khronos $Git commit SHA1: 5a9a7e3fcb $ on $Git commit date: 2020-08-24 11:05:32 -0700 $
*/
#include <EGL/eglplatform.h>
@ -42,7 +23,7 @@ extern "C" {
#define EGL_EGL_PROTOTYPES 1
#endif
/* Generated on date 20190808 */
/* Generated on date 20201001 */
/* Generated C header for:
* API: egl

Просмотреть файл

@ -6,39 +6,20 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: cb927ca98d $ on $Git commit date: 2019-08-08 01:05:38 -0700 $
** Khronos $Git commit SHA1: 5a9a7e3fcb $ on $Git commit date: 2020-08-24 11:05:32 -0700 $
*/
#include <EGL/eglplatform.h>
#define EGL_EGLEXT_VERSION 20190808
#define EGL_EGLEXT_VERSION 20201001
/* Generated C header for:
* API: egl
@ -443,9 +424,9 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy,
#ifndef EGL_KHR_swap_buffers_with_damage
#define EGL_KHR_swap_buffers_with_damage 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
#endif
#endif /* EGL_KHR_swap_buffers_with_damage */
@ -598,6 +579,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
#define EGL_FIXED_SIZE_ANGLE 0x3201
#endif /* EGL_ANGLE_window_fixed_size */
#ifndef EGL_ARM_image_format
#define EGL_ARM_image_format 1
#define EGL_COLOR_COMPONENT_TYPE_UNSIGNED_INTEGER_ARM 0x3287
#define EGL_COLOR_COMPONENT_TYPE_INTEGER_ARM 0x3288
#endif /* EGL_ARM_image_format */
#ifndef EGL_ARM_implicit_external_sync
#define EGL_ARM_implicit_external_sync 1
#define EGL_SYNC_PRIOR_COMMANDS_IMPLICIT_EXTERNAL_ARM 0x328A
@ -701,6 +688,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint a
#define EGL_EXT_device_query 1
#endif /* EGL_EXT_device_query */
#ifndef EGL_EXT_device_query_name
#define EGL_EXT_device_query_name 1
#define EGL_RENDERER_EXT 0x335F
#endif /* EGL_EXT_device_query_name */
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
#define EGL_EXT_gl_colorspace_bt2020_linear 1
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@ -877,6 +869,12 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6
#endif /* EGL_EXT_platform_x11 */
#ifndef EGL_EXT_platform_xcb
#define EGL_EXT_platform_xcb 1
#define EGL_PLATFORM_XCB_EXT 0x31DC
#define EGL_PLATFORM_XCB_SCREEN_EXT 0x31DE
#endif /* EGL_EXT_platform_xcb */
#ifndef EGL_EXT_protected_content
#define EGL_EXT_protected_content 1
#define EGL_PROTECTED_CONTENT_EXT 0x32C0
@ -917,9 +915,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
#ifndef EGL_EXT_swap_buffers_with_damage
#define EGL_EXT_swap_buffers_with_damage 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
#endif
#endif /* EGL_EXT_swap_buffers_with_damage */
@ -1143,6 +1141,24 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
#define EGL_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x334C
#endif /* EGL_NV_robustness_video_memory_purge */
#ifndef EGL_NV_stream_consumer_eglimage
#define EGL_NV_stream_consumer_eglimage 1
#define EGL_STREAM_CONSUMER_IMAGE_NV 0x3373
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
#endif
#endif /* EGL_NV_stream_consumer_eglimage */
#ifndef EGL_NV_stream_consumer_gltexture_yuv
#define EGL_NV_stream_consumer_gltexture_yuv 1
#define EGL_YUV_PLANE0_TEXTURE_UNIT_NV 0x332C
@ -1362,6 +1378,40 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
#define EGL_NATIVE_SURFACE_TIZEN 0x32A1
#endif /* EGL_TIZEN_image_native_surface */
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
#define PFNEGLBINDWAYLANDDISPLAYWL PFNEGLBINDWAYLANDDISPLAYWLPROC
#define PFNEGLUNBINDWAYLANDDISPLAYWL PFNEGLUNBINDWAYLANDDISPLAYWLPROC
#define PFNEGLQUERYWAYLANDBUFFERWL PFNEGLQUERYWAYLANDBUFFERWLPROC
struct wl_display;
struct wl_resource;
#define EGL_WAYLAND_BUFFER_WL 0x31D5
#define EGL_WAYLAND_PLANE_WL 0x31D6
#define EGL_TEXTURE_Y_U_V_WL 0x31D7
#define EGL_TEXTURE_Y_UV_WL 0x31D8
#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
#define EGL_TEXTURE_EXTERNAL_WL 0x31DA
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWLPROC) (EGLDisplay dpy, struct wl_display *display);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWLPROC) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL (EGLDisplay dpy, struct wl_display *display);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value);
#endif
#endif /* EGL_WL_bind_wayland_display */
#ifndef EGL_WL_create_wayland_buffer_from_image
#define EGL_WL_create_wayland_buffer_from_image 1
#define PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC
struct wl_buffer;
typedef struct wl_buffer *(EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWLPROC) (EGLDisplay dpy, EGLImageKHR image);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI struct wl_buffer *EGLAPIENTRY eglCreateWaylandBufferFromImageWL (EGLDisplay dpy, EGLImageKHR image);
#endif
#endif /* EGL_WL_create_wayland_buffer_from_image */
/* ANGLE EGL extensions */
#include "eglext_angle.h"

Просмотреть файл

@ -24,9 +24,11 @@
#ifndef EGL_ANGLE_d3d_texture_client_buffer
#define EGL_ANGLE_d3d_texture_client_buffer 1
#define EGL_D3D_TEXTURE_ANGLE 0x33A3
#define EGL_TEXTURE_OFFSET_X_ANGLE 0x3490
#define EGL_TEXTURE_OFFSET_Y_ANGLE 0x3491
#define EGL_D3D_TEXTURE_ANGLE 0x33A3
#define EGL_TEXTURE_OFFSET_X_ANGLE 0x3490
#define EGL_TEXTURE_OFFSET_Y_ANGLE 0x3491
#define EGL_D3D11_TEXTURE_PLANE_ANGLE 0x3492
#define EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE 0x3493
#endif /* EGL_ANGLE_d3d_texture_client_buffer */
#ifndef EGL_ANGLE_software_display
@ -204,12 +206,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device);
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHEGETATTRIBANGLEPROC) (EGLDisplay dpy, EGLenum attrib);
typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEQUERYANGLEPROC) (EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize);
typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEPOPULATEANGLEPROC) (EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize);
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHERESIZEANGLEPROC) (EGLDisplay dpy, EGLint limit, EGLenum mode);
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHERESIZEANGLEPROC) (EGLDisplay dpy, EGLint limit, EGLint mode);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib);
EGLAPI void EGLAPIENTRY eglProgramCacheQueryANGLE(EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize);
EGLAPI void EGLAPIENTRY eglProgramCachePopulateANGLE(EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize);
EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLenum mode);
EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLint mode);
#endif
#endif /* EGL_ANGLE_program_cache_control */
@ -226,6 +228,11 @@ EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limi
#define EGL_BIND_TO_TEXTURE_TARGET_ANGLE 0x348D
#endif /* EGL_ANGLE_iosurface_client_buffer */
#ifndef ANGLE_metal_texture_client_buffer
#define ANGLE_metal_texture_client_buffer 1
#define EGL_METAL_TEXTURE_ANGLE 0x34A7
#endif /* ANGLE_metal_texture_client_buffer */
#ifndef EGL_ANGLE_create_context_extensions_enabled
#define EGL_ANGLE_create_context_extensions_enabled 1
#define EGL_EXTENSIONS_ENABLED_ANGLE 0x345F
@ -331,11 +338,23 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy,
#define EGL_EAGL_CONTEXT_ANGLE 0x348C
#endif
#ifndef EGL_ANGLE_device_metal
#define EGL_ANGLE_device_metal 1
#define EGL_METAL_DEVICE_ANGLE 0x34A6
#endif /* EGL_ANGLE_device_metal */
#ifndef EGL_ANGLE_display_semaphore_share_group
#define EGL_ANGLE_display_semaphore_share_group 1
#define EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE 0x348D
#endif /* EGL_ANGLE_display_semaphore_share_group */
#ifndef EGL_ANGLE_external_context_and_surface
#define EGL_ANGLE_external_context_and_surface 1
#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 */
// clang-format on
#endif // INCLUDE_EGL_EGLEXT_ANGLE_

Просмотреть файл

@ -2,36 +2,17 @@
#define __eglplatform_h_
/*
** Copyright (c) 2007-2016 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
** Copyright 2007-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
*/
/* Platform-specific types and definitions for egl.h
* $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "EGL" component "Registry".
* by filing an issue or pull request on the public Khronos EGL Registry, at
* https://www.github.com/KhronosGroup/EGL-Registry/
*/
#include <KHR/khrplatform.h>
@ -67,7 +48,13 @@
* implementations.
*/
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
typedef void *EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType;
#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
@ -83,6 +70,12 @@ typedef HWND EGLNativeWindowType;
typedef IInspectable* EGLNativeWindowType;
#endif
#elif defined(__EMSCRIPTEN__)
typedef int EGLNativeDisplayType;
typedef int EGLNativePixmapType;
typedef int EGLNativeWindowType;
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
typedef int EGLNativeDisplayType;
@ -110,17 +103,17 @@ typedef void* EGLNativeDisplayType;
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
typedef struct ANativeWindow* EGLNativeWindowType;
#elif defined(USE_OZONE) || defined(USE_SYSTEM_EGL)
#elif defined(USE_OZONE)
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;
#elif defined(__ggp__)
#elif defined(__unix__) && defined(EGL_NO_X11)
typedef intptr_t EGLNativeDisplayType;
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;
typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;
#elif defined(__unix__) || defined(USE_X11)
@ -148,9 +141,9 @@ typedef khronos_uintptr_t EGLNativeWindowType;
#elif defined(__Fuchsia__)
typedef int EGLNativeDisplayType;
typedef void *EGLNativePixmapType;
typedef void *EGLNativeWindowType
typedef void *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;
#else
#error "Platform not recognized"

Просмотреть файл

@ -1,33 +1,14 @@
#ifndef __gl2_h_
#define __gl2_h_ 1
#ifndef __gles2_gl2_h_
#define __gles2_gl2_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
@ -44,7 +25,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20170325 */
/* Generated on date 20210107 */
/* Generated C header for:
* API: gles2
@ -62,8 +43,8 @@ extern "C" {
typedef khronos_int8_t GLbyte;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef short GLshort;
typedef unsigned short GLushort;
typedef khronos_int16_t GLshort;
typedef khronos_uint16_t GLushort;
typedef void GLvoid;
typedef struct __GLsync *GLsync;
typedef khronos_int64_t GLint64;
@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);

Просмотреть файл

@ -6,28 +6,9 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
@ -38,7 +19,7 @@ extern "C" {
#define GL_APIENTRYP GL_APIENTRY*
#endif
/* Generated on date 20200221 */
/* Generated on date 20210107 */
/* Generated C header for:
* API: gles2
@ -350,12 +331,12 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex);
#endif
#endif /* GL_OES_draw_elements_base_vertex */
@ -1624,6 +1605,10 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target,
#endif
#endif /* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture2
#define GL_EXT_multisampled_render_to_texture2 1
#endif /* GL_EXT_multisampled_render_to_texture2 */
#ifndef GL_EXT_multiview_draw_buffers
#define GL_EXT_multiview_draw_buffers 1
#define GL_COLOR_ATTACHMENT_EXT 0x90F0
@ -2459,6 +2444,11 @@ GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint quer
#endif
#endif /* GL_INTEL_performance_query */
#ifndef GL_MESA_framebuffer_flip_x
#define GL_MESA_framebuffer_flip_x 1
#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC
#endif /* GL_MESA_framebuffer_flip_x */
#ifndef GL_MESA_framebuffer_flip_y
#define GL_MESA_framebuffer_flip_y 1
#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB
@ -2470,6 +2460,11 @@ GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLen
#endif
#endif /* GL_MESA_framebuffer_flip_y */
#ifndef GL_MESA_framebuffer_swap_xy
#define GL_MESA_framebuffer_swap_xy 1
#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD
#endif /* GL_MESA_framebuffer_swap_xy */
#ifndef GL_MESA_program_binary_formats
#define GL_MESA_program_binary_formats 1
#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F
@ -3008,6 +3003,20 @@ GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint m
#endif
#endif /* GL_NV_memory_attachment */
#ifndef GL_NV_memory_object_sparse
#define GL_NV_memory_object_sparse 1
typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit);
GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit);
#endif
#endif /* GL_NV_memory_object_sparse */
#ifndef GL_NV_mesh_shader
#define GL_NV_mesh_shader 1
#define GL_MESH_SHADER_NV 0x9559
@ -3433,6 +3442,12 @@ GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode);
#endif
#endif /* GL_NV_polygon_mode */
#ifndef GL_NV_primitive_shading_rate
#define GL_NV_primitive_shading_rate 1
#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1
#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2
#endif /* GL_NV_primitive_shading_rate */
#ifndef GL_NV_read_buffer
#define GL_NV_read_buffer 1
#define GL_READ_BUFFER_NV 0x0C02
@ -3599,6 +3614,23 @@ GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuin
#define GL_NV_texture_npot_2D_mipmap 1
#endif /* GL_NV_texture_npot_2D_mipmap */
#ifndef GL_NV_timeline_semaphore
#define GL_NV_timeline_semaphore 1
#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595
#define GL_SEMAPHORE_TYPE_NV 0x95B3
#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4
#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5
#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6
typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores);
typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params);
typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores);
GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params);
GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params);
#endif
#endif /* GL_NV_timeline_semaphore */
#ifndef GL_NV_viewport_array
#define GL_NV_viewport_array 1
#define GL_MAX_VIEWPORTS_NV 0x825B
@ -3765,6 +3797,14 @@ GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLe
#endif
#endif /* GL_QCOM_extended_get2 */
#ifndef GL_QCOM_frame_extrapolation
#define GL_QCOM_frame_extrapolation 1
typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor);
#endif
#endif /* GL_QCOM_frame_extrapolation */
#ifndef GL_QCOM_framebuffer_foveated
#define GL_QCOM_framebuffer_foveated 1
#define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001
@ -3777,6 +3817,18 @@ GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebu
#endif
#endif /* GL_QCOM_framebuffer_foveated */
#ifndef GL_QCOM_motion_estimation
#define GL_QCOM_motion_estimation 1
#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90
#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91
typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output);
typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output);
GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask);
#endif
#endif /* GL_QCOM_motion_estimation */
#ifndef GL_QCOM_perfmon_global_mode
#define GL_QCOM_perfmon_global_mode 1
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
@ -3795,6 +3847,22 @@ GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void);
#define GL_QCOM_shader_framebuffer_fetch_rate 1
#endif /* GL_QCOM_shader_framebuffer_fetch_rate */
#ifndef GL_QCOM_shading_rate
#define GL_QCOM_shading_rate 1
#define GL_SHADING_RATE_QCOM 0x96A4
#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5
#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6
#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7
#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8
#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9
#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC
#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE
typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate);
#endif
#endif /* GL_QCOM_shading_rate */
#ifndef GL_QCOM_texture_foveated
#define GL_QCOM_texture_foveated 1
#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB
@ -3808,6 +3876,11 @@ GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GL
#endif
#endif /* GL_QCOM_texture_foveated */
#ifndef GL_QCOM_texture_foveated2
#define GL_QCOM_texture_foveated2 1
#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0
#endif /* GL_QCOM_texture_foveated2 */
#ifndef GL_QCOM_texture_foveated_subsampled_layout
#define GL_QCOM_texture_foveated_subsampled_layout 1
#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004

Просмотреть файл

@ -570,6 +570,11 @@ GL_APICALL void GL_APIENTRY glImportSemaphoreZirconHandleANGLE(GLuint memory,
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
#endif /* GL_NV_robustness_video_memory */
#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 */
// clang-format on
#endif // INCLUDE_GLES2_GL2EXT_ANGLE_H_

Просмотреть файл

@ -150,10 +150,13 @@ typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FCONTEXTANGLEPROC)(GLeglContext ctx
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);
@ -163,9 +166,11 @@ typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESCONTEXTANGLEPROC)(GLeglCont
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);
@ -174,11 +179,13 @@ typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTCONTEXTANGLEPROC)(GLeglContex
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);
@ -203,11 +210,13 @@ typedef void (GL_APIENTRYP PFNGLENABLEIOESCONTEXTANGLEPROC)(GLeglContext ctx, GL
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);
@ -218,20 +227,27 @@ typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTCONTEXTANGLEPROC)(GLeglConte
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);
@ -245,9 +261,11 @@ typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTCONTEXTANGLEPROC)(GLeglContext
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);
@ -257,16 +275,54 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTCONTEXTANGLEPROC)(
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);
@ -277,7 +333,9 @@ typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESCONTEXTANGLEPROC)(GLeglContext ctx,
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);
@ -289,6 +347,8 @@ typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTCONTEXTANGLEPROC)(GLeglContext
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);
@ -366,7 +426,7 @@ typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VROBUSTANGLECONTEXTANGLEPROC)(
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 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);
@ -533,10 +593,13 @@ GL_APICALL void GL_APIENTRY glVertexAttrib4fContextANGLE(GLeglContext ctx, GLuin
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);
@ -546,9 +609,11 @@ GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOESContextANGLE(GLeglContext ctx
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);
@ -557,11 +622,13 @@ GL_APICALL void GL_APIENTRY glCopyImageSubDataEXTContextANGLE(GLeglContext ctx,
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);
@ -586,11 +653,13 @@ GL_APICALL void GL_APIENTRY glEnableiOESContextANGLE(GLeglContext ctx, GLenum ta
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);
@ -601,20 +670,27 @@ GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXTContextANGLE(GLeglContext ctx,
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);
@ -628,9 +704,11 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXTContextANGLE(GLeglContext ctx, G
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);
@ -640,16 +718,54 @@ GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXTContextANGLE(GLeglCo
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);
@ -660,7 +776,9 @@ GL_APICALL void GL_APIENTRY glTexBufferOESContextANGLE(GLeglContext ctx, GLenum
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);
@ -672,6 +790,8 @@ GL_APICALL void GL_APIENTRY glTexStorageMem3DEXTContextANGLE(GLeglContext ctx, G
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);
@ -749,7 +869,7 @@ GL_APICALL void GL_APIENTRY glGetQueryObjectui64vRobustANGLEContextANGLE(GLeglCo
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 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);

Просмотреть файл

@ -1,20 +1,17 @@
#ifndef __gl2platform_h_
#define __gl2platform_h_
/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
** Copyright 2017-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
* Please contribute modifications back to Khronos as pull requests on the
* public github repository:
* https://github.com/KhronosGroup/OpenGL-Registry
*/
#include <KHR/khrplatform.h>

Просмотреть файл

@ -6,28 +6,9 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
@ -44,7 +25,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20181130 */
/* Generated on date 20210107 */
/* Generated C header for:
* API: gles2
@ -477,7 +458,7 @@ typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
@ -620,7 +601,7 @@ GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
@ -1068,7 +1049,7 @@ typedef void (GL_APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync);
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data);
typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
typedef void (GL_APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
typedef void (GL_APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
typedef void (GL_APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers);
@ -1095,7 +1076,7 @@ typedef void (GL_APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsiz
typedef void (GL_APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
#if GL_GLES_PROTOTYPES
GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src);
GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
@ -1173,7 +1154,7 @@ GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
@ -1200,7 +1181,7 @@ GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numA
GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params);
#endif
#endif /* GL_ES_VERSION_3_0 */

Просмотреть файл

@ -1,39 +1,18 @@
#ifndef __gl31_h_
#define __gl31_h_ 1
#ifndef __gles2_gl31_h_
#define __gles2_gl31_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2016 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision$ on $Date$
** https://github.com/KhronosGroup/OpenGL-Registry
*/
#include <GLES3/gl3platform.h>
@ -46,7 +25,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20161024 */
/* Generated on date 20191013 */
/* Generated C header for:
* API: gles2
@ -64,8 +43,8 @@ extern "C" {
typedef khronos_int8_t GLbyte;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef short GLshort;
typedef unsigned short GLushort;
typedef khronos_int16_t GLshort;
typedef khronos_uint16_t GLushort;
typedef void GLvoid;
typedef struct __GLsync *GLsync;
typedef khronos_int64_t GLint64;
@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei
#ifndef GL_ES_VERSION_3_0
#define GL_ES_VERSION_3_0 1
typedef unsigned short GLhalf;
typedef khronos_uint16_t GLhalf;
#define GL_READ_BUFFER 0x0C02
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#define GL_UNPACK_SKIP_ROWS 0x0CF3

Просмотреть файл

@ -1,39 +1,18 @@
#ifndef __gl32_h_
#define __gl32_h_ 1
#ifndef __gles2_gl32_h_
#define __gles2_gl32_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2016 The Khronos Group Inc.
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision$ on $Date$
** https://github.com/KhronosGroup/OpenGL-Registry
*/
#include <GLES3/gl3platform.h>
@ -46,7 +25,7 @@ extern "C" {
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20161024 */
/* Generated on date 20191013 */
/* Generated C header for:
* API: gles2
@ -64,8 +43,8 @@ extern "C" {
typedef khronos_int8_t GLbyte;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef short GLshort;
typedef unsigned short GLushort;
typedef khronos_int16_t GLshort;
typedef khronos_uint16_t GLushort;
typedef void GLvoid;
typedef struct __GLsync *GLsync;
typedef khronos_int64_t GLint64;
@ -672,7 +651,7 @@ GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei
#ifndef GL_ES_VERSION_3_0
#define GL_ES_VERSION_3_0 1
typedef unsigned short GLhalf;
typedef khronos_uint16_t GLhalf;
#define GL_READ_BUFFER 0x0C02
#define GL_UNPACK_ROW_LENGTH 0x0CF2
#define GL_UNPACK_SKIP_ROWS 0x0CF3

Просмотреть файл

@ -1,20 +1,17 @@
#ifndef __gl3platform_h_
#define __gl3platform_h_
/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
** Copyright 2017-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
*/
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
* Please contribute modifications back to Khronos as pull requests on the
* public github repository:
* https://github.com/KhronosGroup/OpenGL-Registry
*/
#include <KHR/khrplatform.h>

Просмотреть файл

@ -26,7 +26,7 @@
// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 239
#define ANGLE_SH_VERSION 257
enum ShShaderSpec
{
@ -39,6 +39,8 @@ enum ShShaderSpec
SH_GLES3_1_SPEC,
SH_WEBGL3_SPEC,
SH_GLES3_2_SPEC,
SH_GL_CORE_SPEC,
SH_GL_COMPATIBILITY_SPEC,
};
@ -67,12 +69,11 @@ enum ShShaderOutput
SH_HLSL_4_1_OUTPUT = 0x8B49, // D3D 11
SH_HLSL_4_0_FL9_3_OUTPUT = 0x8B4A, // D3D 11 feature level 9_3
// Output specialized GLSL to be fed to glslang for Vulkan SPIR.
SH_GLSL_VULKAN_OUTPUT = 0x8B4B,
// Output SPIR-V for the Vulkan backend.
SH_SPIRV_VULKAN_OUTPUT = 0x8B4B,
// Output specialized GLSL to be fed to glslang for Vulkan SPIR to be cross compiled to Metal
// later.
SH_GLSL_METAL_OUTPUT = 0x8B4C,
// Output SPIR-V to be cross compiled to Metal.
SH_SPIRV_METAL_OUTPUT = 0x8B4C,
};
// Compile options.
@ -87,14 +88,8 @@ const ShCompileOptions SH_VARIABLES = UINT64_C(1) << 3;
const ShCompileOptions SH_LINE_DIRECTIVES = UINT64_C(1) << 4;
const ShCompileOptions SH_SOURCE_PATH = UINT64_C(1) << 5;
// This flag will keep invariant declaration for input in fragment shader for GLSL >=4.20 on AMD.
// From GLSL >= 4.20, it's optional to add invariant for fragment input, but GPU vendors have
// different implementations about this. Some drivers forbid invariant in fragment for GLSL>= 4.20,
// e.g. Linux Mesa, some drivers treat that as optional, e.g. NVIDIA, some drivers require invariant
// must match between vertex and fragment shader, e.g. AMD. The behavior on AMD is obviously wrong.
// Remove invariant for input in fragment shader to workaround the restriction on Intel Mesa.
// But don't remove on AMD Linux to avoid triggering the bug on AMD.
const ShCompileOptions SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT = UINT64_C(1) << 6;
// If requested, validates the AST after every transformation. Useful for debugging.
const ShCompileOptions SH_VALIDATE_AST = UINT64_C(1) << 6;
// Due to spec difference between GLSL 4.1 or lower and ESSL3, some platforms (for example, Mac OSX
// core profile) require a variable's "invariant"/"centroid" qualifiers to match between vertex and
@ -163,49 +158,40 @@ const ShCompileOptions SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS = UINT64_C(1) <
// struct scopes correctly, including all Mac drivers and Linux AMD.
const ShCompileOptions SH_REGENERATE_STRUCT_NAMES = UINT64_C(1) << 17;
// This flag makes the compiler not prune unused function early in the
// compilation process. Pruning coupled with SH_LIMIT_CALL_STACK_DEPTH
// helps avoid bad shaders causing stack overflows.
const ShCompileOptions SH_DONT_PRUNE_UNUSED_FUNCTIONS = UINT64_C(1) << 18;
// This flag works around a bug in NVIDIA 331 series drivers related
// to pow(x, y) where y is a constant vector.
const ShCompileOptions SH_REMOVE_POW_WITH_CONSTANT_EXPONENT = UINT64_C(1) << 19;
// This flag works around bugs in Mac drivers related to do-while by
// transforming them into an other construct.
const ShCompileOptions SH_REWRITE_DO_WHILE_LOOPS = UINT64_C(1) << 20;
const ShCompileOptions SH_REWRITE_DO_WHILE_LOOPS = UINT64_C(1) << 18;
// This flag works around a bug in the HLSL compiler optimizer that folds certain
// constant pow expressions incorrectly. Only applies to the HLSL back-end. It works
// by expanding the integer pow expressions into a series of multiplies.
const ShCompileOptions SH_EXPAND_SELECT_HLSL_INTEGER_POW_EXPRESSIONS = UINT64_C(1) << 21;
const ShCompileOptions SH_EXPAND_SELECT_HLSL_INTEGER_POW_EXPRESSIONS = UINT64_C(1) << 19;
// Flatten "#pragma STDGL invariant(all)" into the declarations of
// varying variables and built-in GLSL variables. This compiler
// option is enabled automatically when needed.
const ShCompileOptions SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL = UINT64_C(1) << 22;
const ShCompileOptions SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL = UINT64_C(1) << 20;
// Some drivers do not take into account the base level of the texture in the results of the
// HLSL GetDimensions builtin. This flag instructs the compiler to manually add the base level
// offsetting.
const ShCompileOptions SH_HLSL_GET_DIMENSIONS_IGNORES_BASE_LEVEL = UINT64_C(1) << 23;
const ShCompileOptions SH_HLSL_GET_DIMENSIONS_IGNORES_BASE_LEVEL = UINT64_C(1) << 21;
// This flag works around an issue in translating GLSL function texelFetchOffset on
// INTEL drivers. It works by translating texelFetchOffset into texelFetch.
const ShCompileOptions SH_REWRITE_TEXELFETCHOFFSET_TO_TEXELFETCH = UINT64_C(1) << 24;
const ShCompileOptions SH_REWRITE_TEXELFETCHOFFSET_TO_TEXELFETCH = UINT64_C(1) << 22;
// This flag works around condition bug of for and while loops in Intel Mac OSX drivers.
// Condition calculation is not correct. Rewrite it from "CONDITION" to "CONDITION && true".
const ShCompileOptions SH_ADD_AND_TRUE_TO_LOOP_CONDITION = UINT64_C(1) << 25;
const ShCompileOptions SH_ADD_AND_TRUE_TO_LOOP_CONDITION = UINT64_C(1) << 23;
// This flag works around a bug in evaluating unary minus operator on integer on some INTEL
// drivers. It works by translating -(int) into ~(int) + 1.
const ShCompileOptions SH_REWRITE_INTEGER_UNARY_MINUS_OPERATOR = UINT64_C(1) << 26;
const ShCompileOptions SH_REWRITE_INTEGER_UNARY_MINUS_OPERATOR = UINT64_C(1) << 24;
// This flag works around a bug in evaluating isnan() on some INTEL D3D and Mac OSX drivers.
// It works by using an expression to emulate this function.
const ShCompileOptions SH_EMULATE_ISNAN_FLOAT_FUNCTION = UINT64_C(1) << 27;
const ShCompileOptions SH_EMULATE_ISNAN_FLOAT_FUNCTION = UINT64_C(1) << 25;
// This flag will use all uniforms of unused std140 and shared uniform blocks at the
// beginning of the vertex/fragment shader's main(). It is intended as a workaround for Mac
@ -213,19 +199,19 @@ const ShCompileOptions SH_EMULATE_ISNAN_FLOAT_FUNCTION = UINT64_C(1) << 27;
// std140 and shared uniform blocks' members as inactive. However, WebGL2.0 based on
// OpenGL ES3.0.4 requires all members of a named uniform block declared with a shared or std140
// layout qualifier to be considered active. The uniform block itself is also considered active.
const ShCompileOptions SH_USE_UNUSED_STANDARD_SHARED_BLOCKS = UINT64_C(1) << 28;
const ShCompileOptions SH_USE_UNUSED_STANDARD_SHARED_BLOCKS = UINT64_C(1) << 26;
// This flag works around a bug in unary minus operator on float numbers on Intel
// Mac OSX 10.11 drivers. It works by translating -float into 0.0 - float.
const ShCompileOptions SH_REWRITE_FLOAT_UNARY_MINUS_OPERATOR = UINT64_C(1) << 29;
const ShCompileOptions SH_REWRITE_FLOAT_UNARY_MINUS_OPERATOR = UINT64_C(1) << 27;
// This flag works around a bug in evaluating atan(y, x) on some NVIDIA OpenGL drivers.
// It works by using an expression to emulate this function.
const ShCompileOptions SH_EMULATE_ATAN2_FLOAT_FUNCTION = UINT64_C(1) << 30;
const ShCompileOptions SH_EMULATE_ATAN2_FLOAT_FUNCTION = UINT64_C(1) << 28;
// Set to initialize uninitialized local and global temporary variables. Should only be used with
// GLSL output. In HLSL output variables are initialized regardless of if this flag is set.
const ShCompileOptions SH_INITIALIZE_UNINITIALIZED_LOCALS = UINT64_C(1) << 31;
const ShCompileOptions SH_INITIALIZE_UNINITIALIZED_LOCALS = UINT64_C(1) << 29;
// The flag modifies the shader in the following way:
// Every occurrence of gl_InstanceID is replaced by the global temporary variable InstanceID.
@ -234,7 +220,7 @@ const ShCompileOptions SH_INITIALIZE_UNINITIALIZED_LOCALS = UINT64_C(1) << 31;
// ViewID_OVR = uint(gl_InstanceID) % num_views;
// InstanceID = gl_InstanceID / num_views;
// ViewID_OVR is added as a varying variable to both the vertex and fragment shaders.
const ShCompileOptions SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW = UINT64_C(1) << 32;
const ShCompileOptions SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW = UINT64_C(1) << 30;
// With the flag enabled the GLSL/ESSL vertex shader is modified to include code for viewport
// selection in the following way:
@ -244,11 +230,11 @@ const ShCompileOptions SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW = UINT64_C
// - A declaration of the uniform multiviewBaseViewLayerIndex.
// Note: The SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW flag also has to be enabled to have the
// temporary variable ViewID_OVR declared and initialized.
const ShCompileOptions SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER = UINT64_C(1) << 33;
const ShCompileOptions SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER = UINT64_C(1) << 31;
// 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) << 34;
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
@ -256,90 +242,100 @@ const ShCompileOptions SH_CLAMP_POINT_SIZE = UINT64_C(1) << 34;
//
// 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) << 35;
const ShCompileOptions SH_REWRITE_VECTOR_SCALAR_ARITHMETIC = 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) << 36;
const ShCompileOptions SH_DONT_USE_LOOPS_TO_INITIALIZE_VARIABLES = UINT64_C(1) << 34;
// Don't use D3D constant register zero when allocating space for uniforms. 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. Only has an effect on HLSL translation.
const ShCompileOptions SH_SKIP_D3D_CONSTANT_REGISTER_ZERO = UINT64_C(1) << 37;
const ShCompileOptions SH_SKIP_D3D_CONSTANT_REGISTER_ZERO = UINT64_C(1) << 35;
// Clamp gl_FragDepth to the range [0.0, 1.0] in case it is statically used.
const ShCompileOptions SH_CLAMP_FRAG_DEPTH = UINT64_C(1) << 38;
const ShCompileOptions SH_CLAMP_FRAG_DEPTH = UINT64_C(1) << 36;
// Rewrite expressions like "v.x = z = expression;". Works around a bug in NVIDIA OpenGL drivers
// prior to version 397.31.
const ShCompileOptions SH_REWRITE_REPEATED_ASSIGN_TO_SWIZZLED = UINT64_C(1) << 39;
const ShCompileOptions SH_REWRITE_REPEATED_ASSIGN_TO_SWIZZLED = UINT64_C(1) << 37;
// Rewrite gl_DrawID as a uniform int
const ShCompileOptions SH_EMULATE_GL_DRAW_ID = UINT64_C(1) << 40;
const ShCompileOptions SH_EMULATE_GL_DRAW_ID = UINT64_C(1) << 38;
// This flag initializes shared variables to 0.
// It is to avoid ompute shaders being able to read undefined values that could be coming from
// another webpage/application.
const ShCompileOptions SH_INIT_SHARED_VARIABLES = UINT64_C(1) << 41;
const ShCompileOptions SH_INIT_SHARED_VARIABLES = UINT64_C(1) << 39;
// 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
const ShCompileOptions SH_FORCE_ATOMIC_VALUE_RESOLUTION = UINT64_C(1) << 42;
const ShCompileOptions SH_FORCE_ATOMIC_VALUE_RESOLUTION = UINT64_C(1) << 40;
// Rewrite gl_BaseVertex and gl_BaseInstance as uniform int
const ShCompileOptions SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE = UINT64_C(1) << 43;
const ShCompileOptions SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE = UINT64_C(1) << 41;
// Emulate seamful cube map sampling for OpenGL ES2.0. Currently only applies to the Vulkan
// backend, as is done after samplers are moved out of structs. Can likely be made to work on
// the other backends as well.
const ShCompileOptions SH_EMULATE_SEAMFUL_CUBE_MAP_SAMPLING = UINT64_C(1) << 44;
const ShCompileOptions SH_EMULATE_SEAMFUL_CUBE_MAP_SAMPLING = UINT64_C(1) << 42;
// This flag controls how to translate WEBGL_video_texture sampling function.
const ShCompileOptions SH_TAKE_VIDEO_TEXTURE_AS_EXTERNAL_OES = UINT64_C(1) << 45;
// If requested, validates the AST after every transformation. Useful for debugging.
const ShCompileOptions SH_VALIDATE_AST = UINT64_C(1) << 46;
// Use old version of RewriteStructSamplers, which doesn't produce as many
// sampler arrays in parameters. This causes a few tests to pass on Android.
const ShCompileOptions SH_USE_OLD_REWRITE_STRUCT_SAMPLERS = UINT64_C(1) << 47;
const ShCompileOptions SH_TAKE_VIDEO_TEXTURE_AS_EXTERNAL_OES = UINT64_C(1) << 43;
// This flag works around a inconsistent behavior in Mac AMD driver where gl_VertexID doesn't
// include base vertex value. It replaces gl_VertexID with (gl_VertexID + angle_BaseVertex)
// when angle_BaseVertex is available.
const ShCompileOptions SH_ADD_BASE_VERTEX_TO_VERTEX_ID = UINT64_C(1) << 48;
const ShCompileOptions SH_ADD_BASE_VERTEX_TO_VERTEX_ID = UINT64_C(1) << 44;
// This works around the dynamic lvalue indexing of swizzled vectors on various platforms.
const ShCompileOptions SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR = UINT64_C(1) << 49;
const ShCompileOptions SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR = UINT64_C(1) << 45;
// This flag works around a slow fxc compile performance issue with dynamic uniform indexing.
const ShCompileOptions SH_ALLOW_TRANSLATE_UNIFORM_BLOCK_TO_STRUCTUREDBUFFER = UINT64_C(1) << 50;
const ShCompileOptions SH_ALLOW_TRANSLATE_UNIFORM_BLOCK_TO_STRUCTUREDBUFFER = UINT64_C(1) << 46;
// This flag indicates whether Bresenham line raster emulation code should be generated. This
// emulation is necessary if the backend uses a differnet algorithm to draw lines. Currently only
// implemented for the Vulkan backend.
const ShCompileOptions SH_ADD_BRESENHAM_LINE_RASTER_EMULATION = UINT64_C(1) << 51;
const ShCompileOptions SH_ADD_BRESENHAM_LINE_RASTER_EMULATION = UINT64_C(1) << 47;
// This flag allows disabling ARB_texture_rectangle on a per-compile basis. This is necessary
// for WebGL contexts becuase ARB_texture_rectangle may be necessary for the WebGL implementation
// internally but shouldn't be exposed to WebGL user code.
const ShCompileOptions SH_DISABLE_ARB_TEXTURE_RECTANGLE = UINT64_C(1) << 52;
const ShCompileOptions SH_DISABLE_ARB_TEXTURE_RECTANGLE = UINT64_C(1) << 48;
// This flag works around a driver bug by rewriting uses of row-major matrices
// as column-major in ESSL 3.00 and greater shaders.
const ShCompileOptions SH_REWRITE_ROW_MAJOR_MATRICES = UINT64_C(1) << 53;
const ShCompileOptions SH_REWRITE_ROW_MAJOR_MATRICES = UINT64_C(1) << 49;
// Drop any explicit precision qualifiers from shader.
const ShCompileOptions SH_IGNORE_PRECISION_QUALIFIERS = UINT64_C(1) << 54;
const ShCompileOptions SH_IGNORE_PRECISION_QUALIFIERS = UINT64_C(1) << 50;
// Allow compiler to do early fragment tests as an optimization.
const ShCompileOptions SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION = UINT64_C(1) << 55;
const ShCompileOptions SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION = UINT64_C(1) << 51;
// Allow compiler to insert Android pre-rotation code.
const ShCompileOptions SH_ADD_PRE_ROTATION = UINT64_C(1) << 56;
const ShCompileOptions SH_ADD_PRE_ROTATION = UINT64_C(1) << 52;
const ShCompileOptions SH_FORCE_SHADER_PRECISION_HIGHP_TO_MEDIUMP = UINT64_C(1) << 53;
// Allow compiler to use specialization constant to do pre-rotation and y flip.
const ShCompileOptions SH_USE_SPECIALIZATION_CONSTANT = UINT64_C(1) << 54;
// Ask compiler to generate Vulkan transform feedback emulation support code.
const ShCompileOptions SH_ADD_VULKAN_XFB_EMULATION_SUPPORT_CODE = UINT64_C(1) << 55;
// Ask compiler to generate Vulkan transform feedback support code when using the
// VK_EXT_transform_feedback extension.
const ShCompileOptions SH_ADD_VULKAN_XFB_EXTENSION_SUPPORT_CODE = UINT64_C(1) << 56;
// 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
@ -384,6 +380,7 @@ struct ShBuiltInResources
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;
@ -393,6 +390,8 @@ struct ShBuiltInResources
int EXT_multisampled_render_to_texture2;
int EXT_YUV_target;
int EXT_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;
@ -407,8 +406,11 @@ struct ShBuiltInResources
int EXT_shadow_samplers;
int OES_shader_multisample_interpolation;
int OES_shader_image_atomic;
int EXT_tessellation_shader;
int OES_texture_buffer;
int EXT_texture_buffer;
int OES_sample_variables;
int EXT_clip_cull_distance;
// 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
@ -466,6 +468,10 @@ struct ShBuiltInResources
// maximum number of available image units
int MaxImageUnits;
// OES_sample_variables constant
// maximum number of available samples
int MaxSamples;
// maximum number of image uniforms in a vertex shader
int MaxVertexImageUniforms;
@ -548,11 +554,35 @@ struct ShBuiltInResources
int MaxGeometryShaderInvocations;
int MaxGeometryImageUniforms;
// EXT_tessellation_shader constants
int MaxTessControlInputComponents;
int MaxTessControlOutputComponents;
int MaxTessControlTextureImageUnits;
int MaxTessControlUniformComponents;
int MaxTessControlTotalOutputComponents;
int MaxTessControlImageUniforms;
int MaxTessControlAtomicCounters;
int MaxTessControlAtomicCounterBuffers;
int MaxTessPatchComponents;
int MaxPatchVertices;
int MaxTessGenLevel;
int MaxTessEvaluationInputComponents;
int MaxTessEvaluationOutputComponents;
int MaxTessEvaluationTextureImageUnits;
int MaxTessEvaluationUniformComponents;
int MaxTessEvaluationImageUniforms;
int MaxTessEvaluationAtomicCounters;
int MaxTessEvaluationAtomicCounterBuffers;
// Subpixel bits used in rasterization.
int SubPixelBits;
// APPLE_clip_distance/EXT_clip_cull_distance constant
int MaxClipDistances;
int MaxCullDistances;
int MaxCombinedClipAndCullDistances;
};
//
@ -566,6 +596,7 @@ using ShHandle = void *;
namespace sh
{
using BinaryBlob = std::vector<uint32_t>;
//
// Driver must call this first, once, before doing any other compiler operations.
@ -628,7 +659,7 @@ void Destruct(ShHandle handle);
// 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.
// 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().
@ -652,11 +683,18 @@ ShShaderOutput GetShaderOutputType(const ShHandle handle);
// handle: Specifies the compiler
const std::string &GetInfoLog(const ShHandle handle);
// Returns null-terminated object code for a compiled shader.
// Returns null-terminated object code for a compiled shader. Only valid for output types that
// generate human-readable code (GLSL, ESSL or HLSL).
// Parameters:
// handle: Specifies the compiler
const std::string &GetObjectCode(const ShHandle handle);
// Returns object binary blob for a compiled shader. Only valid for output types that
// generate binary blob (SPIR-V).
// Parameters:
// handle: Specifies the compiler
const BinaryBlob &GetObjectBinaryBlob(const ShHandle handle);
// Returns a (original_name, hash) map containing all the user defined names in the shader,
// including variable names, function names, struct names, and struct field names.
// Parameters:
@ -685,6 +723,9 @@ int GetVertexShaderNumViews(const ShHandle handle);
// Returns true if compiler has injected instructions for early fragment tests as an optimization
bool HasEarlyFragmentTestsOptimization(const ShHandle handle);
// Returns specialization constant usage bits
uint32_t GetShaderSpecConstUsageBits(const ShHandle handle);
// Returns true if the passed in variables pack in maxVectors followingthe packing rules from the
// GLSL 1.017 spec, Appendix A, section 7.
// Returns false otherwise. Also look at the SH_ENFORCE_PACKING_RESTRICTIONS
@ -719,6 +760,7 @@ bool GetUniformBlockRegister(const ShHandle handle,
bool ShouldUniformBlockUseStructuredBuffer(const ShHandle handle,
const std::string &uniformBlockName);
const std::set<std::string> *GetSlowCompilingUniformBlockSet(const ShHandle handle);
// Gives a map from uniform names to compiler-assigned registers in the default uniform block.
// Note that the map contains also registers of samplers that have been extracted from structs.
@ -740,11 +782,20 @@ const std::set<std::string> *GetUsedImage2DFunctionNames(const ShHandle handle);
bool HasValidGeometryShaderInputPrimitiveType(const ShHandle handle);
bool HasValidGeometryShaderOutputPrimitiveType(const ShHandle handle);
bool HasValidGeometryShaderMaxVertices(const ShHandle handle);
bool HasValidTessGenMode(const ShHandle handle);
bool HasValidTessGenSpacing(const ShHandle handle);
bool HasValidTessGenVertexOrder(const ShHandle handle);
bool HasValidTessGenPointMode(const ShHandle handle);
GLenum GetGeometryShaderInputPrimitiveType(const ShHandle handle);
GLenum GetGeometryShaderOutputPrimitiveType(const ShHandle handle);
int GetGeometryShaderInvocations(const ShHandle handle);
int GetGeometryShaderMaxVertices(const ShHandle handle);
unsigned int GetShaderSharedMemorySize(const ShHandle handle);
int GetTessControlShaderVertices(const ShHandle handle);
GLenum GetTessGenMode(const ShHandle handle);
GLenum GetTessGenSpacing(const ShHandle handle);
GLenum GetTessGenVertexOrder(const ShHandle handle);
GLenum GetTessGenPointMode(const ShHandle handle);
//
// Helper function to identify specs that are based on the WebGL spec.
@ -775,8 +826,36 @@ enum class SpecializationConstantId : uint32_t
{
LineRasterEmulation = 0,
SurfaceRotation = 1,
DrawableWidth = 2,
DrawableHeight = 3,
InvalidEnum = 2,
InvalidEnum = 4,
EnumCount = InvalidEnum,
};
enum class SurfaceRotation : uint32_t
{
Identity,
Rotated90Degrees,
Rotated180Degrees,
Rotated270Degrees,
FlippedIdentity,
FlippedRotated90Degrees,
FlippedRotated180Degrees,
FlippedRotated270Degrees,
InvalidEnum,
EnumCount = InvalidEnum,
};
enum class SpecConstUsage : uint32_t
{
LineRasterEmulation = 0,
YFlip = 1,
Rotation = 2,
DrawableSize = 3,
InvalidEnum = 4,
EnumCount = InvalidEnum,
};
@ -798,6 +877,19 @@ extern const char kAtomicCountersBlockName[];
// Line raster emulation varying
extern const char kLineRasterEmulationPosition[];
// Transform feedback emulation support
extern const char kXfbEmulationGetOffsetsFunctionName[];
extern const char kXfbEmulationCaptureFunctionName[];
extern const char kXfbEmulationBufferBlockName[];
extern const char kXfbEmulationBufferName[];
extern const char kXfbEmulationBufferFieldName[];
// Transform feedback extension support
extern const char kXfbExtensionPositionOutName[];
// EXT_shader_framebuffer_fetch and EXT_shader_framebuffer_fetch_non_coherent
extern const char kInputAttachmentName[];
} // namespace vk
namespace mtl
@ -808,6 +900,13 @@ extern const char kCoverageMaskEnabledConstName[];
// Specialization constant to emulate rasterizer discard.
extern const char kRasterizerDiscardEnabledConstName[];
} // 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().
void InitializeGlslang();
void FinalizeGlslang();
} // namespace sh
#endif // GLSLANG_SHADERLANG_H_

Просмотреть файл

@ -51,11 +51,6 @@ enum class BlockType
{
BLOCK_UNIFORM,
BLOCK_BUFFER,
// Required in OpenGL ES 3.1 extension GL_OES_shader_io_blocks.
// TODO(jiawei.shao@intel.com): add BLOCK_OUT.
// Also used in GLSL
BLOCK_IN
};
// Base class for all variables defined in shaders, including Varyings, Uniforms, etc
@ -105,6 +100,8 @@ struct ShaderVariable
unsigned int getExternalSize() const;
bool isStruct() const { return !fields.empty(); }
const std::string &getStructName() const { return structOrBlockName; }
void setStructName(const std::string &newName) { structOrBlockName = newName; }
// All of the shader's variables are described using nested data
// structures. This is needed in order to disambiguate similar looking
@ -128,14 +125,6 @@ struct ShaderVariable
bool isBuiltIn() const;
bool isEmulatedBuiltIn() const;
GLenum type;
GLenum precision;
std::string name;
std::string mappedName;
// Used to make an array type. Outermost array size is stored at the end of the vector.
std::vector<unsigned int> arraySizes;
// Offset of this variable in parent arrays. In case the parent is an array of arrays, the
// offset is outerArrayElement * innerArraySize + innerArrayElement.
// For example, if there's a variable declared as size 3 array of size 4 array of int:
@ -147,10 +136,51 @@ struct ShaderVariable
return hasParentArrayIndex() ? flattenedOffsetInParentArrays : 0;
}
int getFlattenedOffsetInParentArrays() const { return flattenedOffsetInParentArrays; }
void setParentArrayIndex(int indexIn) { flattenedOffsetInParentArrays = indexIn; }
bool hasParentArrayIndex() const { return flattenedOffsetInParentArrays != -1; }
void resetEffectiveLocation();
void updateEffectiveLocation(const sh::ShaderVariable &parent);
// Decide whether two uniforms are the same at shader link time,
// assuming they are from consecutive shader stages.
// GLSL ES Spec 3.00.3, section 4.3.5.
// GLSL ES Spec 3.10.4, section 4.4.5
bool isSameUniformAtLinkTime(const ShaderVariable &other) const;
// InterfaceBlockField
// Decide whether two InterfaceBlock fields are the same at shader
// link time, assuming they are from consecutive shader stages.
// See GLSL ES Spec 3.00.3, sec 4.3.7.
bool isSameInterfaceBlockFieldAtLinkTime(const ShaderVariable &other) const;
// Decide whether two varyings are the same at shader link time,
// assuming they are from consecutive shader stages.
// Invariance needs to match only in ESSL1. Relevant spec sections:
// GLSL ES 3.00.4, sections 4.6.1 and 4.3.9.
// GLSL ES 1.00.17, section 4.6.4.
bool isSameVaryingAtLinkTime(const ShaderVariable &other, int shaderVersion) const;
// Deprecated version of isSameVaryingAtLinkTime, which assumes ESSL1.
bool isSameVaryingAtLinkTime(const ShaderVariable &other) const;
// Shader I/O blocks may match by block name or instance, based on whether both stages have an
// instance name or not.
bool isSameNameAtLinkTime(const ShaderVariable &other) const;
// NOTE: When adding new members, the following functions also need to be updated:
// gl::WriteShaderVar(BinaryOutputStream *stream, const sh::ShaderVariable &var)
// gl::LoadShaderVar(BinaryInputStream *stream, sh::ShaderVariable *var)
GLenum type;
GLenum precision;
std::string name;
std::string mappedName;
// Used to make an array type. Outermost array size is stored at the end of the vector.
std::vector<unsigned int> arraySizes;
// Static use means that the variable is accessed somewhere in the shader source.
bool staticUse;
// A variable is active unless the compiler determined that it is not accessed by the shader.
@ -158,7 +188,11 @@ struct ShaderVariable
// necessarily active. GLES 3.0.5 section 2.12.6. GLES 3.1 section 7.3.1.
bool active;
std::vector<ShaderVariable> fields;
std::string structName;
// structOrBlockName is used for:
// - varyings of struct type, in which case it contains the struct name.
// - shader I/O blocks, in which case it contains the block name.
std::string structOrBlockName;
std::string mappedStructOrBlockName;
// Only applies to interface block fields. Kept here for simplicity.
bool isRowMajorLayout;
@ -166,40 +200,34 @@ struct ShaderVariable
// VariableWithLocation
int location;
// The location of inputs or outputs without location layout quailifer will be updated to '-1'.
// GLES Spec 3.1, Section 7.3. PROGRAM OBJECTS
// Not all active variables are assigned valid locations;
// the following variables will have an effective location of -1:
bool hasImplicitLocation;
// Uniform
int binding;
// Decide whether two uniforms are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader.
// GLSL ES Spec 3.00.3, section 4.3.5.
// GLSL ES Spec 3.10.4, section 4.4.5
bool isSameUniformAtLinkTime(const ShaderVariable &other) const;
GLenum imageUnitFormat;
int offset;
bool readonly;
bool writeonly;
// From EXT_shader_framebuffer_fetch
bool isFragmentInOut;
// OutputVariable
// From EXT_blend_func_extended.
int index;
// InterfaceBlockField
// Decide whether two InterfaceBlock fields are the same at shader
// link time, assuming one from vertex shader and the other from
// fragment shader.
// See GLSL ES Spec 3.00.3, sec 4.3.7.
bool isSameInterfaceBlockFieldAtLinkTime(const ShaderVariable &other) const;
// From EXT_YUV_target
bool yuv;
// Varying
InterpolationType interpolation;
bool isInvariant;
// Decide whether two varyings are the same at shader link time,
// assuming one from vertex shader and the other from fragment shader.
// Invariance needs to match only in ESSL1. Relevant spec sections:
// GLSL ES 3.00.4, sections 4.6.1 and 4.3.9.
// GLSL ES 1.00.17, section 4.6.4.
bool isSameVaryingAtLinkTime(const ShaderVariable &other, int shaderVersion) const;
// Deprecated version of isSameVaryingAtLinkTime, which assumes ESSL1.
bool isSameVaryingAtLinkTime(const ShaderVariable &other) const;
bool isShaderIOBlock;
bool isPatch;
// If the variable is a sampler that has ever been statically used with texelFetch
bool texelFetchStaticUse;
@ -209,6 +237,10 @@ struct ShaderVariable
bool matchPrecision,
bool matchName) const;
// NOTE: When adding new members, the following functions also need to be updated:
// gl::WriteShaderVar(BinaryOutputStream *stream, const sh::ShaderVariable &var)
// gl::LoadShaderVar(BinaryInputStream *stream, sh::ShaderVariable *var)
int flattenedOffsetInParentArrays;
};

Просмотреть файл

@ -90,12 +90,20 @@
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C

Просмотреть файл

@ -12,14 +12,14 @@
#if !defined(ANGLE_EXPORT)
# if defined(_WIN32)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION)
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) || defined(LIBCL_IMPLEMENTATION)
# define ANGLE_EXPORT __declspec(dllexport)
# else
# define ANGLE_EXPORT __declspec(dllimport)
# endif
# elif defined(__GNUC__)
# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION) || \
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION)
defined(LIBFEATURE_SUPPORT_IMPLEMENTATION) || defined(LIBCL_IMPLEMENTATION)
# define ANGLE_EXPORT __attribute__((visibility("default")))
# else
# define ANGLE_EXPORT

Просмотреть файл

@ -37,6 +37,10 @@ struct FeaturesGL : FeatureSetBase
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};
// 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
@ -505,6 +509,52 @@ struct FeaturesGL : FeatureSetBase
"set_zero_level_before_generating_mipmap", FeatureCategory::OpenGLWorkarounds,
"glGenerateMipmap fails if the zero texture level is not set on some Mac drivers.",
&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 = {
"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 = {
"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 = {
"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 = {
"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 = {
"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"};
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"};
};
inline FeaturesGL::FeaturesGL() = default;

Просмотреть файл

@ -64,6 +64,13 @@ struct FeaturesVk : FeatureSetBase
"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 = {
"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
@ -201,6 +208,13 @@ struct FeaturesVk : FeatureSetBase
"extension with the independentResolveNone feature",
&members, "http://anglebug.com/4836"};
// Whether the VkDevice supports the VK_EXT_multisampled_render_to_single_sampled extension.
// http://anglebug.com/4836
Feature 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,
@ -248,14 +262,6 @@ struct FeaturesVk : FeatureSetBase
"Seamful cube map emulation misbehaves on some drivers, so it's disallowed", &members,
"http://anglebug.com/3243"};
// Qualcomm and SwiftShader shader compiler doesn't support sampler arrays as parameters, so
// revert to old RewriteStructSamplers behavior, which produces fewer.
Feature forceOldRewriteStructSamplers = {
"forceOldRewriteStructSamplers", FeatureCategory::VulkanWorkarounds,
"Some shader compilers don't support sampler arrays as parameters, so revert to old "
"RewriteStructSamplers behavior, which produces fewer.",
&members, "http://anglebug.com/2703"};
// 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
@ -293,6 +299,17 @@ struct FeaturesVk : FeatureSetBase
"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};
// 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};
// 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.
@ -315,11 +332,6 @@ struct FeaturesVk : FeatureSetBase
"Enable Android pre-rotation for landscape applications",
&members, "http://anglebug.com/3502"};
// Cache FramebufferVk objects. Currently hitting a bug on Apple: http://anglebug.com/4442
Feature enableFramebufferVkCache = {"enableFramebufferVkCache", FeatureCategory::VulkanFeatures,
"Enable FramebufferVk objects to be cached", &members,
"http://anglebug.com/4442"};
// Enable precision qualifiers for shaders generated by Vulkan backend http://anglebug.com/3078
Feature enablePrecisionQualifiers = {
"enablePrecisionQualifiers", FeatureCategory::VulkanFeatures,
@ -334,19 +346,11 @@ struct FeaturesVk : FeatureSetBase
"fine grained pipeline stage dependency information",
&members, "http://anglebug.com/4633"};
// Tell Vulkan back-end to use CommandProcessor class to dispatch work to the GPU. The work will
// happen asynchronously in a different thread if asynchronousCommandProcessing is true.
// Otherwise use Renderer::CommandQueue to dispatch work.
Feature commandProcessor = {"commandProcessor", FeatureCategory::VulkanFeatures,
"Use CommandProcessor class to dispatch work to GPU.", &members,
"http://anglebug.com/4324"};
// Enable parallel thread execution when commandProcessor is enabled.
// Currently off by default.
Feature asynchronousCommandProcessing = {"asynchronousCommandProcessing",
FeatureCategory::VulkanFeatures,
"Enable/Disable parallel processing of worker thread",
&members, "http://anglebug.com/4324"};
// 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"};
// Whether the VkDevice supports the VK_KHR_shader_float16_int8 extension and has the
// shaderFloat16 feature.
@ -355,14 +359,6 @@ struct FeaturesVk : FeatureSetBase
"and has the shaderFloat16 feature",
&members, "http://anglebug.com/4551"};
// Whether the VkDevice supports the VK_EXT_shader_atomic_flat extension and has the
// shaderImageFloat32Atomics feature
Feature supportsShaderImageFloat32Atomics = {
"supportsShaderImageFloat32Atomics", FeatureCategory::VulkanFeatures,
"VkDevice supports the VK_EXT_shader_atomic_float extension and has the "
"shaderImageFloat32Atomics feature.",
&members, "http://anglebug.com/3578"};
// 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.
@ -427,12 +423,42 @@ struct FeaturesVk : FeatureSetBase
"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<angle::Feature, 4> 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},
};
// 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};
// 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};
// 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};
// Qualcomm missynchronizes vkCmdClearAttachments in the middle of render pass.
// https://issuetracker.google.com/166809097
Feature preferDrawClearOverVkCmdClearAttachments = {
@ -455,6 +481,46 @@ struct FeaturesVk : FeatureSetBase
Feature emulatedPrerotation270 = {"emulatedPrerotation270", FeatureCategory::VulkanFeatures,
"Emulate 270-degree prerotation.", &members,
"http://anglebug.com/4901"};
// Whether we should use driver uniforms over specialization constants for some shader
// modifications like yflip and rotation.
Feature 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 = {
"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 = {
"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};
// Whether we should force any highp precision in the fragment shader to mediump.
// ANGLE is non-conformant if this feature is enabled.
Feature 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 = {
"preferSubmitAtFBOBoundary", FeatureCategory::VulkanWorkarounds,
"Submit commands to driver at each FBO boundary for performance improvements.", &members,
"https://issuetracker.google.com/187425444"};
};
inline FeaturesVk::FeaturesVk() = default;

Просмотреть файл

@ -48,7 +48,7 @@ struct FrontendFeatures : angle::FeatureSetBase
angle::Feature scalarizeVecAndMatConstructorArgs = {
"scalarize_vec_and_mat_constructor_args", angle::FeatureCategory::FrontendWorkarounds,
"Always rewrite vec/mat constructors to be consistent", &members,
"http://crbug.com/398694"};
"http://crbug.com/1165751"};
// Disable support for GL_OES_get_program_binary
angle::Feature disableProgramBinary = {
@ -65,6 +65,17 @@ struct FrontendFeatures : angle::FeatureSetBase
angle::Feature allowCompressedFormats = {"allow_compressed_formats",
angle::FeatureCategory::FrontendWorkarounds,
"Allow compressed formats", &members};
angle::Feature captureLimits = {"enable_capture_limits",
angle::FeatureCategory::FrontendFeatures,
"Set the context limits like frame capturing was enabled",
&members, "http://anglebug.com/5750"};
// 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"};
};
inline FrontendFeatures::FrontendFeatures() = default;

Просмотреть файл

@ -47,9 +47,10 @@ const VkExternalSemaphoreHandleTypeFlagBits
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TEMP_ZIRCON_EVENT_BIT_FUCHSIA =
static_cast<VkExternalSemaphoreHandleTypeFlagBits>(0x00100000);
#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"
#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
{
@ -84,7 +85,7 @@ typedef VkResult(VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(
zx_handle_t ZirconHandle,
VkMemoryZirconHandlePropertiesFUCHSIA *pMemoryZirconHandleProperties);
#ifndef VK_NO_PROTOTYPES
# ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL
vkGetMemoryZirconHandleFUCHSIA(VkDevice device,
const VkMemoryGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo,
@ -95,11 +96,13 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
VkExternalMemoryHandleTypeFlagBits handleType,
zx_handle_t ZirconHandle,
VkMemoryZirconHandlePropertiesFUCHSIA *pMemoryZirconHandleProperties);
# endif
#endif
#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"
#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
{
@ -108,7 +111,7 @@ typedef struct VkImportSemaphoreZirconHandleInfoFUCHSIA
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
zx_handle_t handle;
zx_handle_t zirconHandle;
} VkImportSemaphoreZirconHandleInfoFUCHSIA;
typedef struct VkSemaphoreGetZirconHandleInfoFUCHSIA
@ -127,7 +130,7 @@ typedef VkResult(VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(
const VkSemaphoreGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo,
zx_handle_t *pZirconHandle);
#ifndef VK_NO_PROTOTYPES
# ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
VkDevice device,
const VkImportSemaphoreZirconHandleInfoFUCHSIA *pImportSemaphoreZirconHandleInfo);
@ -136,6 +139,7 @@ VKAPI_ATTR VkResult VKAPI_CALL
vkGetSemaphoreZirconHandleFUCHSIA(VkDevice device,
const VkSemaphoreGetZirconHandleInfoFUCHSIA *pGetZirconHandleInfo,
zx_handle_t *pZirconHandle);
# endif
#endif
#ifdef __cplusplus

Просмотреть файл

@ -1,4 +1,4 @@
#define ANGLE_COMMIT_HASH "31a43497be09"
#define ANGLE_COMMIT_HASH "23851a53779d"
#define ANGLE_COMMIT_HASH_SIZE 12
#define ANGLE_COMMIT_DATE "2021-06-11 16:58:24 -0700"
#define ANGLE_COMMIT_POSITION 14226
#define ANGLE_COMMIT_DATE "2021-09-14 18:27:26 -0700"
#define ANGLE_COMMIT_POSITION 15727

Просмотреть файл

@ -70,6 +70,9 @@ class FastVector final
void push_back(const value_type &value);
void push_back(value_type &&value);
template <typename... Args>
void emplace_back(Args &&... args);
void pop_back();
reference front();
@ -287,10 +290,17 @@ ANGLE_INLINE void FastVector<T, N, Storage>::push_back(const value_type &value)
template <class T, size_t N, class Storage>
ANGLE_INLINE void FastVector<T, N, Storage>::push_back(value_type &&value)
{
emplace_back(std::move(value));
}
template <class T, size_t N, class Storage>
template <typename... Args>
ANGLE_INLINE void FastVector<T, N, Storage>::emplace_back(Args &&... args)
{
if (mSize == mReservedSize)
ensure_capacity(mSize + 1);
mData[mSize++] = std::move(value);
mData[mSize++] = std::move(T(std::forward<Args>(args)...));
}
template <class T, size_t N, class Storage>
@ -551,11 +561,17 @@ class FastIntegerSet final
return (sizedKey < capacity()) && (mKeyData[index].test(offset));
}
ANGLE_INLINE void clear() { mKeyData.assign(mKeyData.capacity(), KeyBitSet::Zero()); }
ANGLE_INLINE void clear()
{
for (KeyBitSet &it : mKeyData)
{
it.reset();
}
}
ANGLE_INLINE bool empty() const
{
for (KeyBitSet it : mKeyData)
for (const KeyBitSet &it : mKeyData)
{
if (it.any())
{
@ -568,7 +584,7 @@ class FastIntegerSet final
ANGLE_INLINE size_t size() const
{
size_t valid_entries = 0;
for (KeyBitSet it : mKeyData)
for (const KeyBitSet &it : mKeyData)
{
valid_entries += it.count();
}

Просмотреть файл

@ -1,7 +1,7 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Copyright 2017 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.
//

Просмотреть файл

@ -1,7 +1,7 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Copyright 2017 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.
//
@ -14,7 +14,6 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <angle_gl.h>
#include <cstdint>
#include <ostream>

Просмотреть файл

@ -132,6 +132,7 @@ TextureType SamplerTypeToTextureType(GLenum samplerType)
return TextureType::_2D;
case GL_SAMPLER_EXTERNAL_OES:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return TextureType::External;
case GL_SAMPLER_CUBE:
@ -184,6 +185,46 @@ TextureType SamplerTypeToTextureType(GLenum samplerType)
}
}
TextureType ImageTypeToTextureType(GLenum imageType)
{
switch (imageType)
{
case GL_IMAGE_2D:
case GL_INT_IMAGE_2D:
case GL_UNSIGNED_INT_IMAGE_2D:
return TextureType::_2D;
case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE:
return TextureType::CubeMap;
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
return TextureType::CubeMapArray;
case GL_IMAGE_2D_ARRAY:
case GL_INT_IMAGE_2D_ARRAY:
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
return TextureType::_2DArray;
case GL_IMAGE_3D:
case GL_INT_IMAGE_3D:
case GL_UNSIGNED_INT_IMAGE_3D:
return TextureType::_3D;
case GL_IMAGE_BUFFER:
case GL_INT_IMAGE_BUFFER:
case GL_UNSIGNED_INT_IMAGE_BUFFER:
return TextureType::Buffer;
default:
UNREACHABLE();
return TextureType::InvalidEnum;
}
}
bool IsMultisampled(TextureType type)
{
switch (type)
@ -435,6 +476,56 @@ std::ostream &operator<<(std::ostream &os, VertexAttribType value)
}
return os;
}
std::ostream &operator<<(std::ostream &os, TessEvaluationType value)
{
switch (value)
{
case TessEvaluationType::Triangles:
os << "GL_TRIANGLES";
break;
case TessEvaluationType::Quads:
os << "GL_QUADS";
break;
case TessEvaluationType::Isolines:
os << "GL_ISOLINES";
break;
case TessEvaluationType::EqualSpacing:
os << "GL_EQUAL";
break;
case TessEvaluationType::FractionalEvenSpacing:
os << "GL_FRACTIONAL_EVEN";
break;
case TessEvaluationType::FractionalOddSpacing:
os << "GL_FRACTIONAL_ODD";
break;
case TessEvaluationType::Cw:
os << "GL_CW";
break;
case TessEvaluationType::Ccw:
os << "GL_CCW";
break;
case TessEvaluationType::PointMode:
os << "GL_TESS_GEN_POINT_MODE";
break;
default:
os << "GL_INVALID_ENUM";
break;
}
return os;
}
const char *ShaderTypeToString(ShaderType shaderType)
{
constexpr ShaderMap<const char *> kShaderTypeNameMap = {
{ShaderType::Vertex, "Vertex"},
{ShaderType::TessControl, "Tessellation control"},
{ShaderType::TessEvaluation, "Tessellation evaluation"},
{ShaderType::Geometry, "Geometry"},
{ShaderType::Fragment, "Fragment"},
{ShaderType::Compute, "Compute"}};
return kShaderTypeNameMap[shaderType];
}
} // namespace gl
namespace egl
@ -520,5 +611,4 @@ gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget)
return gl::TextureType::InvalidEnum;
}
}
} // namespace egl_gl

Просмотреть файл

@ -58,11 +58,11 @@ class EnumIterator final
UnderlyingType mValue;
};
template <typename E>
template <typename E, size_t MaxSize = EnumSize<E>()>
struct AllEnums
{
EnumIterator<E> begin() const { return {static_cast<E>(0)}; }
EnumIterator<E> end() const { return {E::InvalidEnum}; }
EnumIterator<E> end() const { return {static_cast<E>(MaxSize)}; }
};
// PackedEnumMap<E, T> is like an std::array<T, E::EnumCount> but is indexed with enum values. It
@ -156,6 +156,16 @@ class PackedEnumMap
bool operator==(const PackedEnumMap &rhs) const { return mPrivateData == rhs.mPrivateData; }
bool operator!=(const PackedEnumMap &rhs) const { return mPrivateData != rhs.mPrivateData; }
template <typename SubT = T>
typename std::enable_if<std::is_integral<SubT>::value>::type operator+=(
const PackedEnumMap<E, SubT, MaxSize> &rhs)
{
for (E e : AllEnums<E, MaxSize>())
{
at(e) += rhs[e];
}
}
private:
Storage mPrivateData;
};
@ -187,15 +197,8 @@ struct AllCubeFaceTextureTargets
angle::EnumIterator<TextureTarget> end() const { return kAfterCubeMapTextureTargetMax; }
};
constexpr ShaderType kGLES2ShaderTypeMin = ShaderType::Vertex;
constexpr ShaderType kGLES2ShaderTypeMax = ShaderType::Fragment;
constexpr ShaderType kAfterGLES2ShaderTypeMax =
static_cast<ShaderType>(static_cast<uint8_t>(kGLES2ShaderTypeMax) + 1);
struct AllGLES2ShaderTypes
{
angle::EnumIterator<ShaderType> begin() const { return kGLES2ShaderTypeMin; }
angle::EnumIterator<ShaderType> end() const { return kAfterGLES2ShaderTypeMax; }
};
constexpr std::array<ShaderType, 2> kAllGLES2ShaderTypes = {ShaderType::Vertex,
ShaderType::Fragment};
constexpr ShaderType kShaderTypeMin = ShaderType::Vertex;
constexpr ShaderType kShaderTypeMax = ShaderType::Compute;
@ -210,7 +213,8 @@ struct AllShaderTypes
constexpr size_t kGraphicsShaderCount = static_cast<size_t>(ShaderType::EnumCount) - 1u;
// Arrange the shader types in the order of rendering pipeline
constexpr std::array<ShaderType, kGraphicsShaderCount> kAllGraphicsShaderTypes = {
ShaderType::Vertex, ShaderType::Geometry, ShaderType::Fragment};
ShaderType::Vertex, ShaderType::TessControl, ShaderType::TessEvaluation, ShaderType::Geometry,
ShaderType::Fragment};
using ShaderBitSet = angle::PackedEnumBitSet<ShaderType, uint8_t>;
static_assert(sizeof(ShaderBitSet) == sizeof(uint8_t), "Unexpected size");
@ -218,7 +222,10 @@ static_assert(sizeof(ShaderBitSet) == sizeof(uint8_t), "Unexpected size");
template <typename T>
using ShaderMap = angle::PackedEnumMap<ShaderType, T>;
const char *ShaderTypeToString(ShaderType shaderType);
TextureType SamplerTypeToTextureType(GLenum samplerType);
TextureType ImageTypeToTextureType(GLenum imageType);
bool IsMultisampled(gl::TextureType type);
bool IsArrayTextureType(gl::TextureType type);
@ -241,9 +248,10 @@ enum class PrimitiveMode : uint8_t
LineStripAdjacency = 0xB,
TrianglesAdjacency = 0xC,
TriangleStripAdjacency = 0xD,
Patches = 0xE,
InvalidEnum = 0xE,
EnumCount = 0xE,
InvalidEnum = 0xF,
EnumCount = 0xF,
};
template <>
@ -525,6 +533,84 @@ ANGLE_VALIDATE_PACKED_ENUM(VertexAttribType, UnsignedInt1010102, GL_UNSIGNED_INT
std::ostream &operator<<(std::ostream &os, VertexAttribType value);
enum class TessEvaluationType
{
Triangles = 0,
Quads = 1,
Isolines = 2,
EqualSpacing = 3,
FractionalEvenSpacing = 4,
FractionalOddSpacing = 5,
Cw = 6,
Ccw = 7,
PointMode = 8,
InvalidEnum = 9,
EnumCount = 9
};
template <>
constexpr TessEvaluationType FromGLenum<TessEvaluationType>(GLenum from)
{
if (from == GL_TRIANGLES)
return TessEvaluationType::Triangles;
if (from == GL_QUADS)
return TessEvaluationType::Quads;
if (from == GL_ISOLINES)
return TessEvaluationType::Isolines;
if (from == GL_EQUAL)
return TessEvaluationType::EqualSpacing;
if (from == GL_FRACTIONAL_EVEN)
return TessEvaluationType::FractionalEvenSpacing;
if (from == GL_FRACTIONAL_ODD)
return TessEvaluationType::FractionalOddSpacing;
if (from == GL_CW)
return TessEvaluationType::Cw;
if (from == GL_CCW)
return TessEvaluationType::Ccw;
if (from == GL_TESS_GEN_POINT_MODE)
return TessEvaluationType::PointMode;
return TessEvaluationType::InvalidEnum;
}
constexpr GLenum ToGLenum(TessEvaluationType from)
{
switch (from)
{
case TessEvaluationType::Triangles:
return GL_TRIANGLES;
case TessEvaluationType::Quads:
return GL_QUADS;
case TessEvaluationType::Isolines:
return GL_ISOLINES;
case TessEvaluationType::EqualSpacing:
return GL_EQUAL;
case TessEvaluationType::FractionalEvenSpacing:
return GL_FRACTIONAL_EVEN;
case TessEvaluationType::FractionalOddSpacing:
return GL_FRACTIONAL_ODD;
case TessEvaluationType::Cw:
return GL_CW;
case TessEvaluationType::Ccw:
return GL_CCW;
case TessEvaluationType::PointMode:
return GL_TESS_GEN_POINT_MODE;
default:
return GL_INVALID_ENUM;
}
}
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, Triangles, GL_TRIANGLES);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, Quads, GL_QUADS);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, Isolines, GL_ISOLINES);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, EqualSpacing, GL_EQUAL);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, FractionalEvenSpacing, GL_FRACTIONAL_EVEN);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, FractionalOddSpacing, GL_FRACTIONAL_ODD);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, Cw, GL_CW);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, Ccw, GL_CCW);
ANGLE_VALIDATE_PACKED_ENUM(TessEvaluationType, PointMode, GL_TESS_GEN_POINT_MODE);
std::ostream &operator<<(std::ostream &os, TessEvaluationType value);
// Typesafe object handles.
template <typename T>
@ -657,7 +743,7 @@ inline GLuint GetIDValue(ResourceIDType id)
// First case: handling packed enums.
template <typename EnumT, typename FromT>
typename std::enable_if<std::is_enum<EnumT>::value, EnumT>::type FromGL(FromT from)
typename std::enable_if<std::is_enum<EnumT>::value, EnumT>::type PackParam(FromT from)
{
return FromGLenum<EnumT>(from);
}
@ -665,7 +751,7 @@ typename std::enable_if<std::is_enum<EnumT>::value, EnumT>::type FromGL(FromT fr
// Second case: handling non-pointer resource ids.
template <typename EnumT, typename FromT>
typename std::enable_if<!std::is_pointer<FromT>::value && !std::is_enum<EnumT>::value, EnumT>::type
FromGL(FromT from)
PackParam(FromT from)
{
return {from};
}
@ -673,8 +759,16 @@ FromGL(FromT from)
// Third case: handling pointer resource ids.
template <typename EnumT, typename FromT>
typename std::enable_if<std::is_pointer<FromT>::value && !std::is_enum<EnumT>::value, EnumT>::type
FromGL(FromT from)
PackParam(FromT from)
{
static_assert(sizeof(typename std::remove_pointer<EnumT>::type) ==
sizeof(typename std::remove_pointer<FromT>::type),
"Types have different sizes");
static_assert(
std::is_same<
decltype(std::remove_pointer<EnumT>::type::value),
typename std::remove_const<typename std::remove_pointer<FromT>::type>::type>::value,
"Data types are different");
return reinterpret_cast<EnumT>(from);
}
@ -682,6 +776,11 @@ struct UniformLocation
{
int value;
};
struct UniformBlockIndex
{
uint32_t value;
};
} // namespace gl
namespace egl

Просмотреть файл

@ -1,7 +1,7 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Copyright 2017 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.
//
@ -1392,10 +1392,14 @@ ShaderType FromGLenum<ShaderType>(GLenum from)
{
case GL_VERTEX_SHADER:
return ShaderType::Vertex;
case GL_FRAGMENT_SHADER:
return ShaderType::Fragment;
case GL_TESS_CONTROL_SHADER_EXT:
return ShaderType::TessControl;
case GL_TESS_EVALUATION_SHADER_EXT:
return ShaderType::TessEvaluation;
case GL_GEOMETRY_SHADER_EXT:
return ShaderType::Geometry;
case GL_FRAGMENT_SHADER:
return ShaderType::Fragment;
case GL_COMPUTE_SHADER:
return ShaderType::Compute;
default:
@ -1409,10 +1413,14 @@ GLenum ToGLenum(ShaderType from)
{
case ShaderType::Vertex:
return GL_VERTEX_SHADER;
case ShaderType::Fragment:
return GL_FRAGMENT_SHADER;
case ShaderType::TessControl:
return GL_TESS_CONTROL_SHADER_EXT;
case ShaderType::TessEvaluation:
return GL_TESS_EVALUATION_SHADER_EXT;
case ShaderType::Geometry:
return GL_GEOMETRY_SHADER_EXT;
case ShaderType::Fragment:
return GL_FRAGMENT_SHADER;
case ShaderType::Compute:
return GL_COMPUTE_SHADER;
default:
@ -1428,12 +1436,18 @@ std::ostream &operator<<(std::ostream &os, ShaderType value)
case ShaderType::Vertex:
os << "GL_VERTEX_SHADER";
break;
case ShaderType::Fragment:
os << "GL_FRAGMENT_SHADER";
case ShaderType::TessControl:
os << "GL_TESS_CONTROL_SHADER_EXT";
break;
case ShaderType::TessEvaluation:
os << "GL_TESS_EVALUATION_SHADER_EXT";
break;
case ShaderType::Geometry:
os << "GL_GEOMETRY_SHADER_EXT";
break;
case ShaderType::Fragment:
os << "GL_FRAGMENT_SHADER";
break;
case ShaderType::Compute:
os << "GL_COMPUTE_SHADER";
break;

Просмотреть файл

@ -1,7 +1,7 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Copyright 2017 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.
//
@ -12,8 +12,6 @@
#ifndef COMMON_PACKEDGLENUMS_AUTOGEN_H_
#define COMMON_PACKEDGLENUMS_AUTOGEN_H_
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <angle_gl.h>
#include <cstdint>
@ -359,13 +357,15 @@ std::ostream &operator<<(std::ostream &os, QueryType value);
enum class ShaderType : uint8_t
{
Vertex = 0,
Fragment = 1,
Geometry = 2,
Compute = 3,
Vertex = 0,
TessControl = 1,
TessEvaluation = 2,
Geometry = 3,
Fragment = 4,
Compute = 5,
InvalidEnum = 4,
EnumCount = 4,
InvalidEnum = 6,
EnumCount = 6,
};
template <>

Просмотреть файл

@ -54,7 +54,7 @@ void *AlignedAlloc(size_t size, size_t alignment)
void AlignedFree(void *ptr)
{
#if defined(_MSC_VER)
#if defined(ANGLE_PLATFORM_WINDOWS)
_aligned_free(ptr);
#else
free(ptr);

Просмотреть файл

@ -219,6 +219,55 @@ T1 *offsetPointer(T2 *ptr, int bytes)
return reinterpret_cast<T1 *>(reinterpret_cast<intptr_t>(ptr) + bytes);
}
GLenum getPixelFormatInfo(int pixelFormat, bool *isYUV)
{
*isYUV = false;
switch (pixelFormat)
{
case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
return GL_RGBA8;
case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
return GL_RGB8;
case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
return GL_RGB8;
case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
return GL_RGB565;
case AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM:
return GL_BGRA8_EXT;
case AHARDWAREBUFFER_FORMAT_B5G5R5A1_UNORM:
return GL_RGB5_A1;
case AHARDWAREBUFFER_FORMAT_B4G4R4A4_UNORM:
return GL_RGBA4;
case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
return GL_RGBA16F;
case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
return GL_RGB10_A2;
case AHARDWAREBUFFER_FORMAT_BLOB:
return GL_NONE;
case AHARDWAREBUFFER_FORMAT_D16_UNORM:
return GL_DEPTH_COMPONENT16;
case AHARDWAREBUFFER_FORMAT_D24_UNORM:
return GL_DEPTH_COMPONENT24;
case AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT:
return GL_DEPTH24_STENCIL8;
case AHARDWAREBUFFER_FORMAT_D32_FLOAT:
return GL_DEPTH_COMPONENT32F;
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:
*isYUV = true;
return GL_RGB8;
default:
// Treat unknown formats as RGB. They are vendor-specific YUV formats that would sample
// as RGB.
WARN() << "Unknown pixelFormat: " << pixelFormat << ". Treating as RGB8";
*isYUV = true;
return GL_RGB8;
}
}
} // anonymous namespace
namespace angle
@ -296,48 +345,8 @@ void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer,
GLenum NativePixelFormatToGLInternalFormat(int pixelFormat)
{
switch (pixelFormat)
{
case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
return GL_RGBA8;
case AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM:
return GL_RGB8;
case AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM:
return GL_RGB8;
case AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM:
return GL_RGB565;
case AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM:
return GL_BGRA8_EXT;
case AHARDWAREBUFFER_FORMAT_B5G5R5A1_UNORM:
return GL_RGB5_A1;
case AHARDWAREBUFFER_FORMAT_B4G4R4A4_UNORM:
return GL_RGBA4;
case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
return GL_RGBA16F;
case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
return GL_RGB10_A2;
case AHARDWAREBUFFER_FORMAT_BLOB:
return GL_NONE;
case AHARDWAREBUFFER_FORMAT_D16_UNORM:
return GL_DEPTH_COMPONENT16;
case AHARDWAREBUFFER_FORMAT_D24_UNORM:
return GL_DEPTH_COMPONENT24;
case AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT:
return GL_DEPTH24_STENCIL8;
case AHARDWAREBUFFER_FORMAT_D32_FLOAT:
return GL_DEPTH_COMPONENT32F;
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:
return GL_RGB8;
default:
// Treat unknown formats as RGB. They are vendor-specific YUV formats that would sample
// as RGB.
WARN() << "Unknown pixelFormat: " << pixelFormat << ". Treating as RGB8";
return GL_RGB8;
}
bool isYuv = false;
return getPixelFormatInfo(pixelFormat, &isYuv);
}
int GLInternalFormatToNativePixelFormat(GLenum internalFormat)
@ -380,6 +389,13 @@ int GLInternalFormatToNativePixelFormat(GLenum internalFormat)
}
}
bool NativePixelFormatIsYUV(int pixelFormat)
{
bool isYuv = false;
getPixelFormatInfo(pixelFormat, &isYuv);
return isYuv;
}
AHardwareBuffer *ANativeWindowBufferToAHardwareBuffer(ANativeWindowBuffer *windowBuffer)
{
return offsetPointer<AHardwareBuffer>(windowBuffer,
@ -392,5 +408,10 @@ EGLClientBuffer AHardwareBufferToClientBuffer(const AHardwareBuffer *hardwareBuf
kAHardwareBufferToANativeWindowBufferOffset);
}
AHardwareBuffer *ClientBufferToAHardwareBuffer(EGLClientBuffer clientBuffer)
{
return offsetPointer<AHardwareBuffer>(clientBuffer,
-kAHardwareBufferToANativeWindowBufferOffset);
}
} // namespace android
} // namespace angle

Просмотреть файл

@ -30,6 +30,7 @@ constexpr std::array<GLenum, 3> kSupportedSizedInternalFormats = {GL_RGBA8, GL_R
ANativeWindowBuffer *ClientBufferToANativeWindowBuffer(EGLClientBuffer clientBuffer);
EGLClientBuffer AHardwareBufferToClientBuffer(const AHardwareBuffer *hardwareBuffer);
AHardwareBuffer *ClientBufferToAHardwareBuffer(EGLClientBuffer clientBuffer);
EGLClientBuffer CreateEGLClientBufferFromAHardwareBuffer(int width,
int height,
@ -45,6 +46,8 @@ void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer,
GLenum NativePixelFormatToGLInternalFormat(int pixelFormat);
int GLInternalFormatToNativePixelFormat(GLenum internalFormat);
bool NativePixelFormatIsYUV(int pixelFormat);
AHardwareBuffer *ANativeWindowBufferToAHardwareBuffer(ANativeWindowBuffer *windowBuffer);
uint64_t GetAHBUsage(int eglNativeBufferUsage);

Просмотреть файл

@ -15,6 +15,10 @@
# include "absl/container/flat_hash_map.h"
#endif // defined(ANGLE_USE_ABSEIL)
#if defined(ANGLE_WITH_LSAN)
# include <sanitizer/lsan_interface.h>
#endif // defined(ANGLE_WITH_LSAN)
#include <climits>
#include <cstdarg>
#include <cstddef>
@ -286,6 +290,10 @@ inline bool IsLittleEndian()
#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)
@ -296,6 +304,12 @@ inline bool IsLittleEndian()
UNREACHABLE(); \
ANGLE_CHECK(context, false, "Unreachable Code.", GL_INVALID_OPERATION)
#if defined(ANGLE_WITH_LSAN)
# define ANGLE_SCOPED_DISABLE_LSAN() __lsan::ScopedDisabler lsanDisabler
#else
# define ANGLE_SCOPED_DISABLE_LSAN()
#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))

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -129,7 +129,7 @@ std::mutex &GetDebugMutex()
return *g_debugMutex;
}
ScopedPerfEventHelper::ScopedPerfEventHelper(gl::Context *context, gl::EntryPoint entryPoint)
ScopedPerfEventHelper::ScopedPerfEventHelper(gl::Context *context, angle::EntryPoint entryPoint)
: mContext(context), mEntryPoint(entryPoint), mFunctionName(nullptr)
{}
@ -163,8 +163,8 @@ void ScopedPerfEventHelper::begin(const char *format, ...)
LogMessage::LogMessage(const char *file, const char *function, int line, LogSeverity severity)
: mFile(file), mFunction(function), mLine(line), mSeverity(severity)
{
// EVENT() does not require additional function(line) info.
if (mSeverity != LOG_EVENT)
// INFO() and EVENT() do not require additional function(line) info.
if (mSeverity > LOG_INFO)
{
const char *slash = std::max(strrchr(mFile, '/'), strrchr(mFile, '\\'));
mStream << (slash ? (slash + 1) : mFile) << ":" << mLine << " (" << mFunction << "): ";
@ -179,7 +179,7 @@ LogMessage::~LogMessage()
lock = std::unique_lock<std::mutex>(*g_debugMutex);
}
if (DebugAnnotationsInitialized() && (mSeverity >= LOG_INFO))
if (DebugAnnotationsInitialized() && (mSeverity > LOG_INFO))
{
g_debugAnnotator->logMessage(*this);
}
@ -279,7 +279,7 @@ void Trace(LogSeverity severity, const char *message)
}
#else
// Note: we use fprintf because <iostream> includes static initializers.
fprintf((severity >= LOG_ERR) ? stderr : stdout, "%s: %s\n", LogSeverityName(severity),
fprintf((severity >= LOG_WARN) ? stderr : stdout, "%s: %s\n", LogSeverityName(severity),
str.c_str());
#endif
}

Просмотреть файл

@ -20,6 +20,7 @@
#include <string>
#include "common/angleutils.h"
#include "common/entry_points_enum_autogen.h"
#include "common/platform.h"
#if !defined(TRACE_OUTPUT_FILE)
@ -29,20 +30,19 @@
namespace gl
{
class Context;
enum class EntryPoint;
// Pairs a D3D begin event with an end event.
class ScopedPerfEventHelper : angle::NonCopyable
{
public:
ScopedPerfEventHelper(gl::Context *context, gl::EntryPoint entryPoint);
ScopedPerfEventHelper(Context *context, angle::EntryPoint entryPoint);
~ScopedPerfEventHelper();
ANGLE_FORMAT_PRINTF(2, 3)
void begin(const char *format, ...);
private:
gl::Context *mContext;
const gl::EntryPoint mEntryPoint;
const angle::EntryPoint mEntryPoint;
const char *mFunctionName;
};
@ -93,14 +93,14 @@ class DebugAnnotator : angle::NonCopyable
DebugAnnotator() {}
virtual ~DebugAnnotator() {}
virtual void beginEvent(gl::Context *context,
gl::EntryPoint entryPoint,
angle::EntryPoint entryPoint,
const char *eventName,
const char *eventMessage) = 0;
const char *eventMessage) = 0;
virtual void endEvent(gl::Context *context,
const char *eventName,
gl::EntryPoint entryPoint) = 0;
virtual void setMarker(const char *markerName) = 0;
virtual bool getStatus() = 0;
angle::EntryPoint entryPoint) = 0;
virtual void setMarker(const char *markerName) = 0;
virtual bool getStatus() = 0;
// Log Message Handler that gets passed every log message,
// when debug annotations are initialized,
// replacing default handling by LogMessage.
@ -256,26 +256,31 @@ std::ostream &FmtHex(std::ostream &os, T value)
// A macro to log a performance event around a scope.
#if defined(ANGLE_TRACE_ENABLED)
# if defined(_MSC_VER)
# define EVENT(context, entryPoint, function, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper##__LINE__(context, entryPoint); \
do \
{ \
if (gl::ShouldBeginScopedEvent()) \
{ \
scopedPerfEventHelper##__LINE__.begin("%s(" message ")", function, \
__VA_ARGS__); \
} \
} while (0)
# else
# define EVENT(context, entryPoint, function, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper(context, entryPoint); \
# define EVENT(context, entryPoint, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper##__LINE__( \
context, angle::EntryPoint::entryPoint); \
do \
{ \
if (gl::ShouldBeginScopedEvent()) \
{ \
scopedPerfEventHelper.begin("%s(" message ")", function, ##__VA_ARGS__); \
scopedPerfEventHelper##__LINE__.begin( \
"%s(" message ")", GetEntryPointName(angle::EntryPoint::entryPoint), \
__VA_ARGS__); \
} \
} while (0)
# else
# define EVENT(context, entryPoint, message, ...) \
gl::ScopedPerfEventHelper scopedPerfEventHelper(context, \
angle::EntryPoint::entryPoint); \
do \
{ \
if (gl::ShouldBeginScopedEvent()) \
{ \
scopedPerfEventHelper.begin("%s(" message ")", \
GetEntryPointName(angle::EntryPoint::entryPoint), \
##__VA_ARGS__); \
} \
} while (0)
# endif // _MSC_VER
#else
# define EVENT(message, ...) (void(0))
@ -445,4 +450,13 @@ std::ostream &FmtHex(std::ostream &os, T value)
# 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
# define ANGLE_REENABLE_UNUSED_FUNCTION_WARNING
#endif
#endif // COMMON_DEBUG_H_

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -31,6 +31,9 @@ constexpr int g_sharedexp_bias = 15;
// N is the number of mantissa bits per component (9)
constexpr int g_sharedexp_mantissabits = 9;
// number of mantissa bits per component pre-biased
constexpr int g_sharedexp_biased_mantissabits = g_sharedexp_bias + g_sharedexp_mantissabits;
// Emax is the maximum allowed biased exponent value (31)
constexpr int g_sharedexp_maxexponent = 31;
@ -51,17 +54,15 @@ unsigned int convertRGBFloatsTo999E5(float red, float green, float blue)
const float exp_p =
std::max<float>(-g_sharedexp_bias - 1, floor(log(max_c))) + 1 + g_sharedexp_bias;
const int max_s = static_cast<int>(
floor((max_c / (pow(2.0f, exp_p - g_sharedexp_bias - g_sharedexp_mantissabits))) + 0.5f));
floor((max_c / (pow(2.0f, exp_p - g_sharedexp_biased_mantissabits))) + 0.5f));
const int exp_s =
static_cast<int>((max_s < pow(2.0f, g_sharedexp_mantissabits)) ? exp_p : exp_p + 1);
const float pow2_exp = pow(2.0f, static_cast<float>(exp_s) - g_sharedexp_biased_mantissabits);
RGB9E5Data output;
output.R = static_cast<unsigned int>(
floor((red_c / (pow(2.0f, exp_s - g_sharedexp_bias - g_sharedexp_mantissabits))) + 0.5f));
output.G = static_cast<unsigned int>(
floor((green_c / (pow(2.0f, exp_s - g_sharedexp_bias - g_sharedexp_mantissabits))) + 0.5f));
output.B = static_cast<unsigned int>(
floor((blue_c / (pow(2.0f, exp_s - g_sharedexp_bias - g_sharedexp_mantissabits))) + 0.5f));
output.R = static_cast<unsigned int>(floor((red_c / pow2_exp) + 0.5f));
output.G = static_cast<unsigned int>(floor((green_c / pow2_exp) + 0.5f));
output.B = static_cast<unsigned int>(floor((blue_c / pow2_exp) + 0.5f));
output.E = exp_s;
return bitCast<unsigned int>(output);
@ -71,12 +72,12 @@ void convert999E5toRGBFloats(unsigned int input, float *red, float *green, float
{
const RGB9E5Data *inputData = reinterpret_cast<const RGB9E5Data *>(&input);
*red =
inputData->R * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits);
*green =
inputData->G * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits);
*blue =
inputData->B * pow(2.0f, (int)inputData->E - g_sharedexp_bias - g_sharedexp_mantissabits);
const float pow2_exp =
pow(2.0f, static_cast<float>(inputData->E) - g_sharedexp_biased_mantissabits);
*red = inputData->R * pow2_exp;
*green = inputData->G * pow2_exp;
*blue = inputData->B * pow2_exp;
}
} // namespace gl

Просмотреть файл

@ -1128,6 +1128,39 @@ inline unsigned long ScanForward(uint64_t bits)
ASSERT(ret != 0u);
return firstBitIndex;
}
// Return the index of the most significant bit set. Indexing is such that bit 0 is the least
// significant bit.
inline unsigned long ScanReverse(uint32_t bits)
{
ASSERT(bits != 0u);
unsigned long lastBitIndex = 0ul;
unsigned char ret = _BitScanReverse(&lastBitIndex, bits);
ASSERT(ret != 0u);
return lastBitIndex;
}
inline unsigned long ScanReverse(uint64_t bits)
{
ASSERT(bits != 0u);
unsigned long lastBitIndex = 0ul;
# if defined(ANGLE_IS_64_BIT_CPU)
unsigned char ret = _BitScanReverse64(&lastBitIndex, bits);
# else
unsigned char ret;
if (static_cast<uint32_t>(bits >> 32) == 0)
{
ret = _BitScanReverse(&lastBitIndex, static_cast<uint32_t>(bits));
}
else
{
ret = _BitScanReverse(&lastBitIndex, static_cast<uint32_t>(bits >> 32));
lastBitIndex += 32ul;
}
# endif // defined(ANGLE_IS_64_BIT_CPU)
ASSERT(ret != 0u);
return lastBitIndex;
}
#endif // defined(ANGLE_PLATFORM_WINDOWS)
#if defined(ANGLE_PLATFORM_POSIX)
@ -1148,6 +1181,30 @@ inline unsigned long ScanForward(uint64_t bits)
: __builtin_ctz(static_cast<uint32_t>(bits)));
# endif // defined(ANGLE_IS_64_BIT_CPU)
}
inline unsigned long ScanReverse(uint32_t bits)
{
ASSERT(bits != 0u);
return static_cast<unsigned long>(sizeof(uint32_t) * CHAR_BIT - 1 - __builtin_clz(bits));
}
inline unsigned long ScanReverse(uint64_t bits)
{
ASSERT(bits != 0u);
# if defined(ANGLE_IS_64_BIT_CPU)
return static_cast<unsigned long>(sizeof(uint64_t) * CHAR_BIT - 1 - __builtin_clzll(bits));
# else
if (static_cast<uint32_t>(bits >> 32) == 0)
{
return sizeof(uint32_t) * CHAR_BIT - 1 - __builtin_clz(static_cast<uint32_t>(bits));
}
else
{
return sizeof(uint32_t) * CHAR_BIT - 1 - __builtin_clz(static_cast<uint32_t>(bits >> 32)) +
32;
}
# endif // defined(ANGLE_IS_64_BIT_CPU)
}
#endif // defined(ANGLE_PLATFORM_POSIX)
inline unsigned long ScanForward(uint8_t bits)
@ -1160,21 +1217,14 @@ inline unsigned long ScanForward(uint16_t bits)
return ScanForward(static_cast<uint32_t>(bits));
}
// Return the index of the most significant bit set. Indexing is such that bit 0 is the least
// significant bit.
inline unsigned long ScanReverse(unsigned long bits)
inline unsigned long ScanReverse(uint8_t bits)
{
ASSERT(bits != 0u);
#if defined(ANGLE_PLATFORM_WINDOWS)
unsigned long lastBitIndex = 0ul;
unsigned char ret = _BitScanReverse(&lastBitIndex, bits);
ASSERT(ret != 0u);
return lastBitIndex;
#elif defined(ANGLE_PLATFORM_POSIX)
return static_cast<unsigned long>(sizeof(unsigned long) * CHAR_BIT - 1 - __builtin_clzl(bits));
#else
# error Please implement bit-scan-reverse for your platform!
#endif
return ScanReverse(static_cast<uint32_t>(bits));
}
inline unsigned long ScanReverse(uint16_t bits)
{
return ScanReverse(static_cast<uint32_t>(bits));
}
// Returns -1 on 0, otherwise the index of the least significant 1 bit as in GLSL.

Просмотреть файл

@ -82,8 +82,16 @@
# endif
# endif
// Macros 'near', 'far', 'NEAR' and 'FAR' are defined by 'shared/minwindef.h' in the Windows SDK.
// Macros 'near' and 'far' are empty. They are not used by other Windows headers and are undefined
// here to avoid identifier conflicts. Macros 'NEAR' and 'FAR' contain 'near' and 'far'. They are
// used by other Windows headers and are cleared here to avoid compilation errors.
# undef near
# undef far
# undef NEAR
# undef FAR
# define NEAR
# define FAR
#endif
#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64)
@ -146,4 +154,11 @@
# endif
#endif
#include <cstdint>
#if INTPTR_MAX == INT64_MAX
# define ANGLE_IS_64_BIT_CPU 1
#else
# define ANGLE_IS_32_BIT_CPU 1
#endif
#endif // COMMON_PLATFORM_H_

Просмотреть файл

@ -0,0 +1,120 @@
//
// 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.
//
// spirv_types.h:
// Strong types for SPIR-V Ids to prevent mistakes when using the builder and parser APIs.
//
#ifndef COMMON_SPIRV_TYPES_H_
#define COMMON_SPIRV_TYPES_H_
#include "common/FastVector.h"
#include <vector>
namespace angle
{
namespace spirv
{
template <typename Helper>
class BoxedUint32
{
public:
BoxedUint32() : mValue{0} {}
explicit BoxedUint32(uint32_t value) : mValue{value} {}
template <typename T>
T as() const
{
return T{mValue};
}
BoxedUint32(const BoxedUint32 &other) = default;
BoxedUint32 &operator=(const BoxedUint32 &other) = default;
operator uint32_t() const { return mValue.value; }
bool operator==(const BoxedUint32 &other) const { return mValue.value == other.mValue.value; }
// Applicable to ids, which cannot be 0.
bool valid() const { return static_cast<bool>(mValue.value); }
private:
Helper mValue;
};
struct IdRefHelper
{
uint32_t value;
};
struct LiteralIntegerHelper
{
uint32_t value;
};
using IdRef = BoxedUint32<IdRefHelper>;
template <>
inline BoxedUint32<IdRefHelper>::operator uint32_t() const
{
ASSERT(valid());
return mValue.value;
}
// IdResult, IdResultType, IdMemorySemantics and IdScope are all translated as IdRef. This makes
// the type verification weaker, but stops the API from becoming tediously verbose.
using IdResult = IdRef;
using IdResultType = IdRef;
using IdMemorySemantics = IdRef;
using IdScope = IdRef;
using LiteralInteger = BoxedUint32<LiteralIntegerHelper>;
using LiteralString = const char *;
// Note: In ANGLE's use cases, all literals fit in 32 bits.
using LiteralContextDependentNumber = LiteralInteger;
// TODO(syoussefi): To be made stronger when generating SPIR-V from the translator.
// http://anglebug.com/4889
using LiteralExtInstInteger = LiteralInteger;
struct PairLiteralIntegerIdRef
{
LiteralInteger literal;
IdRef id;
};
struct PairIdRefLiteralInteger
{
IdRef id;
LiteralInteger literal;
};
struct PairIdRefIdRef
{
IdRef id1;
IdRef id2;
};
// Some instructions need 4 components. The drivers uniform struct in ANGLE has 8 fields. A value
// of 8 means almost no instruction would end up making dynamic allocations. Notable exceptions are
// user-defined structs/blocks and OpEntryPoint.
constexpr size_t kFastVectorSize = 8;
template <typename T>
using FastVectorHelper = angle::FastVector<T, kFastVectorSize>;
using IdRefList = FastVectorHelper<IdRef>;
using LiteralIntegerList = FastVectorHelper<LiteralInteger>;
using PairLiteralIntegerIdRefList = FastVectorHelper<PairLiteralIntegerIdRef>;
using PairIdRefLiteralIntegerList = FastVectorHelper<PairIdRefLiteralInteger>;
using PairIdRefIdRefList = FastVectorHelper<PairIdRefIdRef>;
// Id 0 is invalid in SPIR-V.
constexpr uint32_t kMinValidId = 1;
// The SPIR-V blob is a sequence of uint32_t's
using Blob = std::vector<uint32_t>;
// 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
} // namespace angle
#endif // COMMON_SPIRV_TYPES_H_

Просмотреть файл

@ -251,4 +251,45 @@ std::vector<std::string> GetCachedStringsFromEnvironmentVarOrAndroidProperty(
std::string environment = GetEnvironmentVarOrAndroidProperty(varName, propertyName);
return SplitString(environment, separator, TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY);
}
// reference name can have *.
bool NamesMatchWithWildcard(const char *ref, const char *testName)
{
// Find the first * in ref.
const char *firstWildcard = strchr(ref, '*');
// If there are no wildcards, match the strings precisely.
if (firstWildcard == nullptr)
{
return strcmp(ref, testName) == 0;
}
// Otherwise, match up to the wildcard first.
size_t preWildcardLen = firstWildcard - ref;
if (strncmp(ref, testName, preWildcardLen) != 0)
{
return false;
}
const char *postWildcardRef = ref + preWildcardLen + 1;
// As a small optimization, if the wildcard is the last character in ref, accept the match
// already.
if (postWildcardRef[0] == '\0')
{
return true;
}
// Try to match the wildcard with a number of characters.
for (size_t matchSize = 0; testName[matchSize] != '\0'; ++matchSize)
{
if (NamesMatchWithWildcard(postWildcardRef, testName + matchSize))
{
return true;
}
}
return false;
}
} // namespace angle

Просмотреть файл

@ -105,6 +105,8 @@ std::vector<std::string> GetCachedStringsFromEnvironmentVarOrAndroidProperty(
const char *propertyName,
const char *separator);
// reference name can have *.
bool NamesMatchWithWildcard(const char *ref, const char *testName);
} // namespace angle
#endif // LIBANGLE_STRING_UTILS_H_

Просмотреть файл

@ -10,6 +10,10 @@
#include <stdlib.h>
#if defined(ANGLE_PLATFORM_ANDROID)
# include <sys/system_properties.h>
#endif
namespace angle
{
std::string GetExecutableName()
@ -48,33 +52,24 @@ std::string GetEnvironmentVarOrAndroidProperty(const char *variableName, const c
std::string GetEnvironmentVarOrUnCachedAndroidProperty(const char *variableName,
const char *propertyName)
{
#if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 21
std::string sanitizedPropertyName = propertyName;
sanitizedPropertyName.erase(
std::remove(sanitizedPropertyName.begin(), sanitizedPropertyName.end(), '\''),
sanitizedPropertyName.end());
#if defined(ANGLE_PLATFORM_ANDROID) && __ANDROID_API__ >= 26
std::string propertyValue;
std::string command("getprop '");
command += sanitizedPropertyName;
command += "'";
// Run the command and open a I/O stream to read the value
constexpr int kStreamSize = 64;
char stream[kStreamSize] = {};
FILE *pipe = popen(command.c_str(), "r");
if (pipe != nullptr)
const prop_info *propertyInfo = __system_property_find(propertyName);
if (propertyInfo != nullptr)
{
fgets(stream, kStreamSize, pipe);
pclose(pipe);
__system_property_read_callback(
propertyInfo,
[](void *cookie, const char *, const char *value, unsigned) {
auto propertyValue = reinterpret_cast<std::string *>(cookie);
*propertyValue = value;
},
&propertyValue);
}
// Right strip white space
std::string value(stream);
value.erase(value.find_last_not_of(" \n\r\t") + 1);
// Set the environment variable with the value.
SetEnvironmentVar(variableName, value.c_str());
return value;
SetEnvironmentVar(variableName, propertyValue.c_str());
return propertyValue;
#endif // ANGLE_PLATFORM_ANDROID
// Return the environment variable's value.
return GetEnvironmentVar(variableName);

Просмотреть файл

@ -21,44 +21,8 @@
namespace angle
{
std::string GetExecutablePath()
{
std::string result;
uint32_t size = 0;
_NSGetExecutablePath(nullptr, &size);
std::vector<char> buffer;
buffer.resize(size + 1);
_NSGetExecutablePath(buffer.data(), &size);
buffer[size] = '\0';
if (!strrchr(buffer.data(), '/'))
{
return "";
}
return buffer.data();
}
std::string GetExecutableDirectory()
{
std::string executablePath = GetExecutablePath();
size_t lastPathSepLoc = executablePath.find_last_of("/");
return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : "";
}
const char *GetSharedLibraryExtension()
{
return "dylib";
}
double GetCurrentTime()
{
mach_timebase_info_data_t timebaseInfo;
mach_timebase_info(&timebaseInfo);
double secondCoeff = timebaseInfo.numer * 1e-9 / timebaseInfo.denom;
return secondCoeff * mach_absolute_time();
}
} // namespace angle

Просмотреть файл

@ -103,10 +103,19 @@ Library *OpenSharedLibrary(const char *libraryName, SearchType searchType)
std::string directory;
if (searchType == SearchType::ApplicationDir)
{
#if ANGLE_PLATFORM_IOS
// On iOS, shared libraries must be loaded from within the app bundle.
directory = GetExecutableDirectory() + "/Frameworks/";
#else
directory = GetHelperExecutableDir();
#endif
}
std::string fullPath = directory + libraryName + "." + GetSharedLibraryExtension();
#if ANGLE_PLATFORM_IOS
// On iOS, dlopen needs a suffix on the framework name to work.
fullPath = fullPath + "/" + libraryName;
#endif
return new PosixLibrary(fullPath);
}

Просмотреть файл

@ -65,6 +65,7 @@ class Win32Library : public Library
{
if (!mModule)
{
fprintf(stderr, "Module was not loaded\n");
return nullptr;
}

Просмотреть файл

@ -1,7 +1,7 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_uniform_type_table.py.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Copyright 2017 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.
//
@ -18,202 +18,191 @@ namespace gl
namespace
{
constexpr std::array<UniformTypeInfo, 76> kInfoTable = {
constexpr std::array<UniformTypeInfo, 77> kInfoTable = {
{{GL_NONE, GL_NONE, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 0, 0, 0, 0, 0 * 0,
0 * 0, false, false, false, ""},
0 * 0, false, false, false},
{GL_BOOL, GL_BOOL, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false, ""},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false},
{GL_BOOL_VEC2, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false, ""},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false},
{GL_BOOL_VEC3, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false, ""},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false},
{GL_BOOL_VEC4, GL_BOOL, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false, ""},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false},
{GL_FLOAT, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 1, false, false, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 1, false, false, false},
{GL_FLOAT_MAT2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2, GL_NONE, SamplerFormat::InvalidEnum, 2, 2, 4,
sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 4, false, true, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 4, false, true, false},
{GL_FLOAT_MAT2x3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3x2, GL_NONE, SamplerFormat::InvalidEnum, 3,
2, 6, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 6, false, true, false, ""},
2, 6, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 6, false, true, false},
{GL_FLOAT_MAT2x4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4x2, GL_NONE, SamplerFormat::InvalidEnum, 4,
2, 8, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 8, false, true, false, ""},
2, 8, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 8, false, true, false},
{GL_FLOAT_MAT3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3, GL_NONE, SamplerFormat::InvalidEnum, 3, 3, 9,
sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 9, false, true, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 9, false, true, false},
{GL_FLOAT_MAT3x2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2x3, GL_NONE, SamplerFormat::InvalidEnum, 2,
3, 6, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 6, false, true, false, ""},
3, 6, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 6, false, true, false},
{GL_FLOAT_MAT3x4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4x3, GL_NONE, SamplerFormat::InvalidEnum, 4,
3, 12, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 12, false, true, false, ""},
3, 12, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 12, false, true, false},
{GL_FLOAT_MAT4, GL_FLOAT, GL_NONE, GL_FLOAT_MAT4, GL_NONE, SamplerFormat::InvalidEnum, 4, 4,
16, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 16, false, true, false, ""},
16, sizeof(GLfloat), sizeof(GLfloat) * 16, sizeof(GLfloat) * 16, false, true, false},
{GL_FLOAT_MAT4x2, GL_FLOAT, GL_NONE, GL_FLOAT_MAT2x4, GL_NONE, SamplerFormat::InvalidEnum, 2,
4, 8, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 8, false, true, false, ""},
4, 8, sizeof(GLfloat), sizeof(GLfloat) * 8, sizeof(GLfloat) * 8, false, true, false},
{GL_FLOAT_MAT4x3, GL_FLOAT, GL_NONE, GL_FLOAT_MAT3x4, GL_NONE, SamplerFormat::InvalidEnum, 3,
4, 12, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 12, false, true, false, ""},
4, 12, sizeof(GLfloat), sizeof(GLfloat) * 12, sizeof(GLfloat) * 12, false, true, false},
{GL_FLOAT_VEC2, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 2, false, false, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 2, false, false, false},
{GL_FLOAT_VEC3, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 3, false, false, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 3, false, false, false},
{GL_FLOAT_VEC4, GL_FLOAT, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 4, false, false, false, ""},
sizeof(GLfloat), sizeof(GLfloat) * 4, sizeof(GLfloat) * 4, false, false, false},
{GL_IMAGE_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_IMAGE_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true,
"intBitsToFloat"},
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_IMAGE_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_IMAGE_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_IMAGE_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
false, false, true, "intBitsToFloat"},
false, false, true},
{GL_IMAGE_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_INT, GL_INT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint),
sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false, "intBitsToFloat"},
sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, false},
{GL_INT_IMAGE_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_INT_IMAGE_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
false, false, true, "intBitsToFloat"},
false, false, true},
{GL_INT_IMAGE_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_INT_IMAGE_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true,
"intBitsToFloat"},
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_INT_IMAGE_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
false, false, true, "intBitsToFloat"},
false, false, true},
{GL_INT_IMAGE_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::InvalidEnum,
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true,
"intBitsToFloat"},
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, false, false, true},
{GL_INT_SAMPLER_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Signed, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_INT_SAMPLER_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Signed,
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_INT_SAMPLER_2D_MULTISAMPLE, GL_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE, GL_NONE,
SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_INT, GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE,
GL_NONE, SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1,
true, false, false, "intBitsToFloat"},
true, false, false},
{GL_INT_SAMPLER_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::Signed, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_INT_SAMPLER_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Signed, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_INT_SAMPLER_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::Signed, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_INT_SAMPLER_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::Signed, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_INT_VEC2, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC2, SamplerFormat::InvalidEnum, 1, 2, 2,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 2, false, false, false},
{GL_INT_VEC3, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC3, SamplerFormat::InvalidEnum, 1, 3, 3,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 3, false, false, false},
{GL_INT_VEC4, GL_INT, GL_NONE, GL_NONE, GL_BOOL_VEC4, SamplerFormat::InvalidEnum, 1, 4, 4,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 4, false, false, false},
{GL_SAMPLER_2D, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_2D_ARRAY, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Float, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_2D_ARRAY_SHADOW, GL_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::Shadow, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_SAMPLER_2D_MULTISAMPLE, GL_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE, GL_NONE,
SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_INT, GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_SAMPLER_2D_RECT_ANGLE, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1,
1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_2D_SHADOW, GL_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE, SamplerFormat::Shadow, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_3D, GL_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_CUBE, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_CUBE_MAP_ARRAY, GL_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_SAMPLER_BUFFER, GL_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1, 1,
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false, "intBitsToFloat"},
sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_CUBE_SHADOW, GL_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE, SamplerFormat::Shadow,
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW, GL_INT, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::Shadow, 1,
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false,
"intBitsToFloat"},
1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false},
{GL_SAMPLER_EXTERNAL_OES, GL_INT, GL_TEXTURE_EXTERNAL_OES, GL_NONE, GL_NONE,
SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"},
false, false},
{GL_UNSIGNED_INT, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL, SamplerFormat::InvalidEnum, 1, 1,
1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, false, false, false,
"uintBitsToFloat"},
1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, false, false, false},
{GL_UNSIGNED_INT_ATOMIC_COUNTER, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, false, "uintBitsToFloat"},
false, false, false},
{GL_UNSIGNED_INT_IMAGE_2D, GL_UNSIGNED_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, true, "uintBitsToFloat"},
false, false, true},
{GL_UNSIGNED_INT_IMAGE_2D_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, true, "uintBitsToFloat"},
false, false, true},
{GL_UNSIGNED_INT_IMAGE_3D, GL_UNSIGNED_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, true, "uintBitsToFloat"},
false, false, true},
{GL_UNSIGNED_INT_IMAGE_CUBE, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, true, "uintBitsToFloat"},
false, false, true},
{GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE,
GL_NONE, SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
sizeof(GLuint) * 1, false, false, true, "uintBitsToFloat"},
sizeof(GLuint) * 1, false, false, true},
{GL_UNSIGNED_INT_IMAGE_BUFFER, GL_UNSIGNED_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE,
SamplerFormat::InvalidEnum, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
false, false, true, "uintBitsToFloat"},
false, false, true},
{GL_UNSIGNED_INT_SAMPLER_2D, GL_UNSIGNED_INT, GL_TEXTURE_2D, GL_NONE, GL_NONE,
SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
true, false, false, "uintBitsToFloat"},
true, false, false},
{GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_2D_ARRAY, GL_NONE, GL_NONE,
SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
true, false, false, "uintBitsToFloat"},
true, false, false},
{GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, GL_UNSIGNED_INT, GL_TEXTURE_2D_MULTISAMPLE, GL_NONE,
GL_NONE, SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
sizeof(GLuint) * 1, true, false, false, "uintBitsToFloat"},
sizeof(GLuint) * 1, true, false, false},
{GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, GL_UNSIGNED_INT,
GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_NONE, GL_NONE, SamplerFormat::Unsigned, 1, 1, 1,
sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, true, false, false,
"uintBitsToFloat"},
sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1, true, false, false},
{GL_UNSIGNED_INT_SAMPLER_3D, GL_UNSIGNED_INT, GL_TEXTURE_3D, GL_NONE, GL_NONE,
SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
true, false, false, "uintBitsToFloat"},
true, false, false},
{GL_UNSIGNED_INT_SAMPLER_CUBE, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP, GL_NONE, GL_NONE,
SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
true, false, false, "uintBitsToFloat"},
true, false, false},
{GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY, GL_UNSIGNED_INT, GL_TEXTURE_CUBE_MAP_ARRAY, GL_NONE,
GL_NONE, SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4,
sizeof(GLuint) * 1, true, false, false, "uintBitsToFloat"},
sizeof(GLuint) * 1, true, false, false},
{GL_UNSIGNED_INT_SAMPLER_BUFFER, GL_UNSIGNED_INT, GL_TEXTURE_BUFFER, GL_NONE, GL_NONE,
SamplerFormat::Unsigned, 1, 1, 1, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 1,
true, false, false, "uintBitsToFloat"},
true, false, false},
{GL_UNSIGNED_INT_VEC2, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC2,
SamplerFormat::InvalidEnum, 1, 2, 2, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 2,
false, false, false, "uintBitsToFloat"},
false, false, false},
{GL_UNSIGNED_INT_VEC3, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC3,
SamplerFormat::InvalidEnum, 1, 3, 3, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 3,
false, false, false, "uintBitsToFloat"},
false, false, false},
{GL_UNSIGNED_INT_VEC4, GL_UNSIGNED_INT, GL_NONE, GL_NONE, GL_BOOL_VEC4,
SamplerFormat::InvalidEnum, 1, 4, 4, sizeof(GLuint), sizeof(GLuint) * 4, sizeof(GLuint) * 4,
false, false, false, "uintBitsToFloat"},
false, false, false},
{GL_SAMPLER_VIDEO_IMAGE_WEBGL, GL_INT, GL_TEXTURE_VIDEO_IMAGE_WEBGL, GL_NONE, GL_NONE,
SamplerFormat::Float, 1, 1, 1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true,
false, false, "intBitsToFloat"}}};
false, false},
{GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT, GL_INT, GL_NONE, GL_NONE, GL_NONE, SamplerFormat::Float, 1, 1,
1, sizeof(GLint), sizeof(GLint) * 4, sizeof(GLint) * 1, true, false, false}}};
size_t GetTypeInfoIndex(GLenum uniformType)
{
@ -371,6 +360,8 @@ size_t GetTypeInfoIndex(GLenum uniformType)
return 74;
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
return 75;
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return 76;
default:
UNREACHABLE();
return 0;

Просмотреть файл

@ -10,6 +10,7 @@
#include "GLES3/gl3.h"
#include "common/mathutil.h"
#include "common/platform.h"
#include "common/string_utils.h"
#include <set>
@ -170,6 +171,7 @@ GLenum VariableComponentType(GLenum type)
case GL_UNSIGNED_INT_IMAGE_BUFFER:
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return GL_INT;
case GL_UNSIGNED_INT:
case GL_UNSIGNED_INT_VEC2:
@ -360,6 +362,7 @@ int VariableRowCount(GLenum type)
case GL_INT_IMAGE_BUFFER:
case GL_UNSIGNED_INT_IMAGE_BUFFER:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return 1;
case GL_FLOAT_MAT2:
case GL_FLOAT_MAT3x2:
@ -440,6 +443,7 @@ int VariableColumnCount(GLenum type)
case GL_UNSIGNED_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return 1;
case GL_BOOL_VEC2:
case GL_FLOAT_VEC2:
@ -507,6 +511,7 @@ bool IsSamplerType(GLenum type)
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return true;
}
@ -527,6 +532,18 @@ bool IsSamplerCubeType(GLenum type)
return false;
}
bool IsSamplerYUVType(GLenum type)
{
switch (type)
{
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return true;
default:
return false;
}
}
bool IsImageType(GLenum type)
{
switch (type)
@ -860,6 +877,7 @@ int VariableSortOrder(GLenum type)
case GL_UNSIGNED_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_ATOMIC_COUNTER:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
return 6;
default:
@ -903,6 +921,11 @@ std::string ParseResourceName(const std::string &name, std::vector<unsigned int>
return name.substr(0, baseNameLength);
}
bool IsBuiltInName(const char *name)
{
return angle::BeginsWith(name, "gl_");
}
std::string StripLastArrayIndex(const std::string &name)
{
size_t strippedNameLength = name.find_last_of('[');
@ -1106,6 +1129,69 @@ const char *GetDebugMessageSeverityString(GLenum severity)
return "Unknown Severity";
}
}
ShaderType GetShaderTypeFromBitfield(size_t singleShaderType)
{
switch (singleShaderType)
{
case GL_VERTEX_SHADER_BIT:
return ShaderType::Vertex;
case GL_FRAGMENT_SHADER_BIT:
return ShaderType::Fragment;
case GL_COMPUTE_SHADER_BIT:
return ShaderType::Compute;
case GL_GEOMETRY_SHADER_BIT:
return ShaderType::Geometry;
case GL_TESS_CONTROL_SHADER_BIT:
return ShaderType::TessControl;
case GL_TESS_EVALUATION_SHADER_BIT:
return ShaderType::TessEvaluation;
default:
return ShaderType::InvalidEnum;
}
}
GLbitfield GetBitfieldFromShaderType(ShaderType shaderType)
{
switch (shaderType)
{
case ShaderType::Vertex:
return GL_VERTEX_SHADER_BIT;
case ShaderType::Fragment:
return GL_FRAGMENT_SHADER_BIT;
case ShaderType::Compute:
return GL_COMPUTE_SHADER_BIT;
case ShaderType::Geometry:
return GL_GEOMETRY_SHADER_BIT;
case ShaderType::TessControl:
return GL_TESS_CONTROL_SHADER_BIT;
case ShaderType::TessEvaluation:
return GL_TESS_EVALUATION_SHADER_BIT;
default:
UNREACHABLE();
return GL_ZERO;
}
}
bool ShaderTypeSupportsTransformFeedback(ShaderType shaderType)
{
switch (shaderType)
{
case ShaderType::Vertex:
case ShaderType::Geometry:
case ShaderType::TessEvaluation:
return true;
default:
return false;
}
}
ShaderType GetLastPreFragmentStage(ShaderBitSet shaderTypes)
{
shaderTypes.reset(ShaderType::Fragment);
shaderTypes.reset(ShaderType::Compute);
return shaderTypes.any() ? shaderTypes.last() : ShaderType::InvalidEnum;
}
} // namespace gl
namespace egl
@ -1169,6 +1255,7 @@ bool IsExternalImageTarget(EGLenum target)
case EGL_NATIVE_BUFFER_ANDROID:
case EGL_D3D11_TEXTURE_ANGLE:
case EGL_LINUX_DMA_BUF_EXT:
case EGL_METAL_TEXTURE_ANGLE:
return true;
default:

Просмотреть файл

@ -39,6 +39,7 @@ int VariableRowCount(GLenum type);
int VariableColumnCount(GLenum type);
bool IsSamplerType(GLenum type);
bool IsSamplerCubeType(GLenum type);
bool IsSamplerYUVType(GLenum type);
bool IsImageType(GLenum type);
bool IsImage2DType(GLenum type);
bool IsAtomicCounterType(GLenum type);
@ -61,6 +62,12 @@ int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsig
// outSubscripts.
std::string ParseResourceName(const std::string &name, std::vector<unsigned int> *outSubscripts);
bool IsBuiltInName(const char *name);
ANGLE_INLINE bool IsBuiltInName(const std::string &name)
{
return IsBuiltInName(name.c_str());
}
// Strips only the last array index from a resource name.
std::string StripLastArrayIndex(const std::string &name);
@ -141,8 +148,7 @@ struct UniformTypeInfo final : angle::NonCopyable
size_t externalSize,
bool isSampler,
bool isMatrixType,
bool isImageType,
const char *glslAsFloat);
bool isImageType);
GLenum type;
GLenum componentType;
@ -159,7 +165,6 @@ struct UniformTypeInfo final : angle::NonCopyable
bool isSampler;
bool isMatrixType;
bool isImageType;
const char *glslAsFloat;
};
inline constexpr UniformTypeInfo::UniformTypeInfo(GLenum type,
@ -176,8 +181,7 @@ inline constexpr UniformTypeInfo::UniformTypeInfo(GLenum type,
size_t externalSize,
bool isSampler,
bool isMatrixType,
bool isImageType,
const char *glslAsFloat)
bool isImageType)
: type(type),
componentType(componentType),
textureType(textureType),
@ -192,8 +196,7 @@ inline constexpr UniformTypeInfo::UniformTypeInfo(GLenum type,
externalSize(externalSize),
isSampler(isSampler),
isMatrixType(isMatrixType),
isImageType(isImageType),
glslAsFloat(glslAsFloat)
isImageType(isImageType)
{}
const UniformTypeInfo &GetUniformTypeInfo(GLenum uniformType);
@ -238,6 +241,23 @@ enum class SrgbOverride
Linear
};
// For use with EXT_sRGB_write_control
// A render target may be forced to convert to a linear colorspace, or may be allowed to do whatever
// colorspace conversion is appropriate for its format. There is no option to force linear->sRGB, it
// can only convert from sRGB->linear
enum class SrgbWriteControlMode
{
Default = 0,
Linear = 1
};
ShaderType GetShaderTypeFromBitfield(size_t singleShaderType);
GLbitfield GetBitfieldFromShaderType(ShaderType shaderType);
bool ShaderTypeSupportsTransformFeedback(ShaderType shaderType);
// Given a set of shader stages, returns the last vertex processing stage. This is the stage that
// interfaces the fragment shader.
ShaderType GetLastPreFragmentStage(ShaderBitSet shaderTypes);
} // namespace gl
namespace egl

Просмотреть файл

@ -170,7 +170,7 @@ void DirectiveParser::lex(Token *token)
parseDirective(token);
mPastFirstStatement = true;
}
else if (!isEOD(token))
else if (!isEOD(token) && !skipping())
{
mSeenNonPreprocessorToken = true;
}

Просмотреть файл

@ -134,9 +134,6 @@ enum TBasicType
EbtImage2DMSArray,
EbtIImage2DMSArray,
EbtUImage2DMSArray,
EbtImage2DRect,
EbtIImage2DRect,
EbtUImage2DRect,
EbtImageCubeArray,
EbtIImageCubeArray,
EbtUImageCubeArray,
@ -148,14 +145,17 @@ enum TBasicType
EbtUImageBuffer,
EbtGuardImageEnd = EbtUImageBuffer,
EbtSubpassInput,
// Subpass Input
EbtGuardSubpassInputBegin,
EbtSubpassInput = EbtGuardSubpassInputBegin,
EbtISubpassInput,
EbtUSubpassInput,
EbtSubpassInputMS,
EbtISubpassInputMS,
EbtUSubpassInputMS,
EbtGuardSubpassInputEnd = EbtUSubpassInputMS,
EbtLastSimpleType = EbtUSubpassInputMS,
EbtLastSimpleType = EbtGuardSubpassInputEnd,
EbtStruct,
EbtInterfaceBlock,
@ -221,9 +221,14 @@ inline bool IsAtomicCounter(TBasicType type)
return type == EbtAtomicCounter;
}
inline bool IsSubpassInputType(TBasicType type)
{
return type >= EbtGuardSubpassInputBegin && type <= EbtGuardSubpassInputEnd;
}
inline bool IsOpaqueType(TBasicType type)
{
return IsSampler(type) || IsImage(type) || IsAtomicCounter(type);
return IsSampler(type) || IsImage(type) || IsAtomicCounter(type) || IsSubpassInputType(type);
}
inline bool IsIntegerSampler(TBasicType type)
@ -355,7 +360,6 @@ inline bool IsFloatImage(TBasicType type)
case EbtImageCube:
case EbtImage2DMS:
case EbtImage2DMSArray:
case EbtImage2DRect:
case EbtImageCubeArray:
case EbtImageRect:
case EbtImageBuffer:
@ -380,7 +384,6 @@ inline bool IsIntegerImage(TBasicType type)
case EbtIImageCube:
case EbtIImage2DMS:
case EbtIImage2DMSArray:
case EbtIImage2DRect:
case EbtIImageCubeArray:
case EbtIImageRect:
case EbtIImageBuffer:
@ -405,7 +408,6 @@ inline bool IsUnsignedImage(TBasicType type)
case EbtUImageCube:
case EbtUImage2DMS:
case EbtUImage2DMSArray:
case EbtUImage2DRect:
case EbtUImageCubeArray:
case EbtUImageRect:
case EbtUImageBuffer:
@ -706,9 +708,6 @@ inline bool IsImage2D(TBasicType type)
case EbtImage2D:
case EbtIImage2D:
case EbtUImage2D:
case EbtImage2DRect:
case EbtIImage2DRect:
case EbtUImage2DRect:
case EbtImage2DMS:
case EbtIImage2DMS:
case EbtUImage2DMS:
@ -777,9 +776,6 @@ inline bool IsImage3D(TBasicType type)
case EbtImage2DMSArray:
case EbtIImage2DMSArray:
case EbtUImage2DMSArray:
case EbtImage2DRect:
case EbtIImage2DRect:
case EbtUImage2DRect:
case EbtImageCubeArray:
case EbtIImageCubeArray:
case EbtUImageCubeArray:
@ -826,9 +822,6 @@ inline bool IsImage2DArray(TBasicType type)
case EbtImage2DMS:
case EbtIImage2DMS:
case EbtUImage2DMS:
case EbtImage2DRect:
case EbtIImage2DRect:
case EbtUImage2DRect:
case EbtImageCubeArray:
case EbtIImageCubeArray:
case EbtUImageCubeArray:
@ -875,9 +868,6 @@ inline bool IsImageCube(TBasicType type)
case EbtImage2DMSArray:
case EbtIImage2DMSArray:
case EbtUImage2DMSArray:
case EbtImage2DRect:
case EbtIImage2DRect:
case EbtUImage2DRect:
case EbtImageCubeArray:
case EbtIImageCubeArray:
case EbtUImageCubeArray:
@ -921,12 +911,15 @@ enum TQualifier
EvqVaryingOut, // vertex shaders only read/write
EvqUniform, // Readonly, vertex and fragment
EvqBuffer, // read/write, vertex, fragment and compute shader
EvqPatch, // EXT_tessellation_shader storage qualifier
EvqVertexIn, // Vertex shader input
EvqFragmentOut, // Fragment shader output
EvqVertexOut, // Vertex shader output
EvqFragmentIn, // Fragment shader input
EvqFragmentInOut, // EXT_shader_framebuffer_fetch qualifier
// parameters
EvqIn,
EvqOut,
@ -943,9 +936,6 @@ enum TQualifier
EvqDrawID, // ANGLE_multi_draw
EvqBaseVertex, // ANGLE_base_vertex_base_instance
EvqBaseInstance, // ANGLE_base_vertex_base_instance
// built-ins read by fragment shader
EvqFragCoord,
EvqFrontFacing,
@ -966,6 +956,7 @@ enum TQualifier
EvqViewportIndex, // gl_ViewportIndex
EvqClipDistance, // APPLE_clip_distance/EXT_clip_cull_distance
EvqCullDistance, // EXT_clip_cull_distance
// built-ins written by the shader_framebuffer_fetch extension(s)
EvqLastFragColor,
@ -988,6 +979,13 @@ enum TQualifier
EvqCentroidIn, // Implies smooth
EvqSampleIn,
// GLSL ES 3.0 extension OES_sample_variables
EvqSampleID,
EvqSamplePosition,
EvqSampleMaskIn,
EvqSampleMask,
EvqNumSamples,
// GLSL ES 3.1 compute shader special variables
EvqShared,
EvqComputeIn,
@ -1017,6 +1015,21 @@ enum TQualifier
// GLSL ES 3.1 extension EXT_gpu_shader5 qualifiers
EvqPrecise,
// GLES ES 3.1 extension EXT_tessellation_shader qualifiers
EvqPatchIn,
EvqPatchOut,
EvqTessControlIn,
EvqTessControlOut,
EvqPerVertexOut,
EvqPatchVerticesIn,
EvqTessLevelOuter,
EvqTessLevelInner,
EvqTessEvaluationIn,
EvqTessEvaluationOut,
EvqTessCoord,
// end of list
EvqLast
};
@ -1036,6 +1049,8 @@ inline bool IsShaderIn(TQualifier qualifier)
switch (qualifier)
{
case EvqVertexIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
case EvqGeometryIn:
case EvqFragmentIn:
case EvqAttribute:
@ -1045,6 +1060,7 @@ inline bool IsShaderIn(TQualifier qualifier)
case EvqNoPerspectiveIn:
case EvqCentroidIn:
case EvqSampleIn:
case EvqPatchIn:
return true;
default:
return false;
@ -1056,6 +1072,8 @@ inline bool IsShaderOut(TQualifier qualifier)
switch (qualifier)
{
case EvqVertexOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
case EvqGeometryOut:
case EvqFragmentOut:
case EvqVaryingOut:
@ -1064,6 +1082,28 @@ inline bool IsShaderOut(TQualifier qualifier)
case EvqNoPerspectiveOut:
case EvqCentroidOut:
case EvqSampleOut:
case EvqPatchOut:
case EvqFragmentInOut:
return true;
default:
return false;
}
}
inline bool IsShaderIoBlock(TQualifier qualifier)
{
switch (qualifier)
{
case EvqPerVertexIn:
case EvqPerVertexOut:
case EvqVertexOut:
case EvqTessControlIn:
case EvqTessControlOut:
case EvqTessEvaluationIn:
case EvqTessEvaluationOut:
case EvqGeometryIn:
case EvqGeometryOut:
case EvqFragmentIn:
return true;
default:
return false;
@ -1124,6 +1164,20 @@ enum TLayoutPrimitiveType
EptTriangleStrip
};
enum TLayoutTessEvaluationType
{
EtetUndefined,
EtetTriangles,
EtetQuads,
EtetIsolines,
EtetEqualSpacing,
EtetFractionalEvenSpacing,
EtetFractionalOddSpacing,
EtetCw,
EtetCcw,
EtetPointMode
};
struct TLayoutQualifier
{
// Must have a trivial default constructor since it is used in YYSTYPE.
@ -1137,7 +1191,10 @@ struct TLayoutQualifier
earlyFragmentTests == false && matrixPacking == EmpUnspecified &&
blockStorage == EbsUnspecified && !localSize.isAnyValueSet() &&
imageInternalFormat == EiifUnspecified && primitiveType == EptUndefined &&
invocations == 0 && maxVertices == -1 && index == -1;
invocations == 0 && maxVertices == -1 && vertices == 0 &&
tesPrimitiveType == EtetUndefined && tesVertexSpacingType == EtetUndefined &&
tesOrderingType == EtetUndefined && tesPointType == EtetUndefined && index == -1 &&
inputAttachmentIndex == -1 && noncoherent == false;
}
bool isCombinationValid() const
@ -1146,6 +1203,7 @@ struct TLayoutQualifier
bool numViewsSet = (numViews != -1);
bool geometryShaderSpecified =
(primitiveType != EptUndefined) || (invocations != 0) || (maxVertices != -1);
bool subpassInputSpecified = (inputAttachmentIndex != -1);
bool otherLayoutQualifiersSpecified =
(location != -1 || binding != -1 || index != -1 || matrixPacking != EmpUnspecified ||
blockStorage != EbsUnspecified || imageInternalFormat != EiifUnspecified);
@ -1155,7 +1213,8 @@ struct TLayoutQualifier
// qualifiers.
return (workGroupSizeSpecified ? 1 : 0) + (numViewsSet ? 1 : 0) + (yuv ? 1 : 0) +
(earlyFragmentTests ? 1 : 0) + (otherLayoutQualifiersSpecified ? 1 : 0) +
(geometryShaderSpecified ? 1 : 0) <=
(geometryShaderSpecified ? 1 : 0) + (subpassInputSpecified ? 1 : 0) +
(noncoherent ? 1 : 0) <=
1;
}
@ -1192,9 +1251,20 @@ struct TLayoutQualifier
int invocations;
int maxVertices;
// EXT_tessellation_shader shader layout qualifiers
int vertices;
TLayoutTessEvaluationType tesPrimitiveType;
TLayoutTessEvaluationType tesVertexSpacingType;
TLayoutTessEvaluationType tesOrderingType;
TLayoutTessEvaluationType tesPointType;
// EXT_blend_func_extended fragment output layout qualifier
int index;
// EXT_shader_framebuffer_fetch layout qualifiers.
int inputAttachmentIndex;
bool noncoherent;
private:
explicit constexpr TLayoutQualifier(int /*placeholder*/)
: location(-1),
@ -1211,7 +1281,14 @@ struct TLayoutQualifier
primitiveType(EptUndefined),
invocations(0),
maxVertices(-1),
index(-1)
vertices(0),
tesPrimitiveType(EtetUndefined),
tesVertexSpacingType(EtetUndefined),
tesOrderingType(EtetUndefined),
tesPointType(EtetUndefined),
index(-1),
inputAttachmentIndex(-1),
noncoherent(false)
{}
};
@ -1280,6 +1357,7 @@ inline const char *getQualifierString(TQualifier q)
case EvqVaryingOut: return "varying";
case EvqUniform: return "uniform";
case EvqBuffer: return "buffer";
case EvqPatch: return "patch";
case EvqVertexIn: return "in";
case EvqFragmentOut: return "out";
case EvqVertexOut: return "out";
@ -1293,8 +1371,6 @@ inline const char *getQualifierString(TQualifier q)
case EvqPosition: return "Position";
case EvqPointSize: return "PointSize";
case EvqDrawID: return "DrawID";
case EvqBaseVertex: return "BaseVertex";
case EvqBaseInstance: return "BaseInstance";
case EvqFragCoord: return "FragCoord";
case EvqFrontFacing: return "FrontFacing";
case EvqHelperInvocation: return "HelperInvocation";
@ -1310,6 +1386,7 @@ inline const char *getQualifierString(TQualifier q)
case EvqLayer: return "Layer";
case EvqLastFragColor: return "LastFragColor";
case EvqLastFragData: return "LastFragData";
case EvqFragmentInOut: return "inout";
case EvqSmoothOut: return "smooth out";
case EvqCentroidOut: return "smooth centroid out";
case EvqFlatOut: return "flat out";
@ -1335,11 +1412,30 @@ inline const char *getQualifierString(TQualifier q)
case EvqGeometryIn: return "in";
case EvqGeometryOut: return "out";
case EvqPerVertexIn: return "gl_in";
case EvqPrimitiveIDIn: return "gl_PrimitiveIDIn";
case EvqInvocationID: return "gl_InvocationID";
case EvqPrimitiveID: return "gl_PrimitiveID";
case EvqPrecise: return "precise";
case EvqClipDistance: return "ClipDistance";
case EvqSample: return "sample";
case EvqSampleIn: return "sample in";
case EvqSampleOut: return "sample out";
case EvqSampleID: return "SampleID";
case EvqSamplePosition: return "SamplePosition";
case EvqSampleMaskIn: return "SampleMaskIn";
case EvqSampleMask: return "SampleMask";
case EvqNumSamples: return "NumSamples";
case EvqPatchIn: return "patch in";
case EvqPatchOut: return "patch out";
case EvqTessControlIn: return "in";
case EvqTessControlOut: return "out";
case EvqPerVertexOut: return "gl_out";
case EvqPatchVerticesIn: return "PatchVerticesIn";
case EvqTessLevelOuter: return "TessLevelOuter";
case EvqTessLevelInner: return "TessLevelInner";
case EvqTessEvaluationIn: return "in";
case EvqTessEvaluationOut: return "out";
case EvqTessCoord: return "TessCoord";
default: UNREACHABLE(); return "unknown qualifier";
}
// clang-format on
@ -1468,6 +1564,34 @@ inline const char *getGeometryShaderPrimitiveTypeString(TLayoutPrimitiveType pri
}
}
inline const char *getTessEvaluationShaderTypeString(TLayoutTessEvaluationType type)
{
switch (type)
{
case EtetTriangles:
return "triangles";
case EtetQuads:
return "quads";
case EtetIsolines:
return "isolines";
case EtetEqualSpacing:
return "equal_spacing";
case EtetFractionalEvenSpacing:
return "fractional_even_spacing";
case EtetFractionalOddSpacing:
return "fractional_odd_spacing";
case EtetCw:
return "cw";
case EtetCcw:
return "ccw";
case EtetPointMode:
return "point_mode";
default:
UNREACHABLE();
return "unknown tessellation evaluation shader variable type";
}
}
} // namespace sh
#endif // COMPILER_TRANSLATOR_BASETYPES_H_

Просмотреть файл

@ -34,7 +34,6 @@ class TBuiltinsWorkaroundGLSL : public TIntermTraverser
ShCompileOptions mCompileOptions;
bool isBaseInstanceDeclared = false;
bool isBaseVertexDeclared = false;
};
TBuiltinsWorkaroundGLSL::TBuiltinsWorkaroundGLSL(TSymbolTable *symbolTable,
@ -81,7 +80,7 @@ bool TBuiltinsWorkaroundGLSL::visitDeclaration(Visit, TIntermDeclaration *node)
for (TIntermNode *variableNode : sequence)
{
TIntermSymbol *variable = variableNode->getAsSymbolNode();
if (variable && variable->variable().symbolType() == SymbolType::AngleInternal)
if (variable && variable->variable().symbolType() == SymbolType::BuiltIn)
{
if (variable->getName() == "angle_BaseInstance")
{

Просмотреть файл

@ -38,7 +38,6 @@ BlockLayoutType GetBlockLayoutType(TLayoutBlockStorage blockStorage)
}
}
// TODO(jiawei.shao@intel.com): implement GL_EXT_shader_io_blocks.
BlockType GetBlockType(TQualifier qualifier)
{
switch (qualifier)
@ -47,8 +46,6 @@ BlockType GetBlockType(TQualifier qualifier)
return BlockType::BLOCK_UNIFORM;
case EvqBuffer:
return BlockType::BLOCK_BUFFER;
case EvqPerVertexIn:
return BlockType::BLOCK_IN;
default:
UNREACHABLE();
return BlockType::BLOCK_UNIFORM;
@ -99,6 +96,18 @@ ShaderVariable *FindVariableInInterfaceBlock(const ImmutableString &name,
return FindVariable(name, &namedBlock->fields);
}
ShaderVariable *FindShaderIOBlockVariable(const ImmutableString &blockName,
std::vector<ShaderVariable> *infoList)
{
for (size_t index = 0; index < infoList->size(); ++index)
{
if (blockName == (*infoList)[index].structOrBlockName)
return &(*infoList)[index];
}
return nullptr;
}
// Traverses the intermediate tree to collect all attributes, uniforms, varyings, fragment outputs,
// shared data and interface blocks.
class CollectVariablesTraverser : public TIntermTraverser
@ -112,11 +121,12 @@ class CollectVariablesTraverser : public TIntermTraverser
std::vector<ShaderVariable> *sharedVariables,
std::vector<InterfaceBlock> *uniformBlocks,
std::vector<InterfaceBlock> *shaderStorageBlocks,
std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior);
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices);
bool visitGlobalQualifierDeclaration(Visit visit,
TIntermGlobalQualifierDeclaration *node) override;
@ -129,10 +139,14 @@ class CollectVariablesTraverser : public TIntermTraverser
void setFieldOrVariableProperties(const TType &type,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
ShaderVariable *variableOut) const;
void setFieldProperties(const TType &type,
const ImmutableString &name,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
ShaderVariable *variableOut) const;
void setCommonVariableProperties(const TType &type,
const TVariable &variable,
@ -153,7 +167,6 @@ class CollectVariablesTraverser : public TIntermTraverser
std::vector<ShaderVariable> *varyings);
void recordBuiltInFragmentOutputUsed(const TVariable &variable, bool *addedFlag);
void recordBuiltInAttributeUsed(const TVariable &variable, bool *addedFlag);
InterfaceBlock *recordGLInUsed(const TType &glInType);
InterfaceBlock *findNamedInterfaceBlock(const ImmutableString &name) const;
std::vector<ShaderVariable> *mAttribs;
@ -164,12 +177,12 @@ class CollectVariablesTraverser : public TIntermTraverser
std::vector<ShaderVariable> *mSharedVariables;
std::vector<InterfaceBlock> *mUniformBlocks;
std::vector<InterfaceBlock> *mShaderStorageBlocks;
std::vector<InterfaceBlock> *mInBlocks;
std::map<std::string, ShaderVariable *> mInterfaceBlockFields;
// Shader uniforms
bool mDepthRangeAdded;
bool mNumSamplesAdded;
// Compute Shader builtins
bool mNumWorkGroupsAdded;
@ -183,12 +196,11 @@ class CollectVariablesTraverser : public TIntermTraverser
bool mVertexIDAdded;
bool mPointSizeAdded;
bool mDrawIDAdded;
bool mBaseVertexAdded;
bool mBaseInstanceAdded;
// Vertex Shader and Geometry Shader builtins
bool mPositionAdded;
bool mClipDistanceAdded;
bool mCullDistanceAdded;
// Fragment Shader builtins
bool mPointCoordAdded;
@ -202,9 +214,16 @@ class CollectVariablesTraverser : public TIntermTraverser
bool mFragDepthAdded;
bool mSecondaryFragColorEXTAdded;
bool mSecondaryFragDataEXTAdded;
bool mSampleIDAdded;
bool mSamplePositionAdded;
bool mSampleMaskAdded;
bool mSampleMaskInAdded;
// Geometry and Tessellation Shader builtins
bool mPerVertexInAdded;
bool mPerVertexOutAdded;
// Geometry Shader builtins
bool mPerVertexInAdded;
bool mPrimitiveIDInAdded;
bool mInvocationIDAdded;
@ -215,10 +234,18 @@ class CollectVariablesTraverser : public TIntermTraverser
// Shared memory variables
bool mSharedVariableAdded;
// Tessellation Shader builtins
bool mPatchVerticesInAdded;
bool mTessLevelOuterAdded;
bool mTessLevelInnerAdded;
bool mTessCoordAdded;
const int mTessControlShaderOutputVertices;
ShHashFunction64 mHashFunction;
GLenum mShaderType;
const TExtensionBehavior &mExtensionBehavior;
const ShBuiltInResources &mResources;
};
CollectVariablesTraverser::CollectVariablesTraverser(
@ -230,11 +257,12 @@ CollectVariablesTraverser::CollectVariablesTraverser(
std::vector<sh::ShaderVariable> *sharedVariables,
std::vector<sh::InterfaceBlock> *uniformBlocks,
std::vector<sh::InterfaceBlock> *shaderStorageBlocks,
std::vector<sh::InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior)
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices)
: TIntermTraverser(true, false, false, symbolTable),
mAttribs(attribs),
mOutputVariables(outputVariables),
@ -244,8 +272,8 @@ CollectVariablesTraverser::CollectVariablesTraverser(
mSharedVariables(sharedVariables),
mUniformBlocks(uniformBlocks),
mShaderStorageBlocks(shaderStorageBlocks),
mInBlocks(inBlocks),
mDepthRangeAdded(false),
mNumSamplesAdded(false),
mNumWorkGroupsAdded(false),
mWorkGroupIDAdded(false),
mLocalInvocationIDAdded(false),
@ -255,10 +283,9 @@ CollectVariablesTraverser::CollectVariablesTraverser(
mVertexIDAdded(false),
mPointSizeAdded(false),
mDrawIDAdded(false),
mBaseVertexAdded(false),
mBaseInstanceAdded(false),
mPositionAdded(false),
mClipDistanceAdded(false),
mCullDistanceAdded(false),
mPointCoordAdded(false),
mFrontFacingAdded(false),
mHelperInvocationAdded(false),
@ -270,15 +297,26 @@ CollectVariablesTraverser::CollectVariablesTraverser(
mFragDepthAdded(false),
mSecondaryFragColorEXTAdded(false),
mSecondaryFragDataEXTAdded(false),
mSampleIDAdded(false),
mSamplePositionAdded(false),
mSampleMaskAdded(false),
mSampleMaskInAdded(false),
mPerVertexInAdded(false),
mPerVertexOutAdded(false),
mPrimitiveIDInAdded(false),
mInvocationIDAdded(false),
mPrimitiveIDAdded(false),
mLayerAdded(false),
mSharedVariableAdded(false),
mPatchVerticesInAdded(false),
mTessLevelOuterAdded(false),
mTessLevelInnerAdded(false),
mTessCoordAdded(false),
mTessControlShaderOutputVertices(tessControlShaderOutputVertices),
mHashFunction(hashFunction),
mShaderType(shaderType),
mExtensionBehavior(extensionBehavior)
mExtensionBehavior(extensionBehavior),
mResources(resources)
{}
std::string CollectVariablesTraverser::getMappedName(const TSymbol *symbol) const
@ -294,7 +332,12 @@ void CollectVariablesTraverser::setBuiltInInfoFromSymbol(const TVariable &variab
info->name = variable.name().data();
info->mappedName = variable.name().data();
setFieldOrVariableProperties(type, true, info);
bool isShaderIOBlock =
IsShaderIoBlock(type.getQualifier()) && type.getInterfaceBlock() != nullptr;
bool isPatch =
type.getQualifier() == EvqTessLevelInner || type.getQualifier() == EvqTessLevelOuter;
setFieldOrVariableProperties(type, true, isShaderIOBlock, isPatch, info);
}
void CollectVariablesTraverser::recordBuiltInVaryingUsed(const TVariable &variable,
@ -341,24 +384,6 @@ void CollectVariablesTraverser::recordBuiltInAttributeUsed(const TVariable &vari
}
}
InterfaceBlock *CollectVariablesTraverser::recordGLInUsed(const TType &glInType)
{
if (!mPerVertexInAdded)
{
ASSERT(glInType.getQualifier() == EvqPerVertexIn);
InterfaceBlock info;
recordInterfaceBlock("gl_in", glInType, &info);
mPerVertexInAdded = true;
mInBlocks->push_back(info);
return &mInBlocks->back();
}
else
{
return FindVariable(ImmutableString("gl_PerVertex"), mInBlocks);
}
}
bool CollectVariablesTraverser::visitGlobalQualifierDeclaration(
Visit visit,
TIntermGlobalQualifierDeclaration *node)
@ -388,15 +413,30 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
// Check the qualifier from the variable, not from the symbol node. The node may have a
// different qualifier if it's the result of a folded ternary node.
TQualifier qualifier = symbol->variable().getType().getQualifier();
TQualifier qualifier = symbol->variable().getType().getQualifier();
const TInterfaceBlock *interfaceBlock = symbol->getType().getInterfaceBlock();
if (IsVaryingIn(qualifier))
{
var = FindVariable(symbolName, mInputVaryings);
if (interfaceBlock)
{
var = FindShaderIOBlockVariable(interfaceBlock->name(), mInputVaryings);
}
else
{
var = FindVariable(symbolName, mInputVaryings);
}
}
else if (IsVaryingOut(qualifier))
{
var = FindVariable(symbolName, mOutputVaryings);
if (interfaceBlock)
{
var = FindShaderIOBlockVariable(interfaceBlock->name(), mOutputVaryings);
}
else
{
var = FindVariable(symbolName, mOutputVaryings);
}
}
else if (symbol->getType().getBasicType() == EbtInterfaceBlock)
{
@ -449,6 +489,48 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
mDepthRangeAdded = true;
}
}
else if (symbolName == "gl_NumSamples")
{
ASSERT(qualifier == EvqUniform);
if (!mNumSamplesAdded)
{
ShaderVariable info;
const char kName[] = "gl_NumSamples";
info.name = kName;
info.mappedName = kName;
info.type = GL_INT;
info.precision = GL_LOW_INT;
info.staticUse = true;
info.active = true;
mUniforms->push_back(info);
mNumSamplesAdded = true;
}
}
else if (symbolName == "gl_LastFragData" && qualifier == EvqGlobal)
{
// If gl_LastFragData is redeclared, the qualifier of redeclaration is EvqGlobal, and it
// makes "gl_LastFragData" can't be collected in this function. That's because
// "gl_LastFragData" is redeclared like below. E.g., "highp vec4
// gl_LastFragData[gl_MaxDrawBuffers];" So, if gl_LastFragData can be parsed with a correct
// qualifier in PasreContext.cpp, this code isn't needed.
if (!mLastFragDataAdded)
{
ShaderVariable info;
const TType &type = symbol->getType();
info.name = symbolName.data();
info.mappedName = symbolName.data();
setFieldOrVariableProperties(type, true, false, false, &info);
info.active = true;
mInputVaryings->push_back(info);
mLastFragDataAdded = true;
}
return;
}
else
{
switch (qualifier)
@ -458,11 +540,11 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
var = FindVariable(symbolName, mAttribs);
break;
case EvqFragmentOut:
case EvqFragmentInOut:
var = FindVariable(symbolName, mOutputVariables);
break;
case EvqUniform:
{
const TInterfaceBlock *interfaceBlock = symbol->getType().getInterfaceBlock();
if (interfaceBlock)
{
var = FindVariableInInterfaceBlock(symbolName, interfaceBlock, mUniformBlocks);
@ -478,7 +560,6 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
break;
case EvqBuffer:
{
const TInterfaceBlock *interfaceBlock = symbol->getType().getInterfaceBlock();
var =
FindVariableInInterfaceBlock(symbolName, interfaceBlock, mShaderStorageBlocks);
}
@ -530,12 +611,6 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
case EvqDrawID:
recordBuiltInAttributeUsed(symbol->variable(), &mDrawIDAdded);
return;
case EvqBaseVertex:
recordBuiltInAttributeUsed(symbol->variable(), &mBaseVertexAdded);
return;
case EvqBaseInstance:
recordBuiltInAttributeUsed(symbol->variable(), &mBaseInstanceAdded);
return;
case EvqLastFragData:
recordBuiltInVaryingUsed(symbol->variable(), &mLastFragDataAdded, mInputVaryings);
return;
@ -583,7 +658,9 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
}
else
{
ASSERT(mShaderType == GL_FRAGMENT_SHADER);
ASSERT(mShaderType == GL_FRAGMENT_SHADER ||
mShaderType == GL_TESS_CONTROL_SHADER ||
mShaderType == GL_TESS_EVALUATION_SHADER);
recordBuiltInVaryingUsed(symbol->variable(), &mPrimitiveIDAdded,
mInputVaryings);
}
@ -614,6 +691,54 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
case EvqClipDistance:
recordBuiltInVaryingUsed(symbol->variable(), &mClipDistanceAdded, mOutputVaryings);
return;
case EvqSampleID:
recordBuiltInVaryingUsed(symbol->variable(), &mSampleIDAdded, mInputVaryings);
return;
case EvqSamplePosition:
recordBuiltInVaryingUsed(symbol->variable(), &mSamplePositionAdded, mInputVaryings);
return;
case EvqSampleMaskIn:
recordBuiltInVaryingUsed(symbol->variable(), &mSampleMaskInAdded, mInputVaryings);
return;
case EvqSampleMask:
recordBuiltInFragmentOutputUsed(symbol->variable(), &mSampleMaskAdded);
return;
case EvqCullDistance:
recordBuiltInVaryingUsed(symbol->variable(), &mCullDistanceAdded, mOutputVaryings);
return;
case EvqPatchVerticesIn:
recordBuiltInVaryingUsed(symbol->variable(), &mPatchVerticesInAdded,
mInputVaryings);
break;
case EvqTessCoord:
recordBuiltInVaryingUsed(symbol->variable(), &mTessCoordAdded, mInputVaryings);
break;
case EvqTessLevelOuter:
if (mShaderType == GL_TESS_CONTROL_SHADER)
{
recordBuiltInVaryingUsed(symbol->variable(), &mTessLevelOuterAdded,
mOutputVaryings);
}
else
{
ASSERT(mShaderType == GL_TESS_EVALUATION_SHADER);
recordBuiltInVaryingUsed(symbol->variable(), &mTessLevelOuterAdded,
mInputVaryings);
}
break;
case EvqTessLevelInner:
if (mShaderType == GL_TESS_CONTROL_SHADER)
{
recordBuiltInVaryingUsed(symbol->variable(), &mTessLevelInnerAdded,
mOutputVaryings);
}
else
{
ASSERT(mShaderType == GL_TESS_EVALUATION_SHADER);
recordBuiltInVaryingUsed(symbol->variable(), &mTessLevelInnerAdded,
mInputVaryings);
}
break;
default:
break;
}
@ -626,25 +751,25 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
void CollectVariablesTraverser::setFieldOrVariableProperties(const TType &type,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
ShaderVariable *variableOut) const
{
ASSERT(variableOut);
variableOut->staticUse = staticUse;
variableOut->staticUse = staticUse;
variableOut->isShaderIOBlock = isShaderIOBlock;
variableOut->isPatch = isPatch;
const TStructure *structure = type.getStruct();
if (!structure)
{
variableOut->type = GLVariableType(type);
variableOut->precision = GLVariablePrecision(type);
}
else
const TStructure *structure = type.getStruct();
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
if (structure)
{
// Structures use a NONE type that isn't exposed outside ANGLE.
variableOut->type = GL_NONE;
if (structure->symbolType() != SymbolType::Empty)
{
variableOut->structName = structure->name().data();
variableOut->structOrBlockName = structure->name().data();
}
const TFieldList &fields = structure->fields();
@ -654,24 +779,73 @@ void CollectVariablesTraverser::setFieldOrVariableProperties(const TType &type,
// Regardless of the variable type (uniform, in/out etc.) its fields are always plain
// ShaderVariable objects.
ShaderVariable fieldVariable;
setFieldProperties(*field->type(), field->name(), staticUse, &fieldVariable);
setFieldProperties(*field->type(), field->name(), staticUse, isShaderIOBlock, isPatch,
&fieldVariable);
variableOut->fields.push_back(fieldVariable);
}
}
else if (interfaceBlock && isShaderIOBlock)
{
variableOut->type = GL_NONE;
if (interfaceBlock->symbolType() != SymbolType::Empty)
{
variableOut->structOrBlockName = interfaceBlock->name().data();
variableOut->mappedStructOrBlockName =
HashName(interfaceBlock->name(), mHashFunction, nullptr).data();
}
const TFieldList &fields = interfaceBlock->fields();
for (const TField *field : fields)
{
ShaderVariable fieldVariable;
setFieldProperties(*field->type(), field->name(), staticUse, true, isPatch,
&fieldVariable);
fieldVariable.isShaderIOBlock = true;
variableOut->fields.push_back(fieldVariable);
}
}
else
{
variableOut->type = GLVariableType(type);
variableOut->precision = GLVariablePrecision(type);
}
const TSpan<const unsigned int> &arraySizes = type.getArraySizes();
if (!arraySizes.empty())
{
variableOut->arraySizes.assign(arraySizes.begin(), arraySizes.end());
if (arraySizes[0] == 0)
{
// Tessellation Control & Evaluation shader inputs:
// Declaring an array size is optional. If no size is specified, it will be taken from
// the implementation-dependent maximum patch size (gl_MaxPatchVertices).
if (type.getQualifier() == EvqTessControlIn ||
type.getQualifier() == EvqTessEvaluationIn)
{
variableOut->arraySizes[0] = mResources.MaxPatchVertices;
}
// Tessellation Control shader outputs:
// Declaring an array size is optional. If no size is specified, it will be taken from
// output patch size declared in the shader.
if (type.getQualifier() == EvqTessControlOut)
{
ASSERT(mTessControlShaderOutputVertices > 0);
variableOut->arraySizes[0] = mTessControlShaderOutputVertices;
}
}
}
}
void CollectVariablesTraverser::setFieldProperties(const TType &type,
const ImmutableString &name,
bool staticUse,
bool isShaderIOBlock,
bool isPatch,
ShaderVariable *variableOut) const
{
ASSERT(variableOut);
setFieldOrVariableProperties(type, staticUse, variableOut);
setFieldOrVariableProperties(type, staticUse, isShaderIOBlock, isPatch, variableOut);
variableOut->name.assign(name.data(), name.length());
variableOut->mappedName = HashName(name, mHashFunction, nullptr).data();
}
@ -681,12 +855,37 @@ void CollectVariablesTraverser::setCommonVariableProperties(const TType &type,
ShaderVariable *variableOut) const
{
ASSERT(variableOut);
ASSERT(type.getInterfaceBlock() == nullptr || IsShaderIoBlock(type.getQualifier()) ||
type.getQualifier() == EvqPatchIn || type.getQualifier() == EvqPatchOut);
variableOut->staticUse = mSymbolTable->isStaticallyUsed(variable);
setFieldOrVariableProperties(type, variableOut->staticUse, variableOut);
ASSERT(variable.symbolType() != SymbolType::Empty);
variableOut->name.assign(variable.name().data(), variable.name().length());
variableOut->mappedName = getMappedName(&variable);
const bool staticUse = mSymbolTable->isStaticallyUsed(variable);
const bool isShaderIOBlock = type.getInterfaceBlock() != nullptr;
const bool isPatch = type.getQualifier() == EvqPatchIn || type.getQualifier() == EvqPatchOut;
setFieldOrVariableProperties(type, staticUse, isShaderIOBlock, isPatch, variableOut);
const bool isNamed = variable.symbolType() != SymbolType::Empty;
ASSERT(isNamed || isShaderIOBlock);
if (isNamed)
{
variableOut->name.assign(variable.name().data(), variable.name().length());
variableOut->mappedName = getMappedName(&variable);
}
// For I/O blocks, additionally store the name of the block as blockName. If the variable is
// unnamed, this name will be used instead for the purpose of interface matching.
if (isShaderIOBlock)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
ASSERT(interfaceBlock);
variableOut->structOrBlockName.assign(interfaceBlock->name().data(),
interfaceBlock->name().length());
variableOut->mappedStructOrBlockName =
HashName(interfaceBlock->name(), mHashFunction, nullptr).data();
variableOut->isShaderIOBlock = true;
}
}
ShaderVariable CollectVariablesTraverser::recordAttribute(const TIntermSymbol &variable) const
@ -711,6 +910,7 @@ ShaderVariable CollectVariablesTraverser::recordOutputVariable(const TIntermSymb
outputVariable.location = type.getLayoutQualifier().location;
outputVariable.index = type.getLayoutQualifier().index;
outputVariable.yuv = type.getLayoutQualifier().yuv;
return outputVariable;
}
@ -738,15 +938,64 @@ ShaderVariable CollectVariablesTraverser::recordVarying(const TIntermSymbol &var
varying.isInvariant = true;
}
break;
case EvqPatchIn:
case EvqPatchOut:
varying.isPatch = true;
break;
default:
break;
}
varying.interpolation = GetInterpolationType(type.getQualifier());
// Shader I/O block properties
if (type.getBasicType() == EbtInterfaceBlock)
{
bool isBlockImplicitLocation = false;
int location = type.getLayoutQualifier().location;
// when a interface has not location in layout, assign to the zero.
if (location < 0)
{
location = 0;
isBlockImplicitLocation = true;
}
const TInterfaceBlock *blockType = type.getInterfaceBlock();
ASSERT(blockType->fields().size() == varying.fields.size());
for (size_t fieldIndex = 0; fieldIndex < varying.fields.size(); ++fieldIndex)
{
const TField *blockField = blockType->fields()[fieldIndex];
ShaderVariable &fieldVariable = varying.fields[fieldIndex];
const TType &fieldType = *blockField->type();
fieldVariable.hasImplicitLocation = isBlockImplicitLocation;
fieldVariable.isPatch = varying.isPatch;
int fieldLocation = fieldType.getLayoutQualifier().location;
if (fieldLocation >= 0)
{
fieldVariable.hasImplicitLocation = false;
fieldVariable.location = fieldLocation;
location = fieldLocation;
}
else
{
fieldVariable.location = location;
location += fieldType.getLocationCount();
}
if (fieldType.getQualifier() != EvqGlobal)
{
fieldVariable.interpolation = GetFieldInterpolationType(fieldType.getQualifier());
}
}
}
return varying;
}
// TODO(jiawei.shao@intel.com): implement GL_EXT_shader_io_blocks.
void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
const TType &interfaceBlockType,
InterfaceBlock *interfaceBlock) const
@ -759,11 +1008,13 @@ void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
interfaceBlock->name = blockType->name().data();
interfaceBlock->mappedName = getMappedName(blockType);
const bool isGLInBuiltin = (instanceName != nullptr) && strncmp(instanceName, "gl_in", 5u) == 0;
if (instanceName != nullptr)
{
interfaceBlock->instanceName = instanceName;
const TSymbol *blockSymbol = nullptr;
if (strncmp(instanceName, "gl_in", 5u) == 0)
if (isGLInBuiltin)
{
blockSymbol = mSymbolTable->getGlInVariableWithArraySize();
}
@ -775,6 +1026,7 @@ void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
interfaceBlock->staticUse =
mSymbolTable->isStaticallyUsed(*static_cast<const TVariable *>(blockSymbol));
}
ASSERT(!interfaceBlockType.isArrayOfArrays()); // Disallowed by GLSL ES 3.10 section 4.3.9
interfaceBlock->arraySize =
interfaceBlockType.isArray() ? interfaceBlockType.getOutermostArraySize() : 0;
@ -791,6 +1043,7 @@ void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
// Gather field information
bool anyFieldStaticallyUsed = false;
for (const TField *field : blockType->fields())
{
const TType &fieldType = *field->type();
@ -811,7 +1064,7 @@ void CollectVariablesTraverser::recordInterfaceBlock(const char *instanceName,
}
ShaderVariable fieldVariable;
setFieldProperties(fieldType, field->name(), staticUse, &fieldVariable);
setFieldProperties(fieldType, field->name(), staticUse, false, false, &fieldVariable);
fieldVariable.isRowMajorLayout =
(fieldType.getLayoutQualifier().matrixPacking == EmpRowMajor);
interfaceBlock->fields.push_back(fieldVariable);
@ -845,8 +1098,8 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
TQualifier qualifier = typedNode.getQualifier();
bool isShaderVariable = qualifier == EvqAttribute || qualifier == EvqVertexIn ||
qualifier == EvqFragmentOut || qualifier == EvqUniform ||
IsVarying(qualifier);
qualifier == EvqFragmentOut || qualifier == EvqFragmentInOut ||
qualifier == EvqUniform || IsVarying(qualifier);
if (typedNode.getBasicType() != EbtInterfaceBlock && !isShaderVariable)
{
@ -866,15 +1119,21 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
continue;
}
// TODO(jiawei.shao@intel.com): implement GL_EXT_shader_io_blocks.
if (typedNode.getBasicType() == EbtInterfaceBlock)
// SpirvTransformer::transform uses a map of ShaderVariables, it needs member variables and
// (named or unnamed) structure as ShaderVariable. at link between two shaders, validation
// between of named and unnamed, needs the same structure, its members, and members order
// except instance name.
if (typedNode.getBasicType() == EbtInterfaceBlock && !IsShaderIoBlock(qualifier) &&
qualifier != EvqPatchIn && qualifier != EvqPatchOut)
{
InterfaceBlock interfaceBlock;
recordInterfaceBlock(variable.variable().symbolType() != SymbolType::Empty
? variable.getName().data()
: nullptr,
variable.getType(), &interfaceBlock);
bool isUnnamed = variable.variable().symbolType() == SymbolType::Empty;
const TType &type = variable.getType();
recordInterfaceBlock(isUnnamed ? nullptr : variable.getName().data(), type,
&interfaceBlock);
// all fields in interface block will be added for updating interface variables because
// the temporal structure variable will be ignored.
switch (qualifier)
{
case EvqUniform:
@ -889,7 +1148,9 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
}
else
{
ASSERT(variable.variable().symbolType() != SymbolType::Empty);
ASSERT(variable.variable().symbolType() != SymbolType::Empty ||
IsShaderIoBlock(qualifier) || qualifier == EvqPatchIn ||
qualifier == EvqPatchOut);
switch (qualifier)
{
case EvqAttribute:
@ -897,6 +1158,7 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
mAttribs->push_back(recordAttribute(variable));
break;
case EvqFragmentOut:
case EvqFragmentInOut:
mOutputVariables->push_back(recordOutputVariable(variable));
break;
case EvqUniform:
@ -922,8 +1184,6 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
return false;
}
// TODO(jiawei.shao@intel.com): add search on mInBlocks and mOutBlocks when implementing
// GL_EXT_shader_io_blocks.
InterfaceBlock *CollectVariablesTraverser::findNamedInterfaceBlock(
const ImmutableString &blockName) const
{
@ -952,36 +1212,62 @@ bool CollectVariablesTraverser::visitBinary(Visit, TIntermBinary *binaryNode)
TIntermBinary *interfaceIndexingNode = blockNode->getAsBinaryNode();
if (interfaceIndexingNode)
{
TIntermTyped *interfaceNode = interfaceIndexingNode->getLeft()->getAsTyped();
ASSERT(interfaceNode);
const TType &interfaceType = interfaceNode->getType();
if (interfaceType.getQualifier() == EvqPerVertexIn)
{
namedBlock = recordGLInUsed(interfaceType);
ASSERT(namedBlock);
}
// We need to continue traversing to collect useful variables in the index expression
// of the interface block array or gl_in in the case of the if above.
ASSERT(interfaceIndexingNode->getOp() == EOpIndexDirect ||
interfaceIndexingNode->getOp() == EOpIndexIndirect);
traverseIndexExpression = true;
blockNode = interfaceIndexingNode->getLeft();
}
const TInterfaceBlock *interfaceBlock = blockNode->getType().getInterfaceBlock();
if (!namedBlock)
const TType &interfaceNodeType = blockNode->getType();
const TInterfaceBlock *interfaceBlock = interfaceNodeType.getInterfaceBlock();
const TQualifier qualifier = interfaceNodeType.getQualifier();
// If it's a shader I/O block, look in varyings
ShaderVariable *ioBlockVar = nullptr;
if (qualifier == EvqPerVertexIn)
{
namedBlock = findNamedInterfaceBlock(interfaceBlock->name());
TIntermSymbol *symbolNode = blockNode->getAsSymbolNode();
ASSERT(symbolNode);
recordBuiltInVaryingUsed(symbolNode->variable(), &mPerVertexInAdded, mInputVaryings);
ioBlockVar = FindShaderIOBlockVariable(interfaceBlock->name(), mInputVaryings);
}
else if (IsVaryingIn(qualifier))
{
ioBlockVar = FindShaderIOBlockVariable(interfaceBlock->name(), mInputVaryings);
}
else if (qualifier == EvqPerVertexOut)
{
TIntermSymbol *symbolNode = blockNode->getAsSymbolNode();
ASSERT(symbolNode);
recordBuiltInVaryingUsed(symbolNode->variable(), &mPerVertexOutAdded, mOutputVaryings);
ioBlockVar = FindShaderIOBlockVariable(interfaceBlock->name(), mOutputVaryings);
}
else if (IsVaryingOut(qualifier))
{
ioBlockVar = FindShaderIOBlockVariable(interfaceBlock->name(), mOutputVaryings);
}
if (ioBlockVar)
{
MarkActive(ioBlockVar);
}
else
{
if (!namedBlock)
{
namedBlock = findNamedInterfaceBlock(interfaceBlock->name());
}
ASSERT(namedBlock);
ASSERT(namedBlock->staticUse);
namedBlock->active = true;
unsigned int fieldIndex = static_cast<unsigned int>(constantUnion->getIConst(0));
ASSERT(fieldIndex < namedBlock->fields.size());
// TODO(oetuaho): Would be nicer to record static use of fields of named interface
// blocks more accurately at parse time - now we only mark the fields statically used if
// they are active. http://anglebug.com/2440 We need to mark this field and all of its
// sub-fields, as static/active
MarkActive(&namedBlock->fields[fieldIndex]);
}
ASSERT(namedBlock);
ASSERT(namedBlock->staticUse);
namedBlock->active = true;
unsigned int fieldIndex = static_cast<unsigned int>(constantUnion->getIConst(0));
ASSERT(fieldIndex < namedBlock->fields.size());
// TODO(oetuaho): Would be nicer to record static use of fields of named interface blocks
// more accurately at parse time - now we only mark the fields statically used if they are
// active. http://anglebug.com/2440
// We need to mark this field and all of its sub-fields, as static/active
MarkActive(&namedBlock->fields[fieldIndex]);
if (traverseIndexExpression)
{
@ -1005,16 +1291,17 @@ void CollectVariables(TIntermBlock *root,
std::vector<ShaderVariable> *sharedVariables,
std::vector<InterfaceBlock> *uniformBlocks,
std::vector<InterfaceBlock> *shaderStorageBlocks,
std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior)
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices)
{
CollectVariablesTraverser collect(attributes, outputVariables, uniforms, inputVaryings,
outputVaryings, sharedVariables, uniformBlocks,
shaderStorageBlocks, inBlocks, hashFunction, symbolTable,
shaderType, extensionBehavior);
CollectVariablesTraverser collect(
attributes, outputVariables, uniforms, inputVaryings, outputVaryings, sharedVariables,
uniformBlocks, shaderStorageBlocks, hashFunction, symbolTable, shaderType,
extensionBehavior, resources, tessControlShaderOutputVertices);
root->traverse(&collect);
}

Просмотреть файл

@ -27,11 +27,12 @@ void CollectVariables(TIntermBlock *root,
std::vector<ShaderVariable> *sharedVariables,
std::vector<InterfaceBlock> *uniformBlocks,
std::vector<InterfaceBlock> *shaderStorageBlocks,
std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
GLenum shaderType,
const TExtensionBehavior &extensionBehavior);
const TExtensionBehavior &extensionBehavior,
const ShBuiltInResources &resources,
int tessControlShaderOutputVertices);
} // namespace sh
#endif // COMPILER_TRANSLATOR_COLLECTVARIABLES_H_

Просмотреть файл

@ -52,11 +52,10 @@ typedef std::basic_string<char, std::char_traits<char>, TStringAllocator> TStrin
typedef std::basic_ostringstream<char, std::char_traits<char>, TStringAllocator> TStringStream;
//
// Persistent string memory. Should only be used for strings that survive
// across compiles.
// Persistent memory. Should only be used for strings that survive across compiles.
//
#define TPersistString std::string
#define TPersistStringStream std::ostringstream
using TPersistString = std::string;
using TPersistStringStream = std::ostringstream;
//
// Pool allocator versions of vectors, lists, and maps

Просмотреть файл

@ -16,39 +16,41 @@
#include "compiler/translator/IsASTDepthBelowLimit.h"
#include "compiler/translator/OutputTree.h"
#include "compiler/translator/ParseContext.h"
#include "compiler/translator/ValidateBarrierFunctionCall.h"
#include "compiler/translator/ValidateClipCullDistance.h"
#include "compiler/translator/ValidateLimitations.h"
#include "compiler/translator/ValidateMaxParameters.h"
#include "compiler/translator/ValidateOutputs.h"
#include "compiler/translator/ValidateVaryingLocations.h"
#include "compiler/translator/VariablePacker.h"
#include "compiler/translator/tree_ops/AddAndTrueToLoopCondition.h"
#include "compiler/translator/tree_ops/ClampFragDepth.h"
#include "compiler/translator/tree_ops/ClampPointSize.h"
#include "compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.h"
#include "compiler/translator/tree_ops/DeferGlobalInitializers.h"
#include "compiler/translator/tree_ops/EarlyFragmentTestsOptimization.h"
#include "compiler/translator/tree_ops/EmulateGLFragColorBroadcast.h"
#include "compiler/translator/tree_ops/EmulateMultiDrawShaderBuiltins.h"
#include "compiler/translator/tree_ops/EmulatePrecision.h"
#include "compiler/translator/tree_ops/FoldExpressions.h"
#include "compiler/translator/tree_ops/ForcePrecisionQualifier.h"
#include "compiler/translator/tree_ops/InitializeVariables.h"
#include "compiler/translator/tree_ops/PruneEmptyCases.h"
#include "compiler/translator/tree_ops/PruneNoOps.h"
#include "compiler/translator/tree_ops/RegenerateStructNames.h"
#include "compiler/translator/tree_ops/RemoveArrayLengthMethod.h"
#include "compiler/translator/tree_ops/RemoveDynamicIndexing.h"
#include "compiler/translator/tree_ops/RemoveInvariantDeclaration.h"
#include "compiler/translator/tree_ops/RemovePow.h"
#include "compiler/translator/tree_ops/RemoveUnreferencedVariables.h"
#include "compiler/translator/tree_ops/RewriteDoWhile.h"
#include "compiler/translator/tree_ops/RewriteRepeatedAssignToSwizzled.h"
#include "compiler/translator/tree_ops/ScalarizeVecAndMatConstructorArgs.h"
#include "compiler/translator/tree_ops/SeparateDeclarations.h"
#include "compiler/translator/tree_ops/SimplifyLoopConditions.h"
#include "compiler/translator/tree_ops/SplitSequenceOperator.h"
#include "compiler/translator/tree_ops/UnfoldShortCircuitAST.h"
#include "compiler/translator/tree_ops/UseInterfaceBlockFields.h"
#include "compiler/translator/tree_ops/VectorizeVectorScalarArithmetic.h"
#include "compiler/translator/tree_ops/gl/ClampFragDepth.h"
#include "compiler/translator/tree_ops/gl/RegenerateStructNames.h"
#include "compiler/translator/tree_ops/gl/RewriteRepeatedAssignToSwizzled.h"
#include "compiler/translator/tree_ops/gl/UseInterfaceBlockFields.h"
#include "compiler/translator/tree_ops/gl/VectorizeVectorScalarArithmetic.h"
#include "compiler/translator/tree_ops/gl/mac/AddAndTrueToLoopCondition.h"
#include "compiler/translator/tree_ops/gl/mac/RewriteDoWhile.h"
#include "compiler/translator/tree_ops/gl/mac/UnfoldShortCircuitAST.h"
#include "compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h"
#include "compiler/translator/tree_util/BuiltIn.h"
#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
#include "compiler/translator/tree_util/ReplaceShadowingVariables.h"
@ -218,6 +220,8 @@ int GetMaxShaderVersionForSpec(ShShaderSpec spec)
case SH_GLES3_1_SPEC:
case SH_WEBGL3_SPEC:
return 310;
case SH_GLES3_2_SPEC:
return 320;
case SH_GL_CORE_SPEC:
case SH_GL_COMPATIBILITY_SPEC:
return 460;
@ -301,6 +305,11 @@ TCompiler::TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
mGeometryShaderInvocations(0),
mGeometryShaderInputPrimitiveType(EptUndefined),
mGeometryShaderOutputPrimitiveType(EptUndefined),
mTessControlShaderOutputVertices(0),
mTessEvaluationShaderInputPrimitiveType(EtetUndefined),
mTessEvaluationShaderInputVertexSpacingType(EtetUndefined),
mTessEvaluationShaderInputOrderingType(EtetUndefined),
mTessEvaluationShaderInputPointType(EtetUndefined),
mCompileOptions(0)
{}
@ -312,7 +321,7 @@ bool TCompiler::shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptio
// validate loop and indexing as well (to verify that the shader only uses minimal functionality
// of ESSL 1.00 as in Appendix A of the spec).
return (IsWebGLBasedSpec(mShaderSpec) && mShaderVersion == 100) ||
(compileOptions & SH_VALIDATE_LOOP_INDEXING);
(compileOptions & SH_VALIDATE_LOOP_INDEXING) != 0;
}
bool TCompiler::Init(const ShBuiltInResources &resources)
@ -355,7 +364,7 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
// If gl_DrawID is not supported, remove it from the available extensions
// Currently we only allow emulation of gl_DrawID
const bool glDrawIDSupported = (compileOptions & SH_EMULATE_GL_DRAW_ID) != 0u;
const bool glDrawIDSupported = (compileOptions & SH_EMULATE_GL_DRAW_ID) != 0;
if (!glDrawIDSupported)
{
auto it = mExtensionBehavior.find(TExtension::ANGLE_multi_draw);
@ -366,7 +375,7 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
}
const bool glBaseVertexBaseInstanceSupported =
(compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0u;
(compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0;
if (!glBaseVertexBaseInstanceSupported)
{
auto it = mExtensionBehavior.find(TExtension::ANGLE_base_vertex_base_instance);
@ -378,7 +387,7 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
// First string is path of source file if flag is set. The actual source follows.
size_t firstSource = 0;
if (compileOptions & SH_SOURCE_PATH)
if ((compileOptions & SH_SOURCE_PATH) != 0)
{
mSourcePath = shaderStrings[0];
++firstSource;
@ -449,9 +458,8 @@ bool TCompiler::checkShaderVersion(TParseContext *parseContext)
"Geometry shader is not supported in this shader version.");
return false;
}
else
else if (mShaderVersion == 310)
{
ASSERT(mShaderVersion == 310);
if (!parseContext->checkCanUseExtension(sh::TSourceLoc(),
TExtension::EXT_geometry_shader))
{
@ -460,6 +468,24 @@ bool TCompiler::checkShaderVersion(TParseContext *parseContext)
}
break;
case GL_TESS_CONTROL_SHADER_EXT:
case GL_TESS_EVALUATION_SHADER_EXT:
if (mShaderVersion < 310)
{
mDiagnostics.globalError(
"Tessellation shaders are not supported in this shader version.");
return false;
}
else if (mShaderVersion == 310)
{
if (!parseContext->checkCanUseExtension(sh::TSourceLoc(),
TExtension::EXT_tessellation_shader))
{
return false;
}
}
break;
default:
break;
}
@ -488,6 +514,20 @@ void TCompiler::setASTMetadata(const TParseContext &parseContext)
mGeometryShaderMaxVertices = parseContext.getGeometryShaderMaxVertices();
mGeometryShaderInvocations = parseContext.getGeometryShaderInvocations();
}
if (mShaderType == GL_TESS_CONTROL_SHADER_EXT)
{
mTessControlShaderOutputVertices = parseContext.getTessControlShaderOutputVertices();
}
if (mShaderType == GL_TESS_EVALUATION_SHADER_EXT)
{
mTessEvaluationShaderInputPrimitiveType =
parseContext.getTessEvaluationShaderInputPrimitiveType();
mTessEvaluationShaderInputVertexSpacingType =
parseContext.getTessEvaluationShaderInputVertexSpacingType();
mTessEvaluationShaderInputOrderingType =
parseContext.getTessEvaluationShaderInputOrderingType();
mTessEvaluationShaderInputPointType = parseContext.getTessEvaluationShaderInputPointType();
}
}
unsigned int TCompiler::getSharedMemorySize() const
@ -507,6 +547,12 @@ bool TCompiler::validateAST(TIntermNode *root)
{
bool valid = ValidateAST(root, &mDiagnostics, mValidateASTOptions);
#if defined(ANGLE_ENABLE_ASSERTS)
if (!valid)
{
fprintf(stderr, "AST validation error(s):\n%s\n", mInfoSink.info.c_str());
}
#endif
// In debug, assert validation. In release, validation errors will be returned back to the
// application as internal ANGLE errors.
ASSERT(valid);
@ -520,8 +566,14 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
const TParseContext &parseContext,
ShCompileOptions compileOptions)
{
mValidateASTOptions = {};
if (!validateAST(root))
{
return false;
}
// Disallow expressions deemed too complex.
if ((compileOptions & SH_LIMIT_EXPRESSION_COMPLEXITY) && !limitExpressionComplexity(root))
if ((compileOptions & SH_LIMIT_EXPRESSION_COMPLEXITY) != 0 && !limitExpressionComplexity(root))
{
return false;
}
@ -559,10 +611,11 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
// We need to generate globals early if we have non constant initializers enabled
bool initializeLocalsAndGlobals =
(compileOptions & SH_INITIALIZE_UNINITIALIZED_LOCALS) && !IsOutputHLSL(getOutputType());
bool canUseLoopsToInitialize = !(compileOptions & SH_DONT_USE_LOOPS_TO_INITIALIZE_VARIABLES);
bool highPrecisionSupported = mShaderVersion > 100 || mShaderType != GL_FRAGMENT_SHADER ||
bool initializeLocalsAndGlobals = (compileOptions & SH_INITIALIZE_UNINITIALIZED_LOCALS) != 0 &&
!IsOutputHLSL(getOutputType());
bool canUseLoopsToInitialize =
(compileOptions & SH_DONT_USE_LOOPS_TO_INITIALIZE_VARIABLES) == 0;
bool highPrecisionSupported = mShaderVersion > 100 || mShaderType != GL_FRAGMENT_SHADER ||
mResources.FragmentPrecisionHigh == 1;
bool enableNonConstantInitializers = IsExtensionEnabled(
mExtensionBehavior, TExtension::EXT_shader_non_constant_global_initializers);
@ -579,7 +632,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
return false;
}
if ((compileOptions & SH_LIMIT_CALL_STACK_DEPTH) && !checkCallDepth())
if ((compileOptions & SH_LIMIT_CALL_STACK_DEPTH) != 0 && !checkCallDepth())
{
return false;
}
@ -592,10 +645,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
return false;
}
if (!(compileOptions & SH_DONT_PRUNE_UNUSED_FUNCTIONS))
{
pruneUnusedFunctions(root);
}
pruneUnusedFunctions(root);
if (IsSpecWithFunctionBodyNewScope(mShaderSpec, mShaderVersion))
{
if (!ReplaceShadowingVariables(this, root, &mSymbolTable))
@ -615,6 +665,11 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
return false;
}
if (mShaderType == GL_TESS_CONTROL_SHADER && !ValidateBarrierFunctionCall(root, &mDiagnostics))
{
return false;
}
// Fail compilation if precision emulation not supported.
if (getResources().WEBGL_debug_shader_precision && getPragma().debugShaderPrecision &&
!EmulatePrecision::SupportedInLanguage(mOutputType))
@ -623,13 +678,22 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
return false;
}
if (parseContext.isExtensionEnabled(TExtension::EXT_clip_cull_distance))
{
if (!ValidateClipCullDistance(root, &mDiagnostics,
mResources.MaxCombinedClipAndCullDistances))
{
return false;
}
}
// Clamping uniform array bounds needs to happen after validateLimitations pass.
if (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS)
if ((compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS) != 0)
{
mArrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root);
}
if ((compileOptions & SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW) &&
if ((compileOptions & SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW) != 0 &&
(parseContext.isExtensionEnabled(TExtension::OVR_multiview2) ||
parseContext.isExtensionEnabled(TExtension::OVR_multiview)) &&
getShaderType() != GL_COMPUTE_SHADER)
@ -642,7 +706,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
// This pass might emit short circuits so keep it before the short circuit unfolding
if (compileOptions & SH_REWRITE_DO_WHILE_LOOPS)
if ((compileOptions & SH_REWRITE_DO_WHILE_LOOPS) != 0)
{
if (!RewriteDoWhile(this, root, &mSymbolTable))
{
@ -650,7 +714,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_ADD_AND_TRUE_TO_LOOP_CONDITION)
if ((compileOptions & SH_ADD_AND_TRUE_TO_LOOP_CONDITION) != 0)
{
if (!AddAndTrueToLoopCondition(this, root))
{
@ -658,7 +722,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_UNFOLD_SHORT_CIRCUIT)
if ((compileOptions & SH_UNFOLD_SHORT_CIRCUIT) != 0)
{
if (!UnfoldShortCircuitAST(this, root))
{
@ -666,19 +730,9 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_REMOVE_POW_WITH_CONSTANT_EXPONENT)
if ((compileOptions & SH_REGENERATE_STRUCT_NAMES) != 0)
{
if (!RemovePow(this, root, &mSymbolTable))
{
return false;
}
}
if (compileOptions & SH_REGENERATE_STRUCT_NAMES)
{
RegenerateStructNames gen(&mSymbolTable);
root->traverse(&gen);
if (!validateAST(root))
if (!RegenerateStructNames(this, root, &mSymbolTable))
{
return false;
}
@ -687,7 +741,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
if (mShaderType == GL_VERTEX_SHADER &&
IsExtensionEnabled(mExtensionBehavior, TExtension::ANGLE_multi_draw))
{
if ((compileOptions & SH_EMULATE_GL_DRAW_ID) != 0u)
if ((compileOptions & SH_EMULATE_GL_DRAW_ID) != 0)
{
if (!EmulateGLDrawID(this, root, &mSymbolTable, &mUniforms,
shouldCollectVariables(compileOptions)))
@ -700,11 +754,11 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
if (mShaderType == GL_VERTEX_SHADER &&
IsExtensionEnabled(mExtensionBehavior, TExtension::ANGLE_base_vertex_base_instance))
{
if ((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0u)
if ((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0)
{
if (!EmulateGLBaseVertexBaseInstance(this, root, &mSymbolTable, &mUniforms,
shouldCollectVariables(compileOptions),
compileOptions & SH_ADD_BASE_VERTEX_TO_VERTEX_ID))
if (!EmulateGLBaseVertexBaseInstance(
this, root, &mSymbolTable, &mUniforms, shouldCollectVariables(compileOptions),
(compileOptions & SH_ADD_BASE_VERTEX_TO_VERTEX_ID) != 0))
{
return false;
}
@ -722,7 +776,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
int simplifyScalarized = (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS)
int simplifyScalarized = (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS) != 0
? IntermNodePatternMatcher::kScalarizedVecOrMatConstructor
: 0;
@ -781,7 +835,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
GetGlobalPoolAllocator()->unlock();
mBuiltInFunctionEmulator.markBuiltInFunctionsForEmulation(root);
if (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS)
if ((compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS) != 0)
{
if (!ScalarizeVecAndMatConstructorArgs(this, root, mShaderType, highPrecisionSupported,
&mSymbolTable))
@ -790,23 +844,31 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if ((compileOptions & SH_FORCE_SHADER_PRECISION_HIGHP_TO_MEDIUMP) != 0)
{
if (!ForceShaderPrecisionToMediump(root, &mSymbolTable, mShaderType))
{
return false;
}
}
if (shouldCollectVariables(compileOptions))
{
ASSERT(!mVariablesCollected);
CollectVariables(root, &mAttributes, &mOutputVariables, &mUniforms, &mInputVaryings,
&mOutputVaryings, &mSharedVariables, &mUniformBlocks,
&mShaderStorageBlocks, &mInBlocks, mResources.HashFunction, &mSymbolTable,
mShaderType, mExtensionBehavior);
&mShaderStorageBlocks, mResources.HashFunction, &mSymbolTable, mShaderType,
mExtensionBehavior, mResources, mTessControlShaderOutputVertices);
collectInterfaceBlocks();
mVariablesCollected = true;
if (compileOptions & SH_USE_UNUSED_STANDARD_SHARED_BLOCKS)
if ((compileOptions & SH_USE_UNUSED_STANDARD_SHARED_BLOCKS) != 0)
{
if (!useAllMembersInUnusedStandardAndSharedBlocks(root))
{
return false;
}
}
if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS)
if ((compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS) != 0)
{
int maxUniformVectors = GetMaxUniformVectorsForShaderType(mShaderType, mResources);
// Returns true if, after applying the packing rules in the GLSL ES 1.00.17 spec
@ -817,7 +879,12 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
return false;
}
}
if ((compileOptions & SH_INIT_OUTPUT_VARIABLES) && (mShaderType != GL_COMPUTE_SHADER))
bool needInitializeOutputVariables =
(compileOptions & SH_INIT_OUTPUT_VARIABLES) != 0 && mShaderType != GL_COMPUTE_SHADER;
needInitializeOutputVariables |=
(compileOptions & SH_INIT_FRAGMENT_OUTPUT_VARIABLES) != 0 &&
mShaderType == GL_FRAGMENT_SHADER;
if (needInitializeOutputVariables)
{
if (!initializeOutputVariables(root))
{
@ -840,7 +907,8 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
// It may have been already initialized among other output variables, in that case we don't
// need to initialize it twice.
if (mShaderType == GL_VERTEX_SHADER && !mGLPositionInitialized &&
((compileOptions & SH_INIT_GL_POSITION) || (mOutputType == SH_GLSL_COMPATIBILITY_OUTPUT)))
((compileOptions & SH_INIT_GL_POSITION) != 0 ||
mOutputType == SH_GLSL_COMPATIBILITY_OUTPUT))
{
if (!initializeGLPosition(root))
{
@ -891,7 +959,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (getShaderType() == GL_VERTEX_SHADER && (compileOptions & SH_CLAMP_POINT_SIZE))
if (getShaderType() == GL_VERTEX_SHADER && (compileOptions & SH_CLAMP_POINT_SIZE) != 0)
{
if (!ClampPointSize(this, root, mResources.MaxPointSize, &getSymbolTable()))
{
@ -899,7 +967,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (getShaderType() == GL_FRAGMENT_SHADER && (compileOptions & SH_CLAMP_FRAG_DEPTH))
if (getShaderType() == GL_FRAGMENT_SHADER && (compileOptions & SH_CLAMP_FRAG_DEPTH) != 0)
{
if (!ClampFragDepth(this, root, &getSymbolTable()))
{
@ -907,7 +975,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_REWRITE_REPEATED_ASSIGN_TO_SWIZZLED)
if ((compileOptions & SH_REWRITE_REPEATED_ASSIGN_TO_SWIZZLED) != 0)
{
if (!sh::RewriteRepeatedAssignToSwizzled(this, root))
{
@ -915,7 +983,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_REWRITE_VECTOR_SCALAR_ARITHMETIC)
if ((compileOptions & SH_REWRITE_VECTOR_SCALAR_ARITHMETIC) != 0)
{
if (!VectorizeVectorScalarArithmetic(this, root, &getSymbolTable()))
{
@ -923,7 +991,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
}
if (compileOptions & SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR)
if ((compileOptions & SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR) != 0)
{
if (!sh::RemoveDynamicIndexingOfSwizzledVector(this, root, &getSymbolTable(), nullptr))
{
@ -932,7 +1000,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
}
mEarlyFragmentTestsOptimized = false;
if (compileOptions & SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION)
if ((compileOptions & SH_EARLY_FRAGMENT_TESTS_OPTIMIZATION) != 0)
{
if (mShaderVersion <= 300 && mShaderType == GL_FRAGMENT_SHADER &&
!isEarlyFragmentTestsSpecified())
@ -970,12 +1038,12 @@ bool TCompiler::compile(const char *const shaderStrings[],
if (root)
{
if (compileOptions & SH_INTERMEDIATE_TREE)
if ((compileOptions & SH_INTERMEDIATE_TREE) != 0)
{
OutputTree(root, mInfoSink.info);
}
if (compileOptions & SH_OBJECT_CODE)
if ((compileOptions & SH_OBJECT_CODE) != 0)
{
PerformanceDiagnostics perfDiagnostics(&mDiagnostics);
if (!translate(root, compileOptions, &perfDiagnostics))
@ -988,11 +1056,11 @@ bool TCompiler::compile(const char *const shaderStrings[],
{
bool lookForDrawID =
IsExtensionEnabled(mExtensionBehavior, TExtension::ANGLE_multi_draw) &&
((compileOptions & SH_EMULATE_GL_DRAW_ID) != 0u);
(compileOptions & SH_EMULATE_GL_DRAW_ID) != 0;
bool lookForBaseVertexBaseInstance =
IsExtensionEnabled(mExtensionBehavior,
TExtension::ANGLE_base_vertex_base_instance) &&
((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0u);
(compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0;
if (lookForDrawID || lookForBaseVertexBaseInstance)
{
@ -1068,12 +1136,15 @@ void TCompiler::setResourceString()
<< ":EXT_frag_depth:" << mResources.EXT_frag_depth
<< ":EXT_shader_texture_lod:" << mResources.EXT_shader_texture_lod
<< ":EXT_shader_framebuffer_fetch:" << mResources.EXT_shader_framebuffer_fetch
<< ":EXT_shader_framebuffer_fetch_non_coherent:" << mResources.EXT_shader_framebuffer_fetch_non_coherent
<< ":NV_shader_framebuffer_fetch:" << mResources.NV_shader_framebuffer_fetch
<< ":ARM_shader_framebuffer_fetch:" << mResources.ARM_shader_framebuffer_fetch
<< ":OVR_multiview2:" << mResources.OVR_multiview2
<< ":OVR_multiview:" << mResources.OVR_multiview
<< ":EXT_YUV_target:" << mResources.EXT_YUV_target
<< ":EXT_geometry_shader:" << mResources.EXT_geometry_shader
<< ":OES_shader_io_blocks:" << mResources.OES_shader_io_blocks
<< ":EXT_shader_io_blocks:" << mResources.EXT_shader_io_blocks
<< ":EXT_gpu_shader5:" << mResources.EXT_gpu_shader5
<< ":OES_texture_3D:" << mResources.OES_texture_3D
<< ":MaxVertexOutputVectors:" << mResources.MaxVertexOutputVectors
@ -1092,11 +1163,15 @@ void TCompiler::setResourceString()
<< ":EXT_shadow_samplers:" << mResources.EXT_shadow_samplers
<< ":OES_shader_multisample_interpolation:" << mResources.OES_shader_multisample_interpolation
<< ":OES_shader_image_atomic:" << mResources.OES_shader_image_atomic
<< ":EXT_tessellation_shader:" << mResources.EXT_tessellation_shader
<< ":OES_texture_buffer:" << mResources.OES_texture_buffer
<< ":EXT_texture_buffer:" << mResources.EXT_texture_buffer
<< ":OES_sample_variables:" << mResources.OES_sample_variables
<< ":EXT_clip_cull_distance:" << mResources.EXT_clip_cull_distance
<< ":MinProgramTextureGatherOffset:" << mResources.MinProgramTextureGatherOffset
<< ":MaxProgramTextureGatherOffset:" << mResources.MaxProgramTextureGatherOffset
<< ":MaxImageUnits:" << mResources.MaxImageUnits
<< ":MaxSamples:" << mResources.MaxSamples
<< ":MaxVertexImageUniforms:" << mResources.MaxVertexImageUniforms
<< ":MaxFragmentImageUniforms:" << mResources.MaxFragmentImageUniforms
<< ":MaxComputeImageUniforms:" << mResources.MaxComputeImageUniforms
@ -1132,7 +1207,27 @@ void TCompiler::setResourceString()
<< ":MaxGeometryShaderStorageBlocks:" << mResources.MaxGeometryShaderStorageBlocks
<< ":MaxGeometryShaderInvocations:" << mResources.MaxGeometryShaderInvocations
<< ":MaxGeometryImageUniforms:" << mResources.MaxGeometryImageUniforms
<< ":MaxClipDistances" << mResources.MaxClipDistances;
<< ":MaxClipDistances" << mResources.MaxClipDistances
<< ":MaxCullDistances" << mResources.MaxCullDistances
<< ":MaxCombinedClipAndCullDistances" << mResources.MaxCombinedClipAndCullDistances
<< ":MaxTessControlInputComponents:" << mResources.MaxTessControlInputComponents
<< ":MaxTessControlOutputComponents:" << mResources.MaxTessControlOutputComponents
<< ":MaxTessControlTextureImageUnits:" << mResources.MaxTessControlTextureImageUnits
<< ":MaxTessControlUniformComponents:" << mResources.MaxTessControlUniformComponents
<< ":MaxTessControlTotalOutputComponents:" << mResources.MaxTessControlTotalOutputComponents
<< ":MaxTessControlImageUniforms:" << mResources.MaxTessControlImageUniforms
<< ":MaxTessControlAtomicCounters:" << mResources.MaxTessControlAtomicCounters
<< ":MaxTessControlAtomicCounterBuffers:" << mResources.MaxTessControlAtomicCounterBuffers
<< ":MaxTessPatchComponents:" << mResources.MaxTessPatchComponents
<< ":MaxPatchVertices:" << mResources.MaxPatchVertices
<< ":MaxTessGenLevel:" << mResources.MaxTessGenLevel
<< ":MaxTessEvaluationInputComponents:" << mResources.MaxTessEvaluationInputComponents
<< ":MaxTessEvaluationOutputComponents:" << mResources.MaxTessEvaluationOutputComponents
<< ":MaxTessEvaluationTextureImageUnits:" << mResources.MaxTessEvaluationTextureImageUnits
<< ":MaxTessEvaluationUniformComponents:" << mResources.MaxTessEvaluationUniformComponents
<< ":MaxTessEvaluationImageUniforms:" << mResources.MaxTessEvaluationImageUniforms
<< ":MaxTessEvaluationAtomicCounters:" << mResources.MaxTessEvaluationAtomicCounters
<< ":MaxTessEvaluationAtomicCounterBuffers:" << mResources.MaxTessEvaluationAtomicCounterBuffers;
// clang-format on
mBuiltInResourcesString = strstream.str();
@ -1141,12 +1236,10 @@ void TCompiler::setResourceString()
void TCompiler::collectInterfaceBlocks()
{
ASSERT(mInterfaceBlocks.empty());
mInterfaceBlocks.reserve(mUniformBlocks.size() + mShaderStorageBlocks.size() +
mInBlocks.size());
mInterfaceBlocks.reserve(mUniformBlocks.size() + mShaderStorageBlocks.size());
mInterfaceBlocks.insert(mInterfaceBlocks.end(), mUniformBlocks.begin(), mUniformBlocks.end());
mInterfaceBlocks.insert(mInterfaceBlocks.end(), mShaderStorageBlocks.begin(),
mShaderStorageBlocks.end());
mInterfaceBlocks.insert(mInterfaceBlocks.end(), mInBlocks.begin(), mInBlocks.end());
}
bool TCompiler::emulatePrecisionIfNeeded(TIntermBlock *root,
@ -1186,7 +1279,6 @@ void TCompiler::clearResults()
mInterfaceBlocks.clear();
mUniformBlocks.clear();
mShaderStorageBlocks.clear();
mInBlocks.clear();
mVariablesCollected = false;
mGLPositionInitialized = false;
@ -1197,6 +1289,12 @@ void TCompiler::clearResults()
mGeometryShaderInvocations = 0;
mGeometryShaderMaxVertices = -1;
mTessControlShaderOutputVertices = 0;
mTessEvaluationShaderInputPrimitiveType = EtetUndefined;
mTessEvaluationShaderInputVertexSpacingType = EtetUndefined;
mTessEvaluationShaderInputOrderingType = EtetUndefined;
mTessEvaluationShaderInputPointType = EtetUndefined;
mBuiltInFunctionEmulator.cleanup();
mNameMap.clear();
@ -1234,7 +1332,7 @@ bool TCompiler::checkCallDepth()
int depth = 0;
const CallDAG::Record &record = mCallDag.getRecordFromIndex(i);
for (const int &calleeIndex : record.callees)
for (int calleeIndex : record.callees)
{
depth = std::max(depth, depths[calleeIndex] + 1);
}
@ -1398,11 +1496,9 @@ bool TCompiler::wereVariablesCollected() const
bool TCompiler::initializeGLPosition(TIntermBlock *root)
{
InitVariableList list;
sh::ShaderVariable var(GL_FLOAT_VEC4);
var.name = "gl_Position";
list.push_back(var);
return InitializeVariables(this, root, list, &mSymbolTable, mShaderVersion, mExtensionBehavior,
return InitializeVariables(this, root, {var}, &mSymbolTable, mShaderVersion, mExtensionBehavior,
false, false);
}
@ -1425,6 +1521,7 @@ bool TCompiler::useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root)
bool TCompiler::initializeOutputVariables(TIntermBlock *root)
{
InitVariableList list;
list.reserve(mOutputVaryings.size());
if (mShaderType == GL_VERTEX_SHADER || mShaderType == GL_GEOMETRY_SHADER_EXT)
{
for (const sh::ShaderVariable &var : mOutputVaryings)
@ -1481,7 +1578,7 @@ const BuiltInFunctionEmulator &TCompiler::getBuiltInFunctionEmulator() const
void TCompiler::writePragma(ShCompileOptions compileOptions)
{
if (!(compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL))
if ((compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL) == 0)
{
TInfoSinkBase &sink = mInfoSink.obj;
if (mPragma.stdgl.invariantAll)
@ -1539,12 +1636,12 @@ void EmitMultiviewGLSL(const TCompiler &compiler,
return;
const bool isVertexShader = (compiler.getShaderType() == GL_VERTEX_SHADER);
if (compileOptions & SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW)
if ((compileOptions & SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW) != 0)
{
// Emit ARB_shader_viewport_layer_array/NV_viewport_array2 in a vertex shader if the
// SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER option is set and the
// OVR_multiview(2) extension is requested.
if (isVertexShader && (compileOptions & SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER))
if (isVertexShader && (compileOptions & SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER) != 0)
{
sink << "#if defined(GL_ARB_shader_viewport_layer_array)\n"
<< "#extension GL_ARB_shader_viewport_layer_array : require\n"

Просмотреть файл

@ -16,6 +16,7 @@
#include <GLSLANG/ShaderVars.h>
#include "common/PackedEnums.h"
#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/CallDAG.h"
#include "compiler/translator/Diagnostics.h"
@ -36,6 +37,8 @@ class TParseContext;
class TranslatorHLSL;
#endif // ANGLE_ENABLE_HLSL
using SpecConstUsageBits = angle::PackedEnumBitSet<vk::SpecConstUsage, uint32_t>;
//
// Helper function to check if the shader type is GLSL.
//
@ -100,6 +103,7 @@ class TCompiler : public TShHandleBase
bool isEarlyFragmentTestsSpecified() const { return mEarlyFragmentTestsSpecified; }
bool isEarlyFragmentTestsOptimized() const { return mEarlyFragmentTestsOptimized; }
SpecConstUsageBits getSpecConstUsageBits() const { return mSpecConstUsageBits; }
bool isComputeShaderLocalSizeDeclared() const { return mComputeShaderLocalSizeDeclared; }
const sh::WorkGroupSize &getComputeShaderLocalSize() const { return mComputeShaderLocalSize; }
@ -119,7 +123,6 @@ class TCompiler : public TShHandleBase
{
return mShaderStorageBlocks;
}
const std::vector<sh::InterfaceBlock> &getInBlocks() const { return mInBlocks; }
ShHashFunction64 getHashFunction() const { return mResources.HashFunction; }
NameMap &getNameMap() { return mNameMap; }
@ -145,6 +148,25 @@ class TCompiler : public TShHandleBase
}
unsigned int getStructSize(const ShaderVariable &var) const;
int getTessControlShaderOutputVertices() const { return mTessControlShaderOutputVertices; }
TLayoutTessEvaluationType getTessEvaluationShaderInputPrimitiveType() const
{
return mTessEvaluationShaderInputPrimitiveType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputVertexSpacingType() const
{
return mTessEvaluationShaderInputVertexSpacingType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputOrderingType() const
{
return mTessEvaluationShaderInputOrderingType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputPointType() const
{
return mTessEvaluationShaderInputPointType;
}
unsigned int getSharedMemorySize() const;
sh::GLenum getShaderType() const { return mShaderType; }
@ -191,7 +213,12 @@ class TCompiler : public TShHandleBase
std::vector<sh::InterfaceBlock> mInterfaceBlocks;
std::vector<sh::InterfaceBlock> mUniformBlocks;
std::vector<sh::InterfaceBlock> mShaderStorageBlocks;
std::vector<sh::InterfaceBlock> mInBlocks;
// Track what should be validated given passes currently applied.
ValidateASTOptions mValidateASTOptions;
// Specialization constant usage bits
SpecConstUsageBits mSpecConstUsageBits;
private:
// Initialize symbol-table with built-in symbols.
@ -294,14 +321,18 @@ class TCompiler : public TShHandleBase
TLayoutPrimitiveType mGeometryShaderInputPrimitiveType;
TLayoutPrimitiveType mGeometryShaderOutputPrimitiveType;
// tesssellation shader parameters
int mTessControlShaderOutputVertices;
TLayoutTessEvaluationType mTessEvaluationShaderInputPrimitiveType;
TLayoutTessEvaluationType mTessEvaluationShaderInputVertexSpacingType;
TLayoutTessEvaluationType mTessEvaluationShaderInputOrderingType;
TLayoutTessEvaluationType mTessEvaluationShaderInputPointType;
// name hashing.
NameMap mNameMap;
TPragma mPragma;
// Track what should be validated given passes currently applied.
ValidateASTOptions mValidateASTOptions;
ShCompileOptions mCompileOptions;
};

Просмотреть файл

@ -167,12 +167,40 @@ void TDirectiveHandler::handleExtension(const angle::pp::SourceLocation &loc,
// OVR_multiview is implicitly enabled when OVR_multiview2 is enabled
if (name == "GL_OVR_multiview2")
{
const std::string multiview = "GL_OVR_multiview";
TExtensionBehavior::iterator iterMultiview =
mExtensionBehavior.find(GetExtensionByName(multiview.c_str()));
if (iterMultiview != mExtensionBehavior.end())
constexpr char kMultiviewExtName[] = "GL_OVR_multiview";
iter = mExtensionBehavior.find(GetExtensionByName(kMultiviewExtName));
if (iter != mExtensionBehavior.end())
{
iterMultiview->second = behaviorVal;
iter->second = behaviorVal;
}
}
// EXT_shader_io_blocks is implicitly enabled when EXT_geometry_shader or
// EXT_tessellation_shader is enabled.
if (name == "GL_EXT_geometry_shader" || name == "GL_EXT_tessellation_shader")
{
constexpr char kIOBlocksExtName[] = "GL_EXT_shader_io_blocks";
iter = mExtensionBehavior.find(GetExtensionByName(kIOBlocksExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
}
// GL_APPLE_clip_distance is implicitly enabled when GL_EXT_clip_cull_distance is enabled
else if (name == "GL_EXT_clip_cull_distance")
{
// This extension only can be enabled on greater than ESSL 300
if (mShaderVersion < 300)
{
mDiagnostics.error(loc, "extension can be enabled on greater than ESSL 300",
name.c_str());
return;
}
constexpr char kAPPLEClipDistanceEXTName[] = "GL_APPLE_clip_distance";
iter = mExtensionBehavior.find(GetExtensionByName(kAPPLEClipDistanceEXTName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
}
return;
@ -198,7 +226,8 @@ void TDirectiveHandler::handleVersion(const angle::pp::SourceLocation &loc,
int version,
ShShaderSpec spec)
{
if (((version == 100 || version == 300 || version == 310) && !IsDesktopGLSpec(spec)) ||
if (((version == 100 || version == 300 || version == 310 || version == 320) &&
!IsDesktopGLSpec(spec)) ||
IsDesktopGLSpec(spec))
{
mShaderVersion = version;

Просмотреть файл

@ -20,14 +20,19 @@
OP(ARB_texture_rectangle) \
OP(ARM_shader_framebuffer_fetch) \
OP(EXT_blend_func_extended) \
OP(EXT_clip_cull_distance) \
OP(EXT_draw_buffers) \
OP(EXT_frag_depth) \
OP(EXT_geometry_shader) \
OP(OES_shader_io_blocks) \
OP(EXT_shader_io_blocks) \
OP(EXT_gpu_shader5) \
OP(EXT_shader_framebuffer_fetch) \
OP(EXT_shader_framebuffer_fetch_non_coherent) \
OP(EXT_shader_non_constant_global_initializers) \
OP(EXT_shader_texture_lod) \
OP(EXT_shadow_samplers) \
OP(EXT_tessellation_shader) \
OP(EXT_texture_buffer) \
OP(EXT_texture_cube_map_array) \
OP(EXT_YUV_target) \
@ -36,6 +41,7 @@
OP(NV_shader_noperspective_interpolation) \
OP(OES_EGL_image_external) \
OP(OES_EGL_image_external_essl3) \
OP(OES_sample_variables) \
OP(OES_shader_multisample_interpolation) \
OP(OES_shader_image_atomic) \
OP(OES_standard_derivatives) \

Просмотреть файл

@ -26,14 +26,19 @@ enum class TExtension : uint8_t
ARB_texture_rectangle,
ARM_shader_framebuffer_fetch,
EXT_blend_func_extended,
EXT_clip_cull_distance,
EXT_draw_buffers,
EXT_frag_depth,
EXT_geometry_shader,
OES_shader_io_blocks,
EXT_shader_io_blocks,
EXT_gpu_shader5,
EXT_shader_framebuffer_fetch,
EXT_shader_framebuffer_fetch_non_coherent,
EXT_shader_non_constant_global_initializers,
EXT_shader_texture_lod,
EXT_shadow_samplers,
EXT_tessellation_shader,
EXT_texture_buffer,
EXT_texture_cube_map_array,
EXT_YUV_target,
@ -42,6 +47,7 @@ enum class TExtension : uint8_t
NV_shader_noperspective_interpolation,
OES_EGL_image_external,
OES_EGL_image_external_essl3,
OES_sample_variables,
OES_shader_multisample_interpolation,
OES_shader_image_atomic,
OES_standard_derivatives,

Просмотреть файл

@ -69,7 +69,7 @@ ImmutableString HashName(const ImmutableString &name,
// have as long names and could conflict.
return name;
}
if (name == "gl_ClipDistance")
if (name == "gl_ClipDistance" || name == "gl_CullDistance" || name == "gl_LastFragData")
{
// NOTE(hqle): When gl_ClipDistance is re-declared, it will become an UserDefined
// symbol. Normally, UserDefined symbols will have "_u" prefix added to their names by
@ -81,7 +81,7 @@ ImmutableString HashName(const ImmutableString &name,
// re-declaration occurs. AngleInternal symbols will have their name intact. However,
// the issue is that the current code put a lot of restrictions on AngleInternal
// symbols. For examples:
// - CollectVariables.cpp will not consider AngleInternal as varying output variales.
// - CollectVariables.cpp will not consider AngleInternal as varying output variables.
// - SymbolTable.cpp will throw an exception if AngleInternal symbols are declared by
// users. In this case, it would be gl_ClipDistance. This is because
// TSymbolTable::declare() only accepts an UserDefined symbol.
@ -96,6 +96,8 @@ ImmutableString HashName(const ImmutableString &name,
// Compare to only this place has to be handled if re-declared gl_ClipDistance is
// treated as an UserDefined symbol.
//
// Also, gl_LastFragData should be added.
//
return name;
}
ImmutableStringBuilder prefixedName(kUnhashedNamePrefix.length() + name.length());

Просмотреть файл

@ -2,7 +2,7 @@
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
// builtin_function_declarations.txt.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// 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.
//
@ -26,222 +26,216 @@ std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
namespace
{
constexpr int mangledkT1[] = {2734, 3205, 2084, 1788, 3161, 2931, 522, 1310, 3219, 312,
846, 1760, 2276, 1722, 1120, 2959, 635, 824, 165, 3043,
2565, 2264, 746, 617, 2636, 2543, 1826, 416, 714, 2484,
543, 804, 1480, 2234, 2318, 216, 904};
constexpr int mangledkT2[] = {851, 1107, 1845, 815, 2730, 2221, 609, 1079, 544, 822,
273, 3003, 1431, 2738, 2683, 447, 2771, 193, 3093, 2494,
3167, 1523, 698, 2773, 2875, 1068, 2229, 694, 2203, 235,
3100, 3190, 320, 3137, 784, 3099, 3224};
constexpr int mangledkT1[] = {1180, 782, 1103, 563, 2974, 1464, 855, 2226, 533, 946,
2364, 1527, 2823, 1963, 1949, 406, 1029, 185, 2724, 2797,
2341, 264, 1903, 2150, 3196, 1935, 1186, 1337, 65, 194,
557, 2982, 1963, 2229, 2382, 1040, 776, 2536, 2699, 2002};
constexpr int mangledkT2[] = {243, 2806, 2646, 900, 1556, 238, 1079, 2379, 1830, 1969,
1294, 2251, 438, 1259, 2530, 476, 2188, 2765, 253, 197,
3034, 1339, 1962, 2836, 1405, 1808, 2356, 1708, 1616, 2555,
2384, 835, 1185, 1976, 1471, 1429, 2833, 3097, 1699, 752};
constexpr int mangledkG[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2220, 0, 0, 0, 0, 0, 0, 1500, 0, 0, 0, 1490, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 3061, 0, 0, 0, 0, 0, 0, 2799,
0, 0, 0, 0, 2903, 0, 0, 0, 915, 0, 1508, 0, 0, 0, 0, 1952,
463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2133, 1276, 0,
0, 0, 0, 0, 0, 921, 1132, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2153, 0, 2232, 0, 0, 3143, 0, 775, 0,
0, 1897, 0, 2153, 670, 0, 0, 0, 0, 0, 256, 1445, 0, 0, 1586, 0,
0, 0, 1585, 3175, 0, 0, 0, 0, 366, 0, 2016, 0, 1506, 0, 215, 0,
0, 0, 0, 0, 0, 299, 0, 1534, 0, 1656, 0, 120, 0, 0, 821, 0,
0, 0, 0, 0, 1925, 0, 0, 0, 0, 0, 0, 0, 0, 1629, 3041, 0,
0, 0, 2949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 2871, 0, 0, 0, 0, 0, 0, 139, 0, 0, 0, 0, 0, 610,
142, 0, 2263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
766, 0, 2602, 436, 716, 0, 1932, 3003, 1221, 0, 0, 2847, 0, 975, 0, 675,
0, 0, 0, 0, 0, 0, 0, 0, 904, 0, 1211, 0, 0, 0, 303, 0,
993, 1316, 0, 1954, 0, 0, 0, 0, 0, 0, 1824, 0, 0, 3, 0, 0,
800, 0, 0, 0, 0, 0, 0, 162, 576, 0, 0, 1173, 808, 0, 0, 0,
0, 0, 0, 0, 520, 529, 0, 818, 0, 0, 0, 0, 96, 485, 0, 757,
0, 2614, 0, 0, 1096, 0, 0, 0, 0, 0, 1533, 0, 3259, 0, 0, 1381,
3226, 0, 53, 0, 0, 0, 1810, 0, 0, 0, 0, 0, 1537, 0, 0, 0,
0, 561, 0, 0, 2413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1673, 0,
0, 2868, 2328, 0, 564, 0, 114, 0, 0, 326, 2334, 0, 1432, 0, 871, 0,
714, 0, 873, 0, 1419, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 1188,
0, 0, 0, 647, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1870, 0, 0, 0, 2946, 0, 814, 579, 0, 0, 0, 2392,
31, 0, 2796, 0, 225, 0, 0, 548, 940, 200, 3063, 0, 2953, 0, 0, 0,
0, 229, 0, 127, 0, 0, 0, 0, 0, 2899, 0, 612, 0, 0, 1964, 0,
1223, 0, 0, 427, 0, 1881, 2511, 3195, 0, 0, 2920, 0, 0, 1159, 0, 0,
0, 0, 0, 1355, 1182, 0, 574, 0, 525, 0, 0, 0, 0, 0, 2958, 1711,
0, 0, 0, 0, 0, 3067, 0, 0, 2757, 1415, 0, 2287, 708, 0, 1186, 0,
0, 0, 667, 0, 0, 0, 1152, 2362, 0, 0, 1678, 0, 630, 1810, 0, 0,
3046, 0, 0, 0, 0, 2067, 725, 0, 0, 0, 2605, 0, 0, 2, 0, 504,
0, 0, 0, 0, 1176, 335, 0, 215, 921, 851, 671, 2963, 0, 0, 44, 2700,
0, 0, 0, 941, 0, 1980, 867, 0, 0, 0, 0, 895, 0, 0, 0, 0,
0, 375, 0, 0, 2831, 0, 0, 0, 0, 3245, 2317, 922, 0, 0, 0, 859,
645, 0, 0, 0, 0, 0, 523, 0, 0, 2041, 0, 0, 0, 2825, 2797, 0,
0, 17, 0, 0, 0, 981, 1412, 0, 397, 1314, 873, 0, 1099, 0, 0, 2191,
0, 0, 0, 2123, 136, 1329, 0, 0, 0, 0, 0, 0, 0, 0, 816, 0,
1634, 0, 0, 559, 202, 0, 0, 0, 1691, 0, 1017, 1199, 0, 1357, 0, 0,
2926, 254, 3299, 1945, 928, 0, 0, 0, 0, 0, 1769, 0, 0, 0, 0, 0,
1444, 0, 0, 0, 0, 680, 0, 0, 0, 3160, 0, 0, 0, 0, 720, 0,
0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 1908, 3064,
356, 0, 0, 0, 0, 0, 395, 0, 0, 0, 0, 772, 0, 0, 0, 0,
0, 310, 0, 0, 0, 0, 3133, 0, 1475, 0, 0, 0, 0, 0, 0, 0,
278, 0, 0, 0, 1517, 0, 1085, 0, 336, 3208, 0, 0, 0, 0, 1151, 0,
672, 2958, 439, 3079, 1783, 0, 2512, 0, 0, 371, 0, 0, 0, 0, 124, 0,
733, 0, 772, 1020, 3046, 0, 0, 407, 0, 20, 0, 361, 2698, 0, 0, 246,
1393, 175, 658, 0, 0, 0, 583, 2931, 839, 850, 1292, 0, 0, 0, 0, 342,
0, 0, 3209, 275, 49, 0, 1475, 67, 2326, 0, 357, 1135, 799, 0, 1939, 0,
0, 0, 0, 1108, 0, 0, 0, 660, 0, 1839, 0, 0, 113, 12, 0, 685,
629, 0, 330, 0, 0, 700, 0, 0, 0, 1273, 65, 0, 835, 0, 0, 520,
0, 0, 0, 0, 0, 0, 65, 0, 322, 686, 0, 1406, 0, 0, 2015, 0,
0, 3051, 0, 1698, 2186, 0, 3098, 0, 0, 302, 3003, 0, 0, 0, 236, 0,
0, 0, 380, 0, 198, 0, 396, 0, 0, 0, 825, 0, 1272, 0, 0, 0,
689, 1879, 0, 2524, 0, 142, 0, 1181, 0, 0, 2336, 0, 0, 3240, 2739, 0,
2878, 0, 0, 747, 0, 0, 2777, 0, 1040, 0, 0, 3054, 0, 0, 0, 346,
0, 0, 957, 0, 0, 0, 418, 0, 0, 0, 127, 0, 0, 0, 0, 1889,
259, 0, 619, 643, 440, 0, 737, 3064, 0, 1746, 1507, 0, 0, 407, 2421, 0,
1353, 3085, 721, 0, 0, 514, 0, 1617, 929, 598, 0, 944, 0, 0, 0, 1401,
0, 0, 1929, 0, 0, 3206, 0, 0, 2882, 0, 0, 3254, 2691, 0, 92, 742,
0, 0, 0, 2333, 0, 0, 0, 0, 0, 665, 2720, 0, 392, 2568, 0, 0,
0, 2053, 57, 0, 418, 854, 0, 143, 1437, 498, 0, 0, 547, 0, 121, 0,
0, 0, 0, 0, 150, 0, 0, 1261, 0, 0, 395, 0, 2592, 0, 0, 0,
629, 0, 0, 0, 528, 0, 1717, 2226, 1817, 0, 1772, 795, 836, 1093, 388, 2462,
0, 2877, 2852, 1994, 647, 2210, 2646, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1120, 0, 0, 2592, 2766, 2901, 0, 383, 0, 0, 0, 2199, 2653, 0, 0, 0,
0, 0, 0, 1742, 0, 0, 0, 0, 0, 831, 868, 0, 0, 0, 40, 943,
169, 0, 2929, 2038, 0, 0, 658, 0, 0, 0, 0, 1013, 0, 0, 17, 872,
782, 727, 0, 0, 0, 2617, 426, 0, 0, 2833, 2460, 0, 546, 0, 0, 125,
0, 1026, 0, 2107, 1204, 1055, 0, 0, 0, 0, 867, 1592, 0, 2720, 187, 0,
0, 2817, 2641, 0, 1549, 0, 1871, 0, 2049, 0, 1118, 2829, 911, 2599, 1543, 0,
0, 1552, 0, 1311, 1372, 1098, 0, 0, 611, 0, 1770, 1626, 731, 0, 2470, 2241,
73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1180, 0, 41, 0, 0, 0,
0, 1407, 559, 0, 0, 3017, 1347, 0, 201, 0, 0, 269, 3079, 3160, 707, 89,
1442, 0, 486, 1369, 2711, 865, 2936, 0, 1101, 2153, 0, 0, 734, 925, 0, 1903,
0, 0, 279, 0, 1013, 0, 0, 0, 112, 0, 0, 0, 0, 0, 530, 2499,
789, 857, 560, 0, 0, 1295, 285, 1256, 0, 0, 2971, 218, 233, 0, 955, 363,
1292, 600, 0, 0, 1910, 0, 0, 0, 0, 333, 2408, 0, 0, 0, 934, 1296,
0, 0, 2400, 838, 2330, 0, 0, 668, 1797, 901, 0, 0, 517, 0, 0, 0,
1197, 583, 3147, 2068, 2510, 1252, 0, 0, 0, 0, 0, 250, 1981, 1739, 0, 2012,
0, 0, 0, 0, 0, 0, 2693, 0, 0, 469, 0, 0, 0, 0, 2774, 0,
0, 838, 0, 982, 409, 0, 0, 528, 0, 0, 0, 911, 0, 0, 2771, 1431,
0, 0, 362, 0, 623, 0, 0, 0, 0, 0, 0, 0, 3266, 1063, 0, 0,
708, 0, 670, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 768,
0, 0, 361, 0, 0, 0, 3262, 2995, 860, 56, 2932, 0, 149, 0, 0, 75,
1524, 1486, 1249, 500, 0, 136, 174, 660, 0, 961, 0, 0, 0, 0, 2607, 127,
0, 0, 0, 495, 0, 0, 0, 1084, 0, 0, 2521, 1342, 0, 0, 1237, 166,
0, 0, 0, 2668, 715, 401, 619, 0, 763, 0, 1364, 1499, 0, 0, 0, 1190,
0, 2195, 3049, 281, 0, 242, 721, 226, 286, 282, 2820, 0, 0, 0, 510, 2447,
313, 2557, 350, 0, 0, 2913, 0, 182, 160, 2824, 284, 0, 0, 1296, 0, 0,
686, 0, 0, 520, 926, 0, 770, 1525, 0, 2836, 2052, 0, 0, 3021, 483, 0,
1432, 0, 2986, 0, 0, 783, 1500, 317, 0, 752, 0, 0, 2465, 0, 0, 0,
2980, 0, 146, 0, 0, 0, 851, 0, 0, 0, 0, 0, 0, 1404, 0, 0,
2674, 459, 0, 2687, 2302, 3204, 0, 0, 0, 0, 3099, 3015, 462, 0, 2763, 0,
2671, 0, 1842, 0, 0, 1270, 713, 88, 524, 23, 0, 1638, 2307, 1462, 1058, 1771,
84, 0, 2392, 0, 0, 0, 0, 0, 1258, 0, 1864, 1049, 983, 0, 0, 1156,
848, 0, 1739, 0, 1562, 0, 0, 1228, 153, 0, 122, 853, 0, 579, 0, 0,
0, 0, 781, 0, 777, 965, 354, 278, 557, 0, 2486, 0, 898, 0, 392, 948,
1039, 1008, 0, 0, 2001, 0, 869, 0, 930, 0, 0, 0, 0, 0, 0, 0,
2895, 0, 775, 0, 3186, 0, 2204, 863, 835, 0, 0, 749, 0, 0, 482, 3132,
0, 0, 0, 2905, 0, 1860, 907, 1417, 3257, 1426, 0, 0, 1955, 1949, 1036, 0,
0, 3272, 2532, 0, 273, 0, 2579, 0, 0, 0, 0, 39, 2138, 198, 2816, 0,
271, 0, 0, 3193, 929, 786, 3266, 0, 1423, 0, 1011, 0, 0, 0, 1902, 0,
139, 2634, 0, 0, 2904, 1750, 3280, 0, 0, 1150, 0, 0, 0, 0, 326, 0,
977, 0, 2022, 331, 147, 1519, 0, 3166, 0, 2976, 1409, 834, 0, 0, 669, 1344,
0, 960, 0, 220, 2351, 0, 0, 1077, 0, 0, 588, 0, 0, 0, 1531, 62,
0, 2540, 672, 0, 0, 1357, 789, 0, 0, 0, 2713, 588, 375, 1044, 2439, 828,
1134, 111, 2289, 0, 1904, 3132, 0, 831, 492, 1493, 830, 1659, 101, 792, 2310, 0,
2507, 1399, 0, 3068, 0, 935, 2461, 992, 0, 0, 324, 113, 0, 0, 178, 0,
1262, 0, 1417, 0, 0, 1401, 209, 435, 1222, 1254, 0, 2642, 1198, 36, 2308, 1515,
601, 0, 1802, 160, 318, 1953, 0, 596, 0, 0, 0, 665, 0, 3147, 1442, 1167,
3003, 0, 942, 0, 860, 0, 0, 928, 0, 1280, 978, 753, 0, 0, 1086, 2673,
2500, 774, 0, 0, 840, 0, 0, 885, 1326, 0, 0, 0, 0, 1210, 875, 2798,
0, 0, 11, 3016, 86, 0, 223, 1204, 0, 3219, 0, 0, 683, 906, 2296, 2981,
0, 837, 0, 956, 2920, 0, 0, 2561, 1333, 2340, 95, 0, 649, 2945, 0, 0,
1092, 0, 0, 745, 163, 2487, 0, 1045, 0, 2817, 0, 2118, 1340, 0, 1540, 0,
3281, 600, 648, 2869, 0, 3112, 0, 880, 1297, 0, 0, 2980, 277, 0, 0, 0,
88, 217, 1160, 0, 953, 886, 0, 1116, 0, 2340, 0, 1264, 0, 38, 2048, 1247,
105, 0, 276, 465, 0, 2140, 0, 1638, 3227, 0, 1100, 0, 0, 0, 1120, 2650,
0, 1304, 1394, 1183, 0, 0, 1411, 610, 0, 3166, 2865, 0, 173, 0, 0, 879,
645, 0, 70, 0, 52, 2561, 0, 0, 365, 0, 1060, 0, 86, 0, 330, 0,
0, 0, 433, 407, 38, 0, 2968, 639, 0, 0, 0, 497, 773, 0, 0, 243,
0, 466, 522, 0, 1434, 321, 772, 0, 890, 1398, 0, 0, 1226, 1151, 0, 0,
340, 0, 3152, 453, 526, 0, 2673, 1668, 0, 0, 0, 0, 0, 0, 1144, 433,
533, 3044, 1075, 0, 449, 2086, 657, 0, 581, 0, 0, 0, 2933, 2651, 361, 3030,
0, 0, 201, 0, 1305, 0, 0, 1162, 1195, 1613, 0, 0, 1660, 2533, 2556, 0,
0, 0, 0, 0, 666, 578, 1132, 0, 1006, 165, 1256, 298, 123, 2218, 0, 0,
0, 3049, 0, 973, 0, 953, 2275, 781, 0, 0, 0, 0, 0, 364, 0, 2150,
323, 0, 0, 0, 904, 2266, 2603, 2568, 909, 0, 2955, 438, 483, 0, 0, 760,
1359, 372, 3127, 0, 0, 0, 590, 1112, 219, 0, 1223, 162, 0, 1501, 0, 584,
2319, 0, 0, 1841, 411, 159, 697, 0, 1866, 1546, 0, 0, 407, 94, 2064, 0,
969, 0, 2392, 2754, 1420, 2441, 3133, 1385, 652, 738, 2915, 3225, 1242, 0, 1777, 1899,
0, 0, 0, 2900, 0, 0, 243, 711, 820, 0, 0, 0, 0, 1438, 1797, 692,
1354, 0, 0, 1631, 0, 1738, 2882, 473, 0, 677, 42, 250, 0, 674, 0, 0,
96, 0, 712, 0, 0, 399, 1814, 805, 65, 681, 0, 0, 0, 312, 2194, 223,
0, 1318, 1458, 311, 0, 1197, 990, 1422, 802, 0, 180, 917, 0, 0, 0, 259,
0, 1911, 0, 1118, 0, 1067, 1283, 0, 0, 0, 815, 2366, 1093, 0, 2823, 286,
0, 0, 0, 0, 471, 0, 0, 803, 503, 66, 0, 1390, 370, 0, 1241, 19,
0, 1186, 133, 0, 2137, 0, 0, 481, 0, 0, 662, 2804, 2502, 690, 0, 0,
0, 0, 0, 0, 0, 1129, 1533, 0, 0, 572, 443, 843, 556, 651, 0, 0,
240, 0, 103, 467, 1225, 780, 2047, 1245, 1096, 989, 2629, 626, 0, 0, 1897, 0,
339, 2523, 885, 274, 0, 2042, 0, 3152, 0, 2551, 718, 1301, 1561, 3035, 0, 0,
3023, 0, 0, 3290, 719, 0, 1142, 0, 1186, 1334, 733, 0, 0, 0, 1121, 1311,
0, 338, 2196, 0, 2956, 1485, 1320, 2980, 594, 0, 1421, 0, 1260, 925, 278, 0,
0, 0, 0, 0, 2729, 0, 0, 0, 332, 1473, 1925, 230, 438, 515, 2478, 0,
0, 810, 0, 796, 2985, 393, 1135, 0, 412, 0, 575, 287, 0, 0, 0, 2694,
0, 0, 0, 334, 466, 1405, 0, 0, 707, 0, 0, 0, 2358, 0, 3096, 0,
877, 0, 1442, 1041, 102, 2544, 2609, 0, 696, 0, 790, 740, 0, 0, 154, 0,
1117, 0, 0, 0, 50, 0, 2195, 97, 0, 959, 0, 0, 2126, 277, 0, 1371,
0, 2996, 0, 1164, 1419, 404, 326, 3238, 539, 0, 0, 33, 0, 74, 708, 2305,
0, 0, 2829, 529, 0, 1286, 103, 320, 0, 0, 1241, 0, 0, 0, 2060, 2724,
468, 0, 19, 99, 0, 0, 679, 2560, 0, 0, 0, 1583, 1169, 775, 0, 936,
1425, 152, 2188, 0, 1443, 949, 834, 0, 0, 810, 735, 2456, 2528, 1107, 0, 0,
128, 0, 337, 0, 881, 0, 3297, 0, 371, 716, 594, 0, 96, 0, 1508, 0,
0, 0, 0, 0, 2768, 0, 0, 572, 0, 1115, 0, 0, 23, 0, 0, 154,
224, 1249, 2703, 0, 0, 3270, 0, 1399, 0, 0, 453, 0, 690, 0, 3006, 0,
0, 1679, 0, 1070, 0, 0, 2209, 566, 0, 2841, 0, 2426, 1302, 0, 192, 1174,
963, 2696, 1459, 1367, 1560, 1579, 53, 1705, 0, 156, 0, 1378, 2547, 769, 0, 0,
1587, 0, 2936, 56, 605, 0, 0, 2022, 0, 351, 433, 0, 0, 0, 192, 0,
991, 0, 642, 708, 1837, 0, 0, 0, 2729, 577, 272, 2931, 749, 2765, 0, 607,
0, 3128, 264, 2373, 0, 0, 1536, 3275, 0, 0, 3110, 981, 0, 957, 0, 638,
0, 0, 0, 0, 0, 2793, 1916, 0, 2381, 2733, 1002, 1126, 0, 0, 0, 56,
2056, 165, 0, 734, 672, 0, 834, 1507, 0, 518, 2923, 0, 0, 1471, 0, 2104,
242, 53, 1349, 0, 571, 551, 0, 2565, 557, 1109, 0, 2970, 1297, 0, 1192, 1285,
2401, 813, 2793, 649, 0, 378, 726, 2164, 904, 2303, 0, 0, 760, 982, 1030, 0,
0, 640, 1161, 969, 0, 2998, 0, 0, 841, 158, 1813, 645, 0, 893, 2543, 853,
201, 0, 3063, 0, 15, 0, 702, 145, 1497, 225, 54, 287, 472, 0, 0, 0,
0, 552, 737, 0, 1969, 0, 3262, 0, 3229, 2462, 0, 1464, 0, 95, 1526, 0,
432, 5, 1067, 0, 302, 2892, 0, 1535, 401, 0, 1675, 0, 1213, 1250, 0, 3081,
3006, 222, 2055, 0, 0, 796, 0, 597, 863, 966, 542, 0, 0, 899, 962, 0,
3088, 0, 1173, 97, 415, 582, 0, 1250, 728, 0, 0, 0, 686, 299, 573, 2775,
0, 1771, 1614, 461, 0, 855, 0, 998, 1403, 238, 155, 0, 937, 2959, 0, 1023,
1139, 555, 0, 336, 1511, 0, 1006, 863, 3226, 655, 3006, 0, 980, 1177, 0, 2375,
0, 1554, 74, 1484, 1681, 0, 0, 863, 2363, 0, 0, 0, 3080, 518, 806, 0,
0, 0, 2800, 768, 355, 0, 3259, 930, 199, 2369, 1409, 0, 0, 0, 0, 1064,
0, 0, 914, 200, 424, 3295, 0, 0, 1706, 1456, 0, 0, 1275, 2952, 3050, 0,
0, 1147, 671, 0, 3107, 210, 519, 171, 1361, 0, 811, 0, 0, 0, 0, 882,
1124, 764, 0, 0, 307, 603, 1906, 120, 0, 0, 570, 0, 0, 862, 0, 0,
617, 0, 1962, 0, 1502, 0, 0, 0, 0, 0, 0, 2412, 1463, 809, 1015, 0,
0, 1145, 247, 0, 0, 0, 385, 232, 0, 2946, 0, 32, 0, 0, 445, 329,
866, 0, 0, 0, 3039, 0, 188, 168, 337, 695, 145, 0, 0, 0, 2319, 635,
856, 1185, 0, 1456, 0, 0, 0, 0, 1418, 0, 209, 901, 1352, 271, 0, 1215,
797, 763, 0, 0, 2686, 2690, 0, 0, 1575, 0, 0, 3012, 194, 2785, 1024, 73,
781, 960, 0, 1428, 1340, 0, 486, 0, 0, 0, 715, 0, 0, 3161, 1209, 0,
1008, 0, 1392, 1427, 0, 0, 0, 559, 2880, 0, 1100, 171, 0, 0, 379, 1327,
0, 0, 2403, 1153, 885, 423, 0, 0, 760, 28, 0, 0, 0, 0, 2055, 0,
282, 244, 0, 1509, 1154, 104, 0, 143, 490, 0, 0, 1021, 0, 931, 0, 153,
0, 34, 728, 0, 130, 2970, 0, 455, 593, 266, 613, 0, 96, 0, 1006, 1319,
1617, 359, 0, 0, 47, 226, 3079, 871, 0, 0, 0, 1144, 0, 2399, 51, 2104,
0, 0, 253, 0, 984, 315, 0, 2771, 0, 0, 115, 730, 0, 116, 0, 3166,
0, 0, 0, 746, 0, 784, 0, 0, 2489, 0, 1607, 0, 845, 0, 480, 789,
992, 1550, 1047, 2728, 1191, 1844, 0, 0, 0, 114, 2398, 0, 3113, 844, 2660, 0,
0, 3298, 0, 90, 2705, 1157, 845, 684, 1586, 0, 241, 0, 0, 3266, 0, 1557,
3056, 908, 2595, 488, 0, 0, 3062, 0, 6, 2633, 657, 2657, 0, 0, 1472, 0,
0, 0, 182, 0, 39, 2165, 2700, 2871, 710, 0, 3109, 183, 1341, 0, 0, 559,
1149, 0, 0, 0, 0, 373, 478, 1047, 0, 475, 1310, 463, 0, 0, 535, 0,
513, 2606, 288, 680, 0, 545, 0, 0, 1118, 417, 2946, 981, 305, 765, 0, 275,
0, 3272, 394, 0, 2216, 0, 1290, 0, 25, 0, 0, 0, 1287, 548, 0, 1200,
1119, 1572, 1638, 0, 2253, 0, 0, 2504, 608, 1342, 374, 0, 870, 0, 0, 765,
1057, 0, 0, 0, 760, 132, 1464, 0, 0, 2342, 0, 0, 0, 0, 1985, 0,
3125, 0, 1414, 0, 1037, 1094, 0, 1165, 97, 0, 1785, 2910, 1980, 2016, 135, 0,
1590, 242, 0, 827, 0, 185, 1573, 0, 0, 2752, 140, 2917, 0, 330, 2137, 0,
448, 0, 1915, 0, 0, 0, 1165, 831, 0, 1355, 0, 1579, 1108, 0, 0, 2038,
1290, 0, 1313, 1045};
0, 0, 0, 0, 0, 0, 0, 847, 1062, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1632, 2907, 0, 400, 938, 0, 0, 1116, 0, 922, 663, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1408, 0, 0, 0, 0, 0, 0, 0,
0, 2659, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0, 0, 2742, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2161, 0, 656, 0, 0, 0,
0, 0, 0, 0, 2567, 0, 1174, 1979, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 38, 1120, 0, 0, 0, 0, 2702, 1330, 1414, 381, 0,
0, 0, 1483, 0, 0, 2871, 0, 0, 0, 123, 0, 2565, 0, 0, 0, 1217,
312, 269, 0, 1357, 760, 0, 0, 0, 0, 2653, 0, 321, 0, 0, 0, 0,
0, 0, 3020, 0, 0, 0, 2585, 367, 0, 0, 0, 0, 0, 0, 0, 0,
1932, 0, 2090, 0, 0, 0, 0, 0, 188, 0, 0, 0, 47, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2935, 1013, 2352, 424,
0, 193, 570, 0, 0, 0, 0, 0, 66, 0, 0, 1811, 0, 2718, 0, 0,
1154, 0, 0, 33, 0, 2278, 0, 0, 0, 3156, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1071, 0, 1440, 0, 0, 2822, 0, 3116, 819, 576, 0, 1925, 0,
0, 0, 370, 2518, 1977, 1323, 0, 1991, 1123, 0, 0, 1835, 0, 780, 609, 0,
2709, 1441, 0, 1921, 2084, 0, 0, 0, 950, 3037, 0, 2011, 2476, 0, 0, 2009,
83, 0, 0, 0, 0, 0, 901, 0, 752, 0, 2786, 0, 0, 231, 1597, 0,
1303, 0, 2279, 0, 0, 0, 725, 0, 0, 495, 0, 0, 0, 0, 1552, 611,
0, 931, 0, 341, 0, 0, 0, 68, 2626, 0, 0, 1904, 0, 989, 0, 0,
0, 197, 0, 404, 737, 1583, 0, 3057, 0, 2403, 0, 0, 0, 0, 0, 0,
1356, 2560, 0, 2901, 533, 938, 363, 3092, 2901, 0, 3193, 0, 0, 354, 202, 0,
1248, 0, 457, 0, 0, 0, 0, 1223, 1217, 0, 0, 0, 1673, 0, 0, 0,
707, 0, 0, 1367, 0, 2737, 0, 0, 1103, 1064, 0, 1607, 0, 0, 0, 0,
1277, 0, 0, 0, 0, 885, 0, 1649, 0, 689, 3019, 0, 0, 0, 0, 236,
0, 1099, 972, 0, 305, 1626, 0, 2138, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 682, 1952, 1708, 0, 0, 0, 0, 0, 0, 879, 642, 0, 0, 0,
586, 2856, 0, 0, 1623, 0, 0, 0, 0, 0, 0, 0, 287, 399, 1796, 0,
0, 0, 0, 1120, 0, 610, 1122, 3035, 0, 1346, 1185, 0, 0, 0, 740, 0,
0, 144, 0, 0, 3017, 0, 0, 0, 3012, 2171, 1137, 1488, 2289, 0, 395, 0,
0, 0, 1012, 0, 426, 0, 0, 0, 0, 142, 663, 0, 1782, 772, 1585, 0,
0, 0, 0, 0, 3201, 547, 482, 0, 0, 740, 576, 0, 0, 0, 0, 1420,
0, 481, 0, 0, 0, 2613, 0, 2040, 0, 0, 0, 0, 0, 2850, 683, 0,
0, 0, 2562, 0, 2545, 0, 802, 0, 0, 1074, 0, 0, 0, 0, 0, 0,
0, 2994, 319, 0, 0, 2725, 323, 0, 0, 0, 0, 0, 0, 0, 2942, 0,
934, 0, 0, 0, 0, 0, 1508, 0, 0, 2146, 1074, 0, 2205, 0, 0, 2542,
0, 156, 0, 125, 0, 0, 0, 1723, 0, 0, 3007, 165, 236, 850, 0, 88,
0, 2584, 0, 1069, 0, 0, 2887, 0, 0, 0, 933, 420, 448, 641, 0, 0,
0, 797, 0, 0, 0, 0, 0, 789, 0, 886, 284, 0, 0, 2655, 3009, 0,
0, 2545, 2271, 2146, 626, 1496, 1350, 2318, 0, 2455, 0, 0, 0, 0, 0, 1033,
2556, 0, 1590, 0, 0, 0, 0, 1158, 3166, 0, 605, 960, 0, 0, 1220, 3107,
860, 0, 0, 2588, 0, 0, 2493, 2966, 0, 0, 313, 1351, 1944, 2018, 2300, 802,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 3010, 3186, 273, 694,
0, 1087, 3100, 676, 0, 0, 0, 0, 0, 967, 0, 264, 554, 2879, 0, 0,
769, 1774, 619, 646, 0, 0, 1414, 0, 0, 528, 0, 0, 0, 0, 0, 3197,
2588, 0, 0, 0, 160, 2111, 0, 0, 1752, 1520, 0, 0, 0, 0, 0, 0,
2716, 1011, 1403, 2238, 867, 0, 0, 0, 0, 616, 0, 0, 495, 0, 209, 182,
846, 2251, 54, 0, 1124, 0, 0, 445, 0, 3105, 1952, 0, 0, 0, 782, 0,
0, 0, 0, 0, 686, 1103, 3085, 0, 0, 1016, 992, 0, 151, 1358, 1410, 0,
0, 0, 0, 0, 3080, 2685, 2829, 0, 0, 0, 0, 604, 0, 2476, 0, 2564,
0, 0, 1964, 1284, 0, 1538, 0, 0, 1511, 2442, 0, 0, 129, 0, 0, 0,
145, 0, 2411, 0, 2015, 527, 316, 889, 0, 0, 0, 0, 0, 1272, 141, 2488,
0, 0, 0, 0, 1556, 184, 0, 0, 0, 0, 0, 1707, 134, 0, 1840, 0,
0, 869, 1061, 0, 811, 2766, 539, 0, 0, 2445, 0, 0, 0, 0, 708, 0,
0, 205, 1341, 0, 986, 0, 0, 2064, 0, 0, 0, 0, 850, 359, 0, 1914,
1185, 1121, 1411, 0, 0, 0, 0, 2389, 593, 213, 669, 510, 2437, 149, 685, 0,
0, 0, 2911, 0, 1224, 1067, 892, 0, 388, 1281, 505, 0, 1081, 216, 378, 0,
0, 134, 0, 322, 2508, 329, 2259, 0, 0, 1633, 3003, 6, 1405, 0, 0, 0,
0, 0, 80, 374, 85, 0, 3192, 0, 447, 0, 0, 0, 701, 1489, 0, 2020,
0, 2989, 1950, 3143, 2769, 1053, 0, 0, 2726, 0, 327, 0, 1071, 0, 532, 1860,
0, 0, 982, 1831, 2858, 674, 0, 0, 262, 0, 0, 217, 0, 0, 622, 691,
990, 0, 0, 0, 50, 334, 1890, 2667, 0, 0, 0, 0, 1452, 13, 0, 1785,
0, 0, 445, 0, 248, 2909, 421, 0, 0, 2909, 0, 2245, 0, 0, 1016, 0,
0, 0, 0, 223, 3178, 0, 0, 541, 0, 0, 2679, 0, 0, 0, 0, 1620,
0, 0, 2898, 475, 0, 2146, 1126, 3107, 0, 129, 0, 1634, 1733, 1074, 1158, 0,
0, 0, 785, 0, 585, 364, 0, 0, 0, 262, 807, 0, 1728, 0, 0, 1599,
0, 192, 793, 0, 0, 448, 506, 0, 0, 0, 0, 3002, 1950, 0, 0, 200,
0, 0, 886, 183, 2792, 0, 303, 0, 2898, 3034, 2175, 0, 953, 0, 0, 0,
2874, 2662, 0, 0, 469, 263, 0, 0, 1339, 374, 0, 585, 798, 0, 1028, 0,
0, 0, 0, 0, 0, 0, 551, 2769, 0, 0, 0, 2384, 2320, 0, 332, 0,
0, 0, 0, 0, 0, 0, 0, 593, 0, 0, 186, 210, 1350, 3113, 0, 63,
402, 1159, 708, 0, 107, 0, 0, 0, 777, 2343, 0, 117, 2046, 2923, 2434, 2458,
0, 738, 2690, 0, 0, 0, 2608, 0, 836, 524, 845, 0, 0, 0, 62, 0,
0, 1842, 1557, 775, 178, 0, 0, 0, 0, 27, 0, 0, 0, 174, 2027, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 481, 0, 0, 0, 0, 1528,
0, 0, 1069, 844, 0, 1368, 0, 0, 0, 0, 0, 0, 160, 407, 0, 0,
0, 0, 0, 304, 77, 0, 1527, 0, 0, 0, 298, 0, 0, 0, 0, 2785,
0, 0, 0, 0, 2284, 0, 0, 1493, 0, 0, 0, 2511, 0, 0, 0, 1046,
792, 0, 0, 0, 1095, 278, 0, 0, 0, 1605, 697, 2981, 0, 572, 786, 422,
0, 0, 0, 770, 2488, 0, 460, 1500, 2460, 351, 0, 83, 0, 907, 681, 0,
1114, 462, 567, 0, 0, 0, 1136, 678, 0, 1131, 0, 0, 112, 0, 0, 0,
0, 0, 22, 0, 0, 482, 496, 0, 2643, 0, 444, 2532, 0, 2683, 958, 0,
1042, 0, 3099, 1311, 1111, 0, 1350, 810, 520, 1320, 0, 817, 1761, 0, 0, 2889,
685, 0, 965, 0, 1454, 0, 2781, 0, 3171, 0, 0, 2749, 0, 0, 0, 0,
0, 4, 0, 0, 229, 0, 0, 2418, 0, 870, 924, 1547, 0, 3193, 1187, 0,
1199, 0, 3205, 0, 350, 0, 0, 0, 54, 883, 0, 0, 0, 1859, 0, 1914,
2493, 863, 3183, 0, 1460, 0, 1283, 0, 0, 639, 0, 2154, 0, 0, 0, 0,
725, 0, 0, 0, 476, 0, 1306, 931, 0, 3133, 2670, 394, 740, 0, 0, 0,
0, 0, 0, 276, 0, 0, 0, 47, 0, 0, 2659, 1055, 0, 1378, 0, 0,
2304, 2876, 347, 928, 0, 416, 0, 0, 0, 1033, 0, 0, 0, 0, 0, 0,
683, 275, 0, 0, 626, 0, 362, 0, 0, 0, 0, 0, 2282, 0, 1260, 387,
0, 2260, 0, 0, 693, 0, 703, 0, 0, 0, 768, 1102, 0, 1579, 0, 1137,
0, 0, 0, 407, 0, 18, 1000, 0, 0, 2715, 709, 0, 0, 78, 0, 0,
0, 29, 2506, 0, 0, 0, 0, 426, 180, 0, 2420, 0, 0, 604, 2649, 0,
0, 0, 137, 0, 1223, 0, 560, 0, 0, 2797, 1225, 900, 0, 1694, 0, 0,
454, 584, 0, 0, 0, 0, 2280, 0, 0, 0, 0, 1765, 1352, 0, 0, 493,
0, 142, 0, 2635, 1495, 495, 1211, 471, 453, 1148, 580, 1580, 239, 1017, 373, 1536,
1949, 0, 63, 30, 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, 0, 0,
355, 1372, 250, 1563, 0, 414, 68, 2752, 1193, 0, 0, 794, 0, 102, 0, 2866,
1305, 0, 671, 525, 2971, 3020, 933, 0, 0, 1857, 737, 0, 1660, 0, 0, 2937,
0, 0, 0, 3034, 0, 462, 1325, 0, 0, 957, 0, 0, 539, 0, 0, 776,
279, 962, 671, 0, 2906, 299, 874, 0, 0, 1361, 0, 0, 426, 0, 2637, 0,
785, 2336, 1254, 663, 0, 2283, 140, 0, 605, 0, 0, 0, 11, 245, 1258, 0,
0, 839, 0, 245, 1054, 48, 2396, 3000, 93, 3041, 2984, 0, 2975, 0, 0, 0,
1374, 0, 1930, 0, 0, 0, 0, 2037, 1128, 2873, 499, 0, 0, 2052, 473, 0,
82, 554, 1336, 0, 0, 0, 2530, 2316, 1155, 0, 0, 549, 0, 591, 0, 21,
2280, 3011, 1071, 0, 1043, 0, 2308, 0, 0, 634, 0, 872, 269, 0, 0, 0,
174, 0, 0, 0, 133, 0, 0, 204, 1313, 115, 2534, 2169, 0, 1285, 25, 1213,
871, 0, 982, 0, 341, 1478, 1980, 2621, 0, 0, 1246, 408, 2072, 773, 0, 858,
298, 1299, 719, 0, 0, 735, 1142, 0, 36, 0, 21, 0, 1387, 0, 297, 0,
0, 326, 623, 1295, 595, 1394, 0, 0, 1626, 0, 2648, 0, 0, 1517, 783, 2036,
478, 2580, 624, 2506, 0, 631, 0, 0, 1596, 0, 1851, 0, 0, 838, 149, 894,
1544, 749, 152, 606, 0, 396, 2649, 1280, 0, 3120, 963, 716, 0, 0, 457, 1185,
227, 2150, 1130, 0, 0, 0, 5, 5, 0, 70, 1048, 770, 2997, 713, 2093, 0,
1015, 0, 0, 746, 0, 1144, 0, 449, 0, 430, 815, 312, 2555, 1230, 0, 0,
2205, 2182, 527, 1447, 3134, 866, 0, 0, 1774, 1150, 0, 1448, 0, 2, 1472, 464,
0, 2635, 0, 0, 0, 1033, 2789, 973, 1404, 2793, 906, 167, 0, 1165, 1164, 2927,
0, 1229, 0, 394, 1423, 0, 177, 2183, 0, 0, 1260, 211, 0, 0, 1240, 429,
0, 164, 948, 473, 3135, 0, 0, 1326, 0, 0, 1126, 0, 353, 1251, 0, 2417,
0, 1626, 0, 0, 18, 1449, 957, 262, 0, 2729, 0, 0, 0, 1398, 0, 0,
0, 0, 208, 1539, 0, 0, 0, 0, 938, 0, 0, 2614, 0, 104, 843, 0,
2677, 0, 1115, 0, 0, 186, 2456, 236, 8, 0, 110, 795, 0, 0, 0, 0,
0, 0, 0, 3126, 1492, 0, 558, 718, 813, 0, 0, 545, 668, 406, 1468, 526,
0, 0, 2977, 0, 1206, 749, 2023, 269, 961, 0, 952, 0, 1723, 0, 1330, 485,
1402, 0, 1098, 3055, 2116, 0, 494, 0, 0, 3115, 0, 71, 0, 0, 0, 0,
114, 345, 0, 0, 2829, 1036, 3108, 0, 407, 0, 506, 0, 0, 0, 1145, 550,
0, 766, 2420, 0, 1234, 87, 199, 3112, 0, 0, 51, 0, 3076, 0, 1263, 0,
433, 0, 1151, 0, 0, 3038, 2198, 0, 0, 0, 793, 880, 1119, 0, 0, 0,
561, 0, 0, 1024, 0, 455, 321, 0, 1001, 1483, 0, 810, 1188, 837, 0, 0,
52, 187, 0, 0, 1409, 1261, 0, 3119, 709, 0, 873, 2982, 0, 3201, 2875, 0,
3155, 285, 0, 1942, 2041, 240, 1357, 1148, 0, 2395, 0, 856, 1582, 0, 249, 0,
1191, 1138, 0, 0, 818, 116, 355, 2602, 1176, 0, 1872, 1610, 627, 0, 0, 0,
3179, 2939, 0, 1085, 255, 38, 2231, 1289, 793, 351, 0, 1281, 0, 3062, 648, 1247,
0, 0, 3024, 2952, 1299, 386, 2135, 512, 3067, 0, 0, 887, 0, 0, 1334, 0,
657, 160, 0, 89, 0, 678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2189, 0, 0, 2813, 0, 1022, 972, 0, 486, 0, 1438, 3198, 1329, 975, 1369, 1129,
3142, 0, 1193, 869, 2229, 123, 2669, 0, 1030, 0, 1384, 0, 0, 1247, 42, 2501,
75, 0, 157, 0, 2659, 2776, 1723, 1146, 641, 0, 0, 330, 0, 0, 1294, 0,
0, 0, 1209, 0, 807, 0, 881, 1398, 258, 0, 1759, 3186, 0, 0, 246, 55,
579, 1565, 1625, 0, 273, 0, 2759, 800, 0, 234, 1569, 968, 2369, 1184, 0, 2749,
0, 3032, 1408, 601, 941, 215, 268, 779, 164, 2058, 1391, 0, 3153, 0, 1454, 2713,
0, 0, 2924, 1875, 0, 1041, 325, 0, 1943, 345, 454, 12, 2946, 0, 1064, 2969,
2061, 223, 3090, 2964, 116, 0, 1199, 0, 3196, 329, 1141, 705, 0, 1566, 0, 0,
0, 0, 287, 0, 0, 625, 0, 0, 1575, 205, 0, 0, 0, 1729, 0, 0,
782, 3054, 0, 0, 0, 0, 73, 0, 4, 0, 2291, 0, 212, 1208, 0, 0,
0, 689, 521, 498, 710, 532, 0, 0, 2116, 2876, 0, 1471, 415, 836, 0, 0,
0, 0, 1325, 0, 0, 0, 1801, 2443, 1076, 1747, 8, 1985, 0, 0, 575, 2979,
0, 0, 3161, 2217, 0, 0, 729, 0, 490, 664, 0, 0, 503, 0, 850, 0,
991, 2970, 3046, 2957, 1375, 0, 0, 0, 0, 2986, 273, 0, 0, 904, 275, 0,
2418, 0, 0, 1365, 905, 720, 666, 0, 0, 1389, 998, 0, 1509, 0, 89, 0,
3148, 0, 0, 0, 249, 0, 0, 0, 1143, 290, 2213, 0, 281, 0, 0, 1172,
0, 0, 0, 1088, 1517, 739, 2866, 0, 0, 0, 1293, 2021, 2205, 0, 1452, 0,
185, 1428, 0, 1773, 122, 623, 1339, 1011, 3181, 3203, 888, 2269, 315, 0, 688, 0,
1231, 0, 1211, 921, 340, 1222, 0, 0, 0, 2695, 0, 1644, 0, 1594, 0, 673,
0, 3044, 0, 1142, 911, 0, 836, 1135, 2803, 1578, 1905, 1394, 442, 0, 0, 2977,
0, 0, 989, 296, 162, 0, 0, 534, 0, 1375, 994, 1355, 0, 1701, 987, 0,
2372, 84, 0, 0, 2699, 0, 1163, 2190, 425, 0, 0, 600, 0, 1570, 0, 946,
0, 2218, 0, 63, 371, 0, 0, 598, 0, 0, 256, 0, 0, 0, 0, 0,
0, 763, 3142, 533, 2393, 2685, 0, 595, 57, 0, 2809, 0, 0, 2531, 0, 1029,
69, 0, 0, 1224, 1218, 0, 1445, 0, 1482, 992, 628, 1284, 0, 602, 183, 0,
0, 1875, 1232, 3168, 2071, 2553, 0, 0, 0, 2826, 1483, 2353, 0, 2989, 1153, 632,
0, 835, 1448, 1601, 2235, 33, 1979, 0, 93, 0, 0, 0, 2288, 2900, 0, 1407,
1356, 359, 0, 1183, 0, 0, 0, 0, 1728, 2729, 2295, 0, 1089, 0, 1305, 2909,
1257, 1725, 0, 712, 1094, 1398, 0, 2559, 1688, 3158, 0, 1392, 1797, 0, 0, 1077,
953, 932, 1249, 0, 143, 416, 83, 42, 0, 2751, 2643, 0, 0, 0, 1791, 0,
31, 97, 0, 65, 747, 434, 0, 0, 878, 0, 0, 0, 2447, 1019, 0, 0,
3047, 0, 0, 0, 1196, 1159, 0, 743, 2813, 1036, 0, 397, 2959, 938, 0, 1305,
0, 0, 0, 2577, 1608, 194, 574, 0, 898, 0, 0, 258, 2770, 0, 0, 935,
0, 0, 0, 0, 778, 622, 0, 1765, 0, 0, 3094, 1571, 1164, 0, 0, 40,
1040, 469, 0, 112, 0, 1079, 2325, 0, 0, 1063, 3191, 0, 1109, 1135, 2512, 0,
0, 489, 0, 201, 3181, 2271, 1243, 3103, 0, 0, 374, 0, 0, 0, 0, 0,
287, 149, 2440, 1147, 592, 1654, 818, 0, 2474, 264, 0, 0, 0, 92, 218, 0,
0, 7, 0, 0, 180, 0, 1239, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1563, 1353, 2730, 809, 2634, 0, 1613, 2930, 0, 1782, 2507, 0, 501, 1563, 881, 2102,
3069, 0, 760, 1075, 652, 473, 934, 1850, 0, 0, 3095, 0, 0, 1747, 0, 572,
358, 2230, 0, 0, 1014, 0, 0, 213, 2911, 3096, 0, 1044, 2263, 1765, 87, 1069,
471, 550, 263, 839, 1306, 58, 163, 3188, 0, 198, 0, 2496, 1537, 24, 0, 814,
0, 0, 206, 0, 2592, 1146, 0, 25, 1094, 3047, 2936, 0, 1452, 1484, 1547, 0,
0, 0, 2035, 1113, 305, 0, 46, 0, 2216, 1719, 3040, 0, 293, 954, 124, 0,
94, 383, 1980, 535, 2437, 43, 0, 327, 0, 0, 2589, 0, 0, 1208, 2780, 181,
1859, 0, 2628, 0, 0, 991, 445, 62, 0, 0, 802, 0, 0, 0, 0, 0,
647, 451, 1025, 1001, 1236, 2275, 1180, 0, 0, 0, 1566, 1183, 171, 0, 2709, 1448,
0, 0, 0, 300, 0, 0, 596, 0, 1252, 1318, 2538, 1070, 280, 844, 0, 1317,
257, 2916, 1154, 493, 39, 173, 777, 0, 1030, 303, 492, 0, 0, 0, 2121, 0,
0, 1464, 1394, 0, 0, 1007, 0, 2732, 0, 0, 705, 1341, 0, 1237, 0, 0,
0, 0, 0, 1552, 668, 959, 883, 0, 712, 1254, 2745, 0, 0, 3137, 0, 0,
0, 1806, 13, 395, 0, 1916, 0, 0, 518, 0, 545, 2529, 0, 0, 0, 2919,
1111, 385, 921, 2879, 0, 148, 1283, 325, 0, 2639, 800, 0, 245, 0, 341, 0,
2805, 0, 0, 2031, 1100, 591, 0, 2903, 2980, 3182, 0, 463, 1761, 1686, 827, 142,
2462, 282, 0, 0, 1621, 513, 0, 370, 327, 0, 373, 1344, 0, 771, 1473, 537,
3127, 0, 0, 0, 0, 1173, 0, 0, 808, 2341, 2994, 0, 0, 1236, 3106, 2511,
500, 2494, 1327, 973, 0, 726, 0, 2432, 2508, 1090, 140, 0, 2047, 0, 511, 0,
752, 412, 0, 409, 942, 1193, 0, 2991, 1436, 508, 0, 1071, 1244, 731, 0, 1206,
305, 2007, 374, 533, 117, 146, 654, 1276, 1018, 0, 0, 0, 1418, 1541, 0, 0,
230, 0, 724, 319, 2258, 1057, 653, 0, 2684, 0, 2969, 1282, 0, 248, 0, 1048,
3139, 0, 1511, 0, 1044, 0, 576, 1503, 0, 0, 69, 2572, 0, 0, 546, 90,
80, 0, 0, 438, 313, 0, 0, 0, 0, 0, 0, 2621, 1538, 3045, 0, 70,
1078, 384, 2885, 1182, 2890, 11, 0, 1108, 1542, 0, 0, 914, 1443, 0, 2325, 1529,
0, 606, 0, 972, 0, 825, 0, 225, 1047, 1322, 1051, 1864, 513, 308, 0, 0,
456, 0, 422, 2906, 767, 0, 2102, 434, 1426, 581, 0, 757, 761, 1614, 376, 86,
531, 299, 0, 0, 161, 1362, 613, 0};
int MangledHashG(const char *key, const int *T)
{
@ -250,39 +244,40 @@ int MangledHashG(const char *key, const int *T)
for (int i = 0; key[i] != '\0'; i++)
{
sum += T[i] * key[i];
sum %= 3300;
sum %= 3208;
}
return mangledkG[sum];
}
int MangledPerfectHash(const char *key)
{
if (strlen(key) > 37)
if (strlen(key) > 40)
return 0;
return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 3300;
return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 3208;
}
constexpr int unmangledkT1[] = {154, 95, 278, 6, 35, 255, 255, 225, 266, 107, 238, 214, 59,
198, 267, 139, 100, 265, 109, 264, 131, 194, 214, 44, 182, 215};
constexpr int unmangledkT2[] = {5, 249, 205, 267, 173, 112, 278, 212, 74, 228, 266, 117, 51,
32, 189, 252, 56, 269, 171, 211, 27, 253, 18, 16, 129, 107};
constexpr int unmangledkT1[] = {246, 133, 248, 237, 59, 207, 93, 240, 98, 265, 137, 42, 147,
269, 280, 3, 248, 202, 278, 80, 240, 202, 142, 149, 257, 17};
constexpr int unmangledkT2[] = {166, 291, 199, 102, 183, 190, 20, 31, 50, 30, 134, 213, 202,
55, 268, 11, 15, 108, 22, 43, 119, 187, 239, 91, 190, 47};
constexpr int unmangledkG[] = {
0, 0, 0, 0, 259, 157, 231, 0, 81, 131, 0, 271, 0, 0, 0, 111, 0, 0, 55,
75, 47, 73, 70, 0, 0, 242, 83, 0, 0, 198, 127, 8, 82, 100, 23, 0, 100, 0,
216, 123, 55, 242, 215, 0, 0, 0, 56, 0, 0, 0, 0, 34, 104, 0, 16, 149, 0,
0, 160, 30, 0, 0, 0, 0, 0, 0, 96, 277, 76, 82, 234, 0, 0, 120, 8, 28,
0, 173, 100, 97, 0, 0, 215, 0, 0, 78, 0, 67, 253, 0, 6, 35, 139, 241, 271,
29, 254, 0, 9, 0, 209, 36, 219, 266, 28, 0, 27, 24, 221, 45, 109, 219, 0, 13,
0, 90, 0, 188, 0, 0, 116, 78, 0, 75, 42, 146, 0, 0, 0, 0, 25, 0, 0,
163, 0, 0, 0, 141, 222, 255, 0, 0, 86, 99, 0, 124, 157, 260, 259, 0, 142, 159,
0, 23, 0, 0, 5, 67, 190, 0, 0, 202, 54, 0, 0, 34, 1, 103, 87, 51, 0,
0, 0, 10, 0, 25, 154, 161, 143, 0, 61, 0, 255, 239, 27, 126, 7, 162, 66, 0,
103, 144, 192, 0, 45, 83, 0, 46, 0, 0, 63, 110, 215, 130, 271, 21, 217, 0, 0,
0, 251, 0, 18, 15, 0, 0, 0, 266, 115, 0, 55, 137, 189, 0, 89, 142, 0, 0,
60, 96, 0, 0, 0, 137, 92, 227, 58, 70, 0, 159, 21, 38, 198, 105, 0, 72, 53,
0, 66, 30, 100, 113, 239, 0, 0, 0, 51, 0, 0, 0, 264, 0, 0, 0, 0, 0,
166, 25, 0, 135, 9, 167, 278, 0, 117, 0, 92, 0, 76};
0, 42, 0, 0, 0, 127, 0, 0, 0, 291, 0, 201, 0, 0, 234, 0, 0, 0, 0,
45, 0, 0, 0, 0, 0, 152, 156, 0, 67, 0, 230, 127, 0, 0, 161, 0, 0, 59,
0, 265, 0, 241, 0, 160, 155, 0, 0, 46, 25, 0, 109, 0, 147, 21, 0, 32, 0,
0, 0, 0, 84, 23, 16, 142, 177, 0, 18, 0, 27, 66, 255, 142, 135, 59, 222, 57,
39, 0, 0, 99, 142, 122, 0, 32, 0, 0, 75, 0, 0, 136, 291, 68, 0, 0, 0,
19, 64, 205, 0, 238, 274, 176, 120, 80, 81, 105, 0, 201, 42, 0, 0, 60, 268, 3,
277, 0, 39, 0, 31, 14, 0, 54, 181, 93, 277, 149, 0, 146, 153, 0, 0, 0, 158,
278, 0, 0, 65, 238, 158, 0, 73, 276, 0, 0, 185, 140, 0, 0, 0, 179, 0, 38,
0, 39, 0, 166, 88, 54, 0, 232, 0, 0, 57, 0, 80, 0, 0, 30, 0, 91, 0,
0, 75, 0, 108, 0, 9, 212, 0, 55, 0, 196, 21, 0, 0, 153, 76, 239, 0, 0,
119, 86, 0, 193, 282, 0, 0, 0, 98, 2, 0, 102, 0, 13, 64, 0, 25, 58, 67,
0, 117, 159, 0, 0, 5, 29, 0, 56, 186, 54, 0, 254, 180, 84, 290, 0, 120, 0,
204, 39, 5, 0, 0, 44, 151, 0, 0, 254, 0, 93, 136, 194, 152, 0, 166, 115, 87,
0, 0, 0, 0, 138, 0, 62, 15, 0, 0, 41, 274, 90, 239, 113, 0, 0, 118, 246,
273, 226, 0, 133, 0, 269, 0, 3, 0, 0, 98, 277, 86, 151, 156, 218, 282, 0, 0,
0, 0, 29, 51, 0, 129, 63};
int UnmangledHashG(const char *key, const int *T)
{
@ -291,7 +286,7 @@ int UnmangledHashG(const char *key, const int *T)
for (int i = 0; key[i] != '\0'; i++)
{
sum += T[i] * key[i];
sum %= 279;
sum %= 292;
}
return unmangledkG[sum];
}
@ -301,7 +296,7 @@ int UnmangledPerfectHash(const char *key)
if (strlen(key) > 26)
return 0;
return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 279;
return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 292;
}
} // namespace

Просмотреть файл

@ -2,7 +2,7 @@
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
// builtin_function_declarations.txt.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// 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.
//
@ -26,294 +26,260 @@ std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str)
namespace
{
constexpr int mangledkT1[] = {3064, 1851, 1414, 3139, 4344, 3861, 2198, 569, 2942, 936,
1011, 2797, 994, 3172, 2246, 1929, 3580, 2059, 3211, 2760,
3315, 3834, 4289, 1359, 1965, 849, 1949, 3923, 2685, 4274,
4060, 2274, 1752, 1405, 743, 2453, 2110};
constexpr int mangledkT2[] = {3974, 952, 3020, 19, 962, 3302, 1369, 968, 2483, 3954,
2409, 949, 1306, 577, 1474, 224, 2913, 2365, 494, 208,
654, 3238, 2268, 54, 1039, 35, 3881, 44, 150, 967,
1157, 2004, 4019, 4114, 1201, 3022, 2477};
constexpr int mangledkT1[] = {3102, 1325, 1351, 3001, 1248, 3253, 589, 739, 2360, 2951,
1700, 3759, 2038, 664, 3245, 3120, 1585, 527, 2294, 2587,
1485, 188, 2635, 932, 884, 1991, 918, 320, 2213, 3603,
676, 1242, 115, 2611, 2163, 2535, 3233, 54, 3230, 1500};
constexpr int mangledkT2[] = {1129, 226, 3871, 1567, 3267, 3307, 452, 3099, 2330, 3246,
3512, 1556, 3216, 909, 1679, 1812, 3619, 2551, 2821, 3333,
3764, 2526, 2149, 2101, 1636, 2341, 2985, 454, 627, 1307,
466, 537, 2536, 736, 2238, 1704, 1050, 3135, 564, 182};
constexpr int mangledkG[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 4415, 0, 0, 1691, 0, 0, 0, 0, 0, 0, 4425, 0,
0, 0, 0, 0, 0, 0, 4035, 1669, 0, 0, 0, 0, 2801, 0, 0, 0,
0, 2968, 0, 294, 0, 3469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 909, 0, 0, 0, 0, 0, 0, 2401, 0, 2142, 0, 0, 0, 0, 0,
0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 858, 0, 0, 0, 0, 0,
0, 1663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1876, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 640, 811, 0, 3417, 0,
0, 3687, 0, 0, 3802, 4331, 0, 0, 2261, 0, 0, 0, 1718, 0, 0, 0,
0, 0, 1387, 0, 1507, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 357, 0, 0, 0, 0, 0, 0, 431, 0, 0, 0, 1199, 0,
0, 0, 0, 0, 2446, 0, 0, 218, 0, 0, 3861, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3600, 919, 0, 0, 0, 0, 0, 0, 1694, 0, 0, 0,
0, 0, 1161, 0, 0, 0, 0, 0, 381, 0, 221, 0, 3810, 0, 1467, 3945,
0, 3178, 0, 0, 331, 61, 0, 0, 0, 606, 680, 0, 3568, 0, 0, 0,
437, 0, 3806, 0, 0, 0, 1330, 0, 0, 0, 945, 0, 0, 0, 3384, 2674,
0, 0, 0, 4287, 4141, 454, 0, 4099, 0, 0, 0, 0, 0, 0, 684, 1247,
4248, 0, 0, 0, 0, 0, 0, 0, 0, 1705, 0, 0, 0, 0, 204, 0,
0, 3605, 1783, 889, 0, 0, 0, 533, 841, 0, 0, 0, 722, 2641, 0, 0,
0, 3827, 1320, 701, 4165, 0, 2297, 1239, 0, 2147, 0, 0, 0, 0, 0, 74,
0, 0, 0, 2019, 0, 0, 0, 0, 0, 1982, 0, 0, 0, 0, 75, 0,
0, 0, 578, 1658, 0, 0, 0, 0, 2822, 240, 0, 0, 27, 0, 0, 1251,
0, 2305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1199, 3986, 0, 0, 0,
0, 0, 1984, 0, 0, 0, 1930, 3656, 0, 0, 0, 0, 1516, 0, 0, 593,
0, 0, 0, 0, 0, 0, 0, 0, 478, 0, 882, 0, 0, 0, 0, 0,
1844, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0,
3866, 559, 0, 0, 0, 0, 4302, 0, 0, 0, 0, 780, 0, 0, 1982, 0,
0, 0, 4234, 0, 0, 0, 0, 0, 0, 0, 2297, 0, 0, 0, 659, 0,
0, 3233, 0, 0, 0, 0, 0, 0, 0, 321, 393, 4385, 1088, 520, 0, 1157,
1939, 0, 0, 0, 662, 865, 3747, 0, 959, 1862, 0, 408, 0, 0, 0, 1528,
0, 0, 0, 0, 0, 0, 0, 3562, 0, 210, 0, 604, 3749, 869, 0, 859,
787, 0, 0, 3851, 0, 0, 0, 0, 2430, 4363, 1549, 1784, 0, 0, 0, 0,
0, 208, 0, 4183, 4422, 0, 0, 0, 0, 1393, 0, 0, 0, 1002, 0, 0,
0, 0, 0, 0, 1081, 0, 0, 0, 0, 0, 0, 3531, 0, 0, 0, 0,
507, 2505, 0, 0, 0, 0, 0, 0, 0, 1709, 806, 1352, 209, 0, 813, 0,
0, 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 4320,
0, 0, 111, 655, 0, 256, 0, 0, 315, 4069, 3518, 0, 0, 0, 0, 0,
0, 0, 0, 3080, 968, 1823, 1486, 0, 432, 0, 0, 3856, 0, 0, 4251, 2293,
0, 0, 0, 0, 0, 0, 1118, 0, 0, 1023, 0, 2048, 4190, 0, 3663, 0,
0, 0, 802, 0, 0, 0, 0, 0, 0, 0, 2511, 0, 0, 0, 0, 70,
359, 0, 872, 0, 0, 0, 0, 1357, 4197, 0, 0, 0, 2161, 509, 0, 1160,
0, 0, 0, 0, 0, 1966, 57, 0, 0, 4399, 0, 3118, 0, 0, 3220, 0,
35, 0, 1408, 0, 0, 0, 693, 0, 0, 1501, 0, 0, 4442, 0, 1162, 0,
660, 0, 0, 0, 0, 0, 1589, 0, 0, 0, 0, 0, 0, 847, 0, 0,
0, 536, 0, 1852, 0, 0, 0, 0, 3950, 4010, 0, 0, 1443, 0, 0, 0,
235, 0, 0, 1930, 2636, 0, 1948, 2125, 0, 631, 0, 0, 1626, 0, 0, 4130,
0, 0, 2700, 1002, 0, 0, 948, 2542, 1493, 0, 4345, 0, 0, 151, 0, 0,
2828, 0, 0, 0, 0, 0, 0, 278, 4191, 756, 0, 3986, 0, 0, 380, 0,
1810, 0, 3423, 0, 0, 0, 183, 0, 0, 0, 813, 0, 304, 4453, 0, 647,
0, 0, 96, 0, 0, 1125, 0, 0, 0, 0, 0, 3813, 0, 0, 2261, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 3774, 0, 0, 2771, 0, 0, 0,
784, 3419, 0, 4000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 986, 0,
3, 4422, 0, 0, 0, 0, 1085, 0, 2105, 0, 0, 0, 0, 0, 0, 1935,
0, 0, 1532, 536, 0, 0, 0, 0, 0, 0, 1204, 3610, 0, 0, 0, 0,
0, 1032, 0, 0, 2706, 0, 4084, 0, 3679, 0, 0, 0, 515, 0, 4210, 0,
0, 357, 0, 0, 0, 0, 1868, 0, 2116, 0, 0, 0, 0, 2537, 0, 4146,
0, 0, 0, 0, 0, 1774, 1202, 4192, 0, 38, 0, 0, 4239, 1431, 0, 0,
0, 2086, 3359, 313, 1257, 3045, 1014, 0, 0, 0, 2549, 0, 938, 0, 0, 0,
0, 4095, 0, 0, 0, 2625, 1961, 0, 0, 0, 3687, 3390, 0, 0, 325, 0,
0, 0, 0, 1933, 0, 667, 0, 338, 0, 0, 0, 0, 1111, 0, 0, 0,
0, 1483, 0, 320, 0, 1248, 0, 925, 0, 0, 0, 0, 1074, 0, 0, 0,
0, 4239, 3207, 0, 396, 0, 0, 0, 85, 0, 1418, 127, 0, 1372, 0, 0,
0, 0, 0, 710, 0, 2599, 2053, 4316, 0, 2708, 570, 0, 0, 1248, 0, 0,
1187, 0, 0, 3899, 1895, 0, 0, 0, 1498, 594, 2018, 553, 2649, 911, 0, 2538,
0, 0, 0, 3433, 0, 0, 0, 0, 2340, 0, 0, 461, 0, 0, 0, 0,
0, 4014, 0, 3287, 647, 0, 0, 0, 466, 229, 0, 1544, 0, 1576, 0, 0,
0, 3251, 0, 0, 698, 0, 0, 3516, 0, 0, 0, 0, 0, 653, 0, 2703,
0, 0, 0, 2212, 0, 2015, 0, 0, 0, 0, 0, 0, 0, 0, 1307, 663,
0, 179, 0, 0, 0, 0, 2717, 929, 358, 0, 4142, 1092, 3578, 0, 3160, 0,
0, 0, 0, 932, 590, 85, 3483, 1580, 3628, 0, 0, 0, 0, 0, 0, 3354,
0, 0, 166, 0, 0, 3413, 1430, 0, 0, 4427, 0, 0, 0, 0, 328, 0,
0, 0, 0, 0, 856, 0, 0, 4415, 0, 0, 4389, 446, 0, 0, 1645, 0,
0, 0, 0, 0, 0, 0, 3077, 0, 0, 1571, 472, 1588, 0, 0, 0, 17,
0, 653, 815, 3015, 400, 0, 0, 0, 0, 0, 0, 4004, 0, 0, 1981, 2016,
0, 935, 0, 0, 0, 0, 0, 0, 4100, 644, 1623, 0, 0, 91, 2507, 0,
1311, 0, 2364, 0, 0, 327, 0, 0, 0, 264, 0, 3167, 3276, 4162, 1591, 0,
0, 736, 0, 0, 0, 4089, 0, 3221, 1136, 0, 0, 0, 0, 867, 2968, 1781,
0, 0, 4040, 2958, 0, 3499, 0, 3382, 1149, 2819, 266, 802, 133, 0, 0, 0,
3176, 0, 1650, 3802, 0, 0, 0, 0, 0, 2732, 0, 0, 0, 151, 0, 0,
1117, 3687, 0, 696, 2046, 0, 814, 0, 0, 0, 0, 3982, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 279, 2735, 0, 689, 853, 349, 0, 574, 2143, 0,
0, 0, 3275, 0, 3086, 0, 0, 0, 0, 562, 1960, 0, 0, 0, 4129, 312,
2687, 4370, 347, 1881, 1648, 1442, 0, 4226, 1609, 0, 0, 386, 2767, 0, 956, 0,
0, 3301, 2280, 812, 0, 0, 66, 0, 0, 0, 0, 0, 0, 3085, 203, 0,
709, 0, 235, 177, 0, 0, 0, 0, 2512, 1450, 0, 3215, 0, 0, 0, 1514,
1008, 1860, 0, 3610, 908, 0, 0, 0, 158, 0, 153, 719, 0, 1184, 397, 256,
0, 0, 517, 4241, 2402, 2208, 0, 4057, 0, 0, 1261, 0, 0, 0, 701, 604,
0, 0, 135, 0, 0, 2102, 3714, 0, 826, 2268, 344, 0, 0, 4015, 0, 3958,
1357, 0, 354, 0, 0, 598, 0, 0, 0, 0, 294, 3554, 0, 1277, 0, 0,
0, 0, 141, 0, 0, 4115, 0, 0, 0, 1945, 0, 3230, 0, 972, 101, 1382,
0, 0, 1014, 3534, 4383, 1312, 125, 2647, 0, 2014, 0, 1866, 0, 0, 3715, 99,
515, 0, 0, 167, 2621, 0, 0, 0, 0, 3900, 3592, 0, 0, 0, 0, 0,
0, 0, 1972, 0, 1653, 4378, 1975, 0, 950, 0, 0, 1553, 0, 0, 0, 0,
145, 1093, 1404, 314, 0, 0, 0, 0, 1668, 0, 1042, 0, 2900, 1355, 0, 0,
0, 0, 0, 858, 0, 0, 0, 958, 1889, 0, 0, 0, 0, 3924, 0, 0,
2819, 0, 2638, 0, 0, 2585, 0, 0, 807, 1852, 0, 0, 0, 4051, 0, 3570,
0, 0, 0, 0, 0, 0, 0, 0, 883, 0, 1526, 0, 847, 0, 532, 0,
1214, 3981, 1205, 1023, 664, 1264, 2773, 0, 0, 73, 0, 1555, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2701, 2088, 811, 339, 0, 2050, 3888, 4133, 73,
0, 0, 0, 1749, 1278, 232, 1113, 0, 0, 0, 0, 1423, 369, 589, 0, 0,
0, 0, 0, 3947, 0, 192, 0, 1500, 2058, 0, 3093, 0, 0, 253, 686, 0,
0, 0, 1847, 0, 0, 0, 0, 1531, 0, 222, 0, 0, 1291, 1154, 0, 0,
0, 1422, 0, 0, 92, 1761, 0, 3482, 175, 3016, 0, 0, 0, 2091, 0, 1083,
0, 1331, 2074, 573, 1650, 1903, 0, 0, 358, 3934, 1000, 0, 0, 0, 0, 135,
4136, 0, 0, 0, 288, 0, 0, 0, 464, 0, 890, 408, 2370, 979, 0, 2494,
3640, 0, 0, 0, 0, 1013, 1172, 1937, 2471, 0, 0, 0, 84, 519, 0, 1452,
1596, 0, 1521, 0, 3417, 0, 1555, 0, 1997, 4116, 1537, 3657, 0, 0, 445, 451,
2039, 835, 3931, 0, 4100, 1128, 0, 501, 0, 0, 0, 248, 0, 0, 4088, 2388,
629, 0, 801, 0, 0, 1568, 771, 0, 949, 0, 140, 0, 0, 1806, 1568, 0,
0, 2030, 1755, 0, 0, 2075, 0, 2829, 0, 0, 0, 0, 854, 1779, 0, 1022,
2947, 0, 2714, 0, 668, 1835, 106, 0, 0, 111, 1656, 1230, 0, 0, 0, 0,
3187, 406, 0, 752, 972, 0, 2872, 73, 0, 4400, 2630, 0, 1194, 399, 0, 948,
0, 429, 0, 4344, 2988, 0, 1482, 3078, 0, 3811, 0, 0, 0, 453, 0, 1268,
0, 0, 0, 1643, 1883, 0, 391, 1478, 1476, 0, 0, 907, 432, 0, 556, 0,
0, 3783, 0, 2575, 2017, 4024, 0, 0, 0, 570, 2698, 1749, 0, 0, 0, 2650,
1490, 0, 0, 0, 0, 906, 0, 0, 488, 1274, 0, 310, 436, 4202, 3961, 0,
255, 2232, 2841, 0, 0, 0, 1666, 262, 1320, 0, 2744, 4376, 0, 0, 1651, 0,
110, 0, 0, 0, 0, 775, 0, 0, 2425, 4122, 0, 1814, 0, 1951, 0, 0,
0, 924, 3999, 0, 1109, 202, 0, 1719, 1045, 230, 0, 1359, 102, 0, 0, 0,
542, 0, 872, 676, 0, 1685, 0, 0, 44, 0, 798, 553, 0, 239, 0, 0,
0, 0, 881, 2692, 0, 4224, 0, 3537, 0, 0, 2051, 0, 0, 0, 0, 4291,
0, 1617, 126, 4440, 1170, 491, 0, 0, 3101, 0, 0, 1044, 1499, 1290, 0, 0,
0, 278, 0, 0, 1600, 0, 0, 0, 0, 0, 0, 0, 2903, 0, 0, 0,
0, 684, 472, 0, 742, 3004, 0, 0, 1851, 1386, 1160, 1494, 1859, 0, 3500, 4048,
581, 0, 0, 226, 1737, 0, 0, 0, 354, 0, 3818, 0, 4092, 0, 0, 1895,
0, 1866, 1629, 0, 696, 0, 0, 1811, 0, 0, 0, 0, 0, 0, 0, 3865,
753, 0, 0, 1902, 0, 0, 403, 831, 0, 1269, 0, 0, 0, 0, 2689, 0,
0, 0, 0, 0, 0, 1275, 0, 0, 1799, 968, 0, 0, 0, 471, 466, 109,
0, 0, 4410, 0, 2886, 3928, 725, 0, 0, 0, 1271, 2067, 2790, 1810, 0, 0,
0, 0, 98, 0, 867, 1424, 1558, 1665, 1393, 0, 940, 692, 0, 0, 290, 803,
0, 0, 1839, 0, 3825, 0, 1040, 0, 0, 0, 0, 0, 0, 0, 0, 3660,
1943, 0, 0, 959, 1505, 4212, 238, 0, 0, 0, 119, 0, 0, 0, 407, 0,
0, 0, 0, 3009, 1974, 1309, 0, 775, 0, 3398, 0, 532, 0, 0, 0, 0,
0, 0, 0, 0, 0, 785, 0, 0, 2087, 0, 0, 0, 1647, 0, 0, 840,
3232, 1827, 0, 336, 3195, 0, 12, 0, 778, 0, 1004, 1148, 0, 513, 3952, 0,
0, 155, 567, 0, 0, 0, 1905, 0, 0, 950, 1021, 0, 2350, 1140, 0, 870,
218, 291, 0, 1859, 3042, 708, 1500, 4199, 2385, 0, 0, 2040, 0, 276, 710, 3508,
0, 0, 3049, 0, 0, 183, 219, 1025, 0, 4272, 3738, 0, 2222, 0, 1224, 1984,
4319, 374, 0, 0, 0, 0, 0, 945, 2352, 496, 0, 1759, 0, 0, 0, 425,
2723, 0, 0, 0, 771, 0, 0, 1185, 961, 3977, 0, 0, 0, 0, 0, 0,
934, 0, 1340, 2162, 1199, 0, 0, 0, 0, 110, 851, 0, 0, 0, 0, 540,
2149, 415, 0, 3873, 208, 0, 1655, 495, 1902, 0, 0, 2135, 0, 0, 0, 639,
3197, 0, 0, 0, 3487, 0, 234, 0, 0, 0, 1378, 0, 0, 723, 107, 955,
0, 0, 3313, 0, 3589, 419, 0, 4015, 1633, 2623, 0, 1129, 0, 1347, 2147, 0,
0, 3079, 2172, 1649, 0, 0, 505, 0, 0, 2215, 0, 3567, 1279, 3671, 526, 1356,
0, 1078, 507, 347, 0, 695, 0, 162, 0, 1867, 1923, 0, 530, 0, 0, 555,
0, 0, 0, 0, 2208, 0, 0, 1838, 0, 0, 0, 0, 0, 1924, 1492, 0,
1738, 1337, 0, 3595, 0, 690, 1269, 0, 1946, 0, 395, 0, 0, 13, 0, 0,
866, 2298, 1771, 0, 0, 0, 728, 2447, 3227, 3237, 667, 0, 0, 0, 1279, 2780,
0, 0, 0, 435, 4301, 2397, 4103, 672, 1657, 0, 0, 4024, 0, 0, 0, 0,
3357, 0, 0, 1010, 0, 0, 0, 0, 1660, 3424, 0, 0, 0, 616, 371, 0,
1705, 4365, 999, 275, 0, 0, 963, 0, 0, 794, 4047, 1749, 1406, 0, 55, 1751,
0, 0, 0, 0, 0, 0, 0, 0, 739, 0, 649, 0, 0, 0, 3989, 0,
3272, 0, 0, 0, 0, 0, 0, 0, 3295, 0, 1427, 0, 0, 811, 0, 351,
0, 3834, 0, 1564, 0, 0, 1059, 2743, 3304, 1938, 0, 923, 378, 3177, 0, 0,
1470, 0, 286, 0, 3065, 1371, 0, 675, 1708, 0, 0, 1203, 0, 0, 0, 0,
376, 0, 345, 983, 2009, 0, 3788, 27, 247, 822, 0, 835, 1903, 575, 561, 1806,
0, 107, 0, 1466, 0, 0, 1155, 85, 0, 2077, 0, 0, 838, 731, 289, 0,
0, 0, 2114, 3728, 1067, 2248, 1546, 1000, 0, 0, 550, 3066, 1987, 0, 0, 0,
0, 202, 0, 1788, 0, 981, 0, 3628, 882, 3969, 1795, 639, 4323, 0, 0, 0,
614, 751, 0, 0, 3917, 326, 4035, 452, 1688, 4105, 4053, 0, 0, 797, 755, 3429,
0, 4058, 0, 0, 0, 512, 3446, 0, 0, 0, 2624, 0, 3564, 1335, 0, 1245,
2282, 301, 0, 0, 945, 0, 0, 0, 3408, 0, 0, 0, 4298, 0, 0, 1612,
312, 1740, 0, 491, 3070, 0, 222, 3974, 1172, 898, 0, 1213, 0, 0, 1076, 2750,
582, 0, 4030, 297, 0, 0, 3209, 0, 2012, 0, 409, 459, 102, 0, 0, 0,
0, 318, 3156, 4381, 0, 243, 0, 1066, 3613, 3654, 2871, 3545, 0, 0, 585, 904,
274, 0, 1457, 0, 0, 4058, 693, 15, 0, 1009, 4195, 0, 0, 0, 524, 0,
0, 0, 0, 844, 203, 1782, 2118, 0, 672, 2269, 0, 0, 1905, 0, 0, 4417,
0, 3797, 454, 0, 195, 0, 930, 4168, 480, 743, 4217, 0, 0, 3706, 2915, 2273,
1063, 677, 0, 4420, 2326, 0, 0, 0, 1179, 1725, 0, 0, 3730, 0, 39, 4270,
1585, 0, 1925, 3912, 0, 0, 0, 0, 0, 0, 4274, 0, 824, 0, 971, 0,
0, 0, 0, 1928, 298, 0, 734, 0, 0, 10, 2811, 850, 0, 2731, 1322, 4050,
2774, 0, 4322, 786, 346, 2108, 0, 0, 1920, 0, 0, 1660, 280, 174, 518, 3704,
3169, 0, 0, 3434, 3345, 3828, 3865, 0, 196, 1421, 0, 0, 2368, 483, 1716, 0,
0, 0, 0, 0, 0, 0, 593, 420, 0, 829, 0, 248, 1450, 4228, 0, 190,
0, 3538, 4358, 3070, 0, 1222, 33, 0, 0, 16, 355, 0, 364, 606, 297, 0,
1159, 1532, 0, 486, 0, 0, 0, 60, 749, 463, 861, 0, 4408, 463, 0, 0,
849, 218, 0, 0, 0, 1062, 1411, 0, 1276, 45, 0, 0, 0, 87, 669, 861,
570, 1206, 0, 0, 0, 0, 1367, 163, 353, 2631, 688, 1288, 0, 383, 0, 0,
0, 0, 1901, 1817, 532, 1743, 438, 0, 3196, 0, 1135, 3962, 0, 0, 0, 1458,
500, 253, 1314, 3690, 519, 0, 1729, 0, 1513, 692, 1127, 257, 0, 534, 0, 302,
0, 0, 0, 0, 0, 1193, 50, 0, 314, 0, 0, 332, 4102, 265, 0, 1208,
0, 2236, 0, 0, 0, 917, 0, 0, 2083, 2924, 543, 2492, 3603, 762, 423, 0,
1293, 3452, 0, 2499, 0, 1700, 0, 0, 812, 1928, 1280, 2631, 436, 1422, 0, 0,
1201, 0, 0, 1339, 68, 1872, 4153, 4268, 4238, 0, 1704, 0, 0, 0, 523, 0,
0, 2026, 987, 292, 177, 1381, 1034, 518, 0, 0, 1611, 4312, 3213, 0, 0, 952,
0, 0, 541, 818, 0, 0, 1349, 0, 0, 525, 0, 1459, 0, 1408, 3696, 823,
0, 1883, 109, 4102, 1011, 700, 1049, 1167, 840, 0, 3919, 1405, 0, 2137, 1293, 0,
0, 0, 698, 1169, 45, 0, 578, 0, 3507, 0, 4197, 379, 0, 0, 228, 519,
0, 0, 4270, 0, 28, 0, 581, 1071, 1434, 0, 267, 0, 0, 408, 2883, 64,
1411, 730, 1394, 0, 0, 2112, 1307, 0, 0, 236, 0, 0, 3601, 4029, 0, 0,
716, 0, 2456, 0, 3915, 4440, 2555, 3643, 0, 628, 1357, 1373, 1008, 0, 0, 3022,
1346, 230, 0, 0, 1991, 432, 101, 0, 0, 0, 0, 1767, 0, 0, 3903, 0,
236, 3881, 0, 1921, 0, 2200, 0, 4411, 0, 1007, 3900, 0, 0, 282, 0, 1362,
1018, 0, 0, 1191, 4441, 0, 0, 1280, 741, 2106, 1910, 0, 0, 394, 1720, 0,
970, 0, 0, 0, 0, 4025, 0, 4150, 95, 3451, 132, 2737, 1448, 0, 230, 3911,
0, 0, 713, 0, 0, 2156, 314, 382, 3165, 158, 1849, 0, 3498, 4204, 179, 0,
0, 0, 913, 0, 0, 0, 3279, 1766, 2680, 4279, 591, 0, 4045, 3673, 3881, 0,
1562, 421, 1387, 4121, 4154, 4200, 0, 3912, 97, 3476, 242, 0, 0, 258, 1299, 460,
0, 0, 0, 0, 0, 4257, 0, 0, 440, 0, 0, 1967, 736, 2881, 0, 164,
0, 2813, 3015, 2070, 0, 0, 0, 0, 294, 1999, 1933, 4131, 1509, 2148, 0, 0,
1969, 1583, 2383, 2596, 986, 1628, 0, 49, 0, 0, 0, 0, 9, 0, 1127, 49,
0, 0, 52, 0, 1012, 0, 1351, 0, 2061, 2487, 1716, 1424, 0, 3255, 967, 1752,
0, 4326, 0, 639, 0, 1348, 2053, 3758, 1296, 1818, 1805, 0, 0, 0, 4321, 2091,
0, 0, 2320, 0, 0, 3821, 193, 3423, 0, 2160, 0, 1107, 1631, 25, 0, 0,
0, 0, 1436, 3024, 1003, 0, 2325, 0, 0, 683, 1023, 1760, 0, 1894, 16, 780,
1558, 244, 1005, 0, 492, 2069, 1020, 1315, 3756, 764, 0, 0, 30, 0, 467, 1511,
414, 0, 0, 0, 570, 0, 0, 0, 2072, 1627, 0, 0, 2037, 0, 539, 832,
899, 0, 0, 638, 651, 901, 462, 1216, 0, 1074, 0, 0, 1006, 0, 0, 0,
0, 3390, 1987, 0, 831, 1710, 0, 0, 3856, 2599, 960, 3988, 0, 4209, 0, 771,
0, 0, 4415, 2729, 0, 0, 2165, 772, 0, 0, 2181, 431, 4130, 1508, 48, 790,
3068, 0, 4306, 1596, 0, 0, 859, 0, 823, 3596, 2052, 3141, 0, 4377, 0, 194,
414, 0, 0, 1051, 964, 1532, 0, 0, 1266, 3492, 0, 0, 0, 829, 1504, 0,
1895, 0, 648, 831, 2964, 37, 3224, 1426, 3699, 1203, 1929, 1302, 2167, 0, 993, 1771,
106, 0, 842, 0, 1152, 0, 0, 0, 1605, 0, 1533, 0, 709, 96, 658, 2045,
2865, 618, 0, 3439, 0, 4312, 2084, 371, 0, 1961, 142, 0, 0, 0, 1552, 0,
0, 0, 3070, 0, 1381, 1099, 1423, 0, 2743, 0, 46, 3081, 62, 3152, 0, 1067,
3948, 2254, 808, 0, 0, 1791, 0, 2956, 1336, 153, 0, 1695, 2180, 335, 0, 502,
896, 3491, 0, 925, 441, 464, 0, 0, 3206, 3577, 408, 2565, 2166, 4007, 734, 1520,
766, 0, 0, 586, 0, 1025, 0, 1346, 2, 0, 140, 1355, 1884, 4337, 916, 1411,
0, 0, 0, 76, 0, 1202, 4196, 1720, 1176, 0, 3222, 1724, 785, 0, 0, 45,
0, 1286, 0, 144, 0, 4040, 0, 0, 0, 910, 0, 0, 277, 1484, 1494, 3994,
0, 0, 364, 953, 582, 623, 1748, 952, 0, 0, 799, 0, 0, 3675, 7, 884,
2132, 0, 497, 703, 0, 0, 0, 1527, 0, 0, 0, 558, 3175, 0, 2886, 20,
0, 863, 0, 1542, 1194, 0, 0, 0, 1530, 0, 1426, 3370, 1184, 1888, 0, 0,
0, 1879, 0, 0, 0, 0, 1373, 0, 0, 3925, 0, 0, 609, 3556, 886, 512,
0, 1443, 1158, 0, 1601, 0, 496, 0, 0, 0, 0, 3980, 316, 0, 3999, 608,
1375, 4451, 2447, 334, 0, 614, 1540, 3033, 3997, 0, 4215, 1469, 0, 1137, 925, 1312,
0, 1765, 0, 2335, 645, 0, 943, 0, 2472, 0, 1214, 1635, 0, 0, 83, 4375,
1993, 207, 291, 1175, 0, 2020, 0, 1194, 0, 540, 0, 641, 0, 0, 0, 1652,
4302, 4210, 1077, 0, 4000, 0, 700, 3918, 3319, 3820, 750, 2117, 3307, 0, 3891, 1427,
3662, 2483, 0, 14, 0, 0, 0, 2064, 0, 0, 0, 0, 1040, 0, 2024, 857,
0, 1671, 879, 684, 682, 0, 846, 0, 1964, 3883, 0, 2651, 0, 0, 0, 3344,
3567, 1574, 0, 1079, 1181, 1637, 482, 0, 2037, 265, 0, 1412, 0, 2269, 1227, 0,
315, 297, 0, 2, 512, 0, 1097, 1347, 0, 4166, 0, 0, 0, 0, 0, 0,
1372, 368, 1293, 0, 0, 0, 2843, 571, 1965, 4451, 1207, 1894, 1973, 2267, 0, 1274,
0, 1584, 1144, 0, 2289, 1717, 3714, 1001, 0, 0, 1008, 834, 346, 1993, 1330, 4271,
2874, 2332, 0, 0, 951, 0, 0, 0, 0, 3962, 1194, 1830, 1537, 3864, 807, 1958,
0, 0, 4321, 0, 0, 0, 2290, 1033, 1590, 0, 340, 444, 3595, 3436, 425, 1916,
0, 12, 182, 1544, 2176, 0, 1535, 1624, 0, 0, 1212, 0, 0, 4223, 0, 0,
614, 2131, 0, 430, 1003, 667, 2642, 2027, 0, 1845, 631, 1056, 1252, 0, 468, 4019,
0, 0, 0, 0, 1481, 1951, 3403, 1374, 0, 0, 0, 4294, 1220, 114, 0, 418,
651, 98, 1015, 4403, 0, 1295, 0, 1338, 3941, 0, 542, 3496, 75, 916, 404, 329,
0, 1438, 300, 957, 0, 0, 602, 373, 0, 2540, 2585, 23, 1959, 293, 3627, 1485,
1242, 0, 0, 0, 1108, 0, 533, 0, 1842, 772, 0, 879, 1240, 0, 1545, 0,
0, 0, 159, 111, 731, 0, 0, 0, 1284, 127, 2538, 2422, 0, 1077, 657, 862,
3393, 3538, 398, 859, 1477, 0, 3066, 0, 0, 1873, 0, 1188, 39, 3293, 397, 0,
0, 1098, 1549, 0, 0, 0, 6, 4275, 3349, 1906, 518, 1259, 1310, 167, 754, 329,
0, 2196, 778, 3061, 0, 1447, 811, 0, 984, 0, 0, 1386, 1267, 0, 0, 0,
1429, 1565, 1976, 3102, 0, 0, 0, 3727, 0, 2404, 0, 0, 3510, 2113, 0, 1147,
0, 1704, 0, 0, 75, 0, 3848, 0, 0, 0, 0, 822, 3353, 4291, 978, 1393,
1631, 0, 4272, 1276, 0, 0, 0, 2093, 774, 0, 3925, 901, 0, 3714, 0, 0,
1582, 0, 1742, 4026, 748, 2962, 1209, 0, 0, 1440, 940, 2826, 0, 797, 2567, 4275,
252, 2842, 3771, 0, 1223, 0, 0, 1900, 0, 3580, 1282, 1112, 0, 1261, 123, 117,
381, 537, 1615, 2429, 1559, 1102, 2475, 1722, 0, 903, 0, 3890, 466, 3629, 338, 0,
887, 4365, 676, 1438, 837, 120, 0, 941, 0, 1869, 353, 1742, 0, 1479, 0, 3562,
0, 1483, 3730, 0, 3009, 0, 0, 0, 1887, 161, 635, 0, 3014, 0, 4170, 0,
0, 947, 0, 119, 1617, 0, 0, 2562, 169, 458, 0, 1047, 1108, 1879, 504, 0,
2102, 0, 1144, 2339, 364, 0, 0, 0, 40, 0, 2062, 283, 0, 745, 4330, 0,
99, 1996, 0, 2711, 1765, 0, 1424, 3705, 0, 0, 0, 0, 1358, 4383, 3326, 0,
0, 3030, 499, 2276, 0, 3230, 0, 923, 0, 0, 4362, 4025, 871, 0, 0, 0,
1529, 0, 2906, 916, 0, 0, 4269, 1211, 0, 1802, 0, 0, 2895, 1825, 873, 1053,
1322, 1833, 360, 0, 1586, 1730, 0, 1072, 0, 0, 0, 943, 1379, 0, 3869, 4429,
3154, 1312, 2013, 0, 4232, 1317, 336, 637, 2071, 16, 4384, 0, 832, 0, 3, 0,
0, 0, 1650, 4308, 0, 1869, 0, 0, 4115, 1017, 316, 0, 0, 1843, 0, 1378,
577, 0, 0, 4440, 81, 3849, 0, 1644, 4385, 3917, 1747, 0, 1664, 0, 1217, 367,
0, 0, 2700, 0, 208, 2033, 0, 413, 656, 632, 433, 0, 0, 934, 0, 37,
4004, 0, 0, 1536, 342, 0, 0, 666, 363, 118, 4353, 0, 0, 0, 249, 105,
1553, 1547, 19, 0, 493, 1350, 1917, 1691, 0, 1349, 0, 380, 756, 0, 0, 0,
0, 0, 1415, 0, 1643, 0, 0, 241, 3884, 2489, 1276, 0, 0, 717, 0, 1468,
0, 146, 1965, 0, 1116, 0, 2624, 0, 878, 2182, 1566, 1770, 850, 699, 0, 0,
1846, 535, 0, 584, 0, 2002, 244, 0, 3769, 1094, 2006, 0, 0, 0, 4207, 3761,
4353, 1046, 310, 3707, 0, 1253, 1284, 0, 0, 3085, 337, 2234, 162, 4231, 0, 422,
5, 694, 1721, 0, 1853, 1474, 191, 1298, 0, 0, 2918, 4065, 0, 0, 1089, 0,
0, 1310, 2035, 4324, 34, 0, 0, 1853, 0, 4390, 1251, 0, 1095, 1677, 1126, 1035,
1048, 773, 2534, 767, 16, 343, 3632, 768, 538, 0, 1909, 672, 0, 461, 1732, 0,
4193, 0, 1434, 1387, 2036, 0, 0, 2293, 0, 0, 920, 0, 1138, 1125, 0, 0,
0, 1453, 0, 1990, 0, 1289, 76};
0, 0, 0, 0, 0, 0, 0, 0, 0, 973, 0, 0, 2762, 0, 0, 3695,
2780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2474,
0, 616, 0, 0, 0, 0, 0, 626, 0, 0, 0, 0, 0, 242, 0, 0,
0, 2505, 1729, 3344, 0, 0, 362, 0, 139, 0, 0, 0, 0, 3022, 2925, 0,
0, 0, 0, 0, 0, 961, 0, 2450, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1206, 0, 0, 0, 0, 0, 2292, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2294, 0, 0, 0, 0, 0, 0, 3243, 0, 0, 1832, 1889,
3015, 2347, 397, 0, 0, 0, 0, 0, 2268, 487, 1220, 0, 0, 2970, 0, 0,
0, 0, 0, 0, 0, 192, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 1118,
0, 0, 1389, 0, 0, 0, 0, 3334, 0, 0, 1866, 0, 0, 0, 3268, 0,
0, 1397, 0, 0, 0, 0, 0, 735, 0, 0, 0, 193, 15, 0, 3158, 0,
0, 0, 3298, 2376, 0, 1462, 2924, 183, 0, 2649, 0, 0, 3226, 3552, 3343, 0,
2502, 3258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1942, 0, 0, 397,
1413, 2818, 0, 0, 0, 0, 2738, 2414, 3786, 0, 0, 0, 67, 0, 0, 236,
0, 0, 0, 0, 2668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1223, 0,
0, 0, 0, 0, 264, 1411, 0, 0, 820, 0, 1770, 0, 806, 833, 0, 0,
1814, 3051, 0, 3651, 2100, 0, 66, 0, 878, 0, 0, 0, 1974, 854, 0, 2011,
0, 0, 0, 0, 3393, 1300, 0, 0, 0, 109, 0, 0, 0, 0, 3313, 0,
3075, 0, 0, 0, 617, 0, 0, 2650, 0, 0, 465, 3456, 152, 84, 3232, 752,
1075, 0, 0, 1699, 0, 224, 863, 0, 0, 0, 0, 0, 0, 2953, 0, 0,
0, 3203, 0, 121, 0, 2641, 0, 0, 0, 204, 0, 0, 1953, 0, 0, 0,
0, 3898, 3511, 0, 1586, 696, 0, 0, 2698, 0, 2432, 3277, 0, 0, 1511, 663,
0, 0, 1570, 0, 604, 3199, 0, 0, 1463, 393, 0, 0, 0, 0, 2089, 1937,
752, 0, 532, 0, 1645, 0, 939, 3461, 2351, 1982, 0, 3505, 0, 661, 0, 0,
0, 0, 0, 1720, 753, 3334, 0, 2086, 164, 0, 2217, 1863, 0, 0, 0, 0,
0, 3788, 1074, 0, 1229, 0, 403, 0, 910, 345, 0, 1835, 129, 2886, 0, 0,
0, 0, 2440, 2572, 0, 0, 0, 0, 0, 3718, 0, 3856, 13, 0, 2909, 449,
0, 0, 0, 0, 0, 3898, 0, 0, 0, 0, 0, 0, 0, 1796, 0, 3301,
0, 3374, 0, 0, 0, 2637, 0, 0, 0, 0, 0, 2487, 24, 1432, 0, 1127,
99, 0, 0, 0, 0, 3601, 3638, 2083, 0, 3667, 676, 1955, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2263, 2650, 0, 0, 813, 2872, 0, 0, 1530, 1263,
0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 509, 2814,
1472, 1384, 0, 0, 0, 0, 0, 3528, 0, 0, 0, 0, 923, 649, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 183, 0, 439,
1359, 0, 0, 0, 0, 1291, 167, 0, 0, 591, 0, 1224, 0, 1753, 0, 0,
0, 0, 418, 3560, 0, 1326, 2703, 0, 0, 2694, 0, 104, 440, 0, 0, 0,
0, 0, 0, 0, 0, 2005, 0, 2661, 0, 0, 2969, 1668, 3653, 0, 0, 0,
0, 0, 0, 3832, 0, 2835, 380, 0, 3081, 0, 0, 0, 199, 0, 653, 3303,
0, 3432, 0, 1524, 1795, 2718, 0, 2461, 0, 0, 1838, 0, 0, 724, 1453, 0,
0, 578, 2660, 2676, 1297, 0, 0, 0, 0, 3364, 0, 0, 0, 0, 0, 1997,
0, 0, 0, 79, 0, 319, 1270, 1804, 515, 254, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1728, 0, 938, 2011, 1135, 419, 3847, 0, 0,
992, 0, 1601, 0, 0, 0, 0, 0, 3562, 867, 0, 0, 0, 27, 0, 0,
1426, 0, 0, 2559, 686, 0, 0, 0, 0, 608, 1880, 3358, 0, 0, 76, 0,
0, 0, 0, 1686, 1122, 780, 0, 0, 2811, 0, 805, 0, 3568, 3098, 0, 0,
0, 0, 0, 0, 0, 0, 2172, 429, 3755, 0, 819, 0, 0, 0, 538, 3871,
3617, 2269, 0, 147, 0, 3475, 2291, 0, 0, 868, 2865, 2720, 738, 0, 9, 766,
353, 2940, 521, 0, 0, 0, 0, 0, 3649, 1789, 121, 0, 0, 438, 2023, 0,
0, 1124, 0, 0, 0, 0, 0, 469, 3089, 0, 3837, 2214, 273, 1776, 722, 0,
0, 0, 0, 0, 0, 3583, 3394, 0, 0, 1302, 3405, 0, 1191, 1277, 0, 3244,
0, 1010, 0, 771, 775, 0, 1234, 340, 0, 0, 0, 1029, 0, 0, 1037, 306,
2918, 0, 0, 1276, 2437, 948, 3700, 2008, 0, 0, 0, 486, 0, 3645, 510, 287,
1555, 1946, 483, 0, 3344, 0, 3126, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 3249, 0, 0, 0, 2124, 1044, 0, 2645, 0, 0, 0, 0, 3079, 0, 0,
0, 0, 0, 0, 0, 581, 3109, 0, 934, 0, 0, 0, 0, 0, 3881, 1317,
0, 1109, 781, 1122, 0, 1191, 1355, 3154, 0, 817, 3560, 765, 2974, 0, 0, 461,
2776, 1285, 154, 0, 0, 1414, 0, 0, 0, 0, 525, 0, 0, 0, 0, 0,
2040, 0, 1688, 1493, 342, 0, 1988, 2055, 3664, 0, 0, 0, 0, 3009, 1412, 1879,
0, 3385, 0, 0, 0, 2079, 0, 0, 1781, 1010, 108, 723, 0, 1690, 2810, 3783,
0, 3575, 0, 3907, 0, 0, 0, 0, 0, 270, 0, 0, 0, 2331, 0, 2006,
3770, 0, 0, 1036, 632, 0, 0, 0, 0, 2318, 0, 0, 0, 0, 3878, 1634,
0, 0, 1529, 0, 0, 2716, 0, 0, 0, 0, 1054, 0, 896, 0, 0, 0,
0, 2124, 481, 0, 2613, 0, 912, 0, 0, 3746, 305, 2703, 0, 0, 1175, 1283,
3886, 2628, 0, 92, 0, 0, 0, 0, 1490, 178, 0, 503, 702, 158, 0, 2096,
0, 0, 0, 0, 1670, 1409, 0, 0, 0, 0, 2260, 0, 0, 1825, 0, 1631,
635, 330, 0, 0, 1900, 2157, 3669, 3727, 1122, 2498, 0, 0, 1377, 2971, 321, 1839,
0, 0, 3277, 141, 2528, 0, 0, 227, 1866, 0, 0, 339, 0, 0, 404, 0,
2374, 1075, 2268, 1018, 2103, 0, 0, 0, 0, 0, 922, 0, 0, 2266, 0, 2027,
0, 3904, 0, 654, 0, 484, 2286, 0, 0, 1868, 161, 0, 3515, 255, 1416, 3170,
0, 0, 0, 528, 711, 1932, 0, 0, 0, 0, 288, 0, 3459, 0, 0, 0,
655, 0, 2951, 571, 2357, 0, 0, 0, 0, 0, 0, 0, 2590, 1535, 0, 0,
912, 0, 0, 0, 1011, 821, 0, 0, 1799, 0, 0, 0, 0, 0, 0, 0,
0, 2238, 0, 1591, 0, 3622, 2020, 2798, 0, 0, 0, 3522, 0, 87, 2687, 3437,
0, 0, 0, 0, 3307, 386, 2148, 0, 1410, 0, 0, 3563, 3214, 0, 0, 2854,
3813, 0, 480, 1560, 1760, 0, 0, 871, 0, 0, 0, 2318, 1249, 1689, 1358, 2132,
2163, 2945, 0, 991, 332, 2860, 139, 63, 0, 2621, 2871, 1084, 0, 0, 470, 729,
0, 0, 0, 0, 1442, 485, 3878, 740, 267, 0, 3366, 1, 2026, 0, 0, 214,
914, 2285, 0, 0, 1395, 0, 0, 0, 848, 1362, 0, 1670, 0, 0, 0, 1754,
0, 240, 0, 2923, 803, 0, 3737, 0, 932, 0, 2561, 0, 0, 2481, 0, 1902,
2426, 1238, 2118, 1248, 0, 3123, 0, 3614, 0, 0, 1562, 0, 0, 1264, 0, 0,
2517, 1042, 0, 1322, 1074, 397, 0, 0, 3245, 0, 307, 0, 0, 2735, 0, 0,
0, 2187, 3421, 0, 78, 1464, 0, 2229, 1124, 1620, 0, 1851, 1266, 3861, 3570, 2512,
3721, 0, 2434, 0, 898, 595, 1028, 0, 0, 674, 552, 1303, 107, 0, 2828, 1223,
2115, 488, 1162, 1495, 297, 1451, 0, 1263, 2406, 2547, 3691, 58, 0, 0, 901, 0,
188, 3764, 552, 1100, 2652, 1908, 0, 0, 3509, 2174, 0, 2721, 1608, 3120, 0, 0,
2208, 2502, 0, 0, 0, 141, 0, 0, 3513, 1495, 1346, 0, 0, 0, 3470, 212,
1489, 558, 414, 0, 286, 1218, 0, 0, 1959, 397, 0, 687, 0, 3477, 0, 1961,
0, 1080, 0, 3273, 3838, 2167, 0, 539, 259, 2751, 2004, 591, 1961, 0, 0, 3217,
2929, 0, 55, 1744, 0, 1974, 1200, 3712, 0, 1782, 437, 0, 0, 0, 0, 0,
2641, 1928, 0, 3837, 0, 0, 3330, 2153, 1863, 170, 55, 0, 607, 0, 157, 0,
1080, 622, 0, 0, 2132, 3659, 0, 0, 1926, 327, 1581, 580, 0, 1385, 0, 279,
0, 590, 2185, 0, 0, 3600, 655, 1765, 0, 0, 0, 2349, 0, 1604, 0, 0,
0, 378, 821, 0, 9, 1375, 1667, 787, 0, 0, 1331, 0, 0, 30, 1701, 3175,
0, 0, 520, 3496, 1961, 0, 0, 0, 2421, 328, 0, 0, 0, 705, 0, 196,
649, 0, 2141, 0, 0, 0, 3375, 142, 0, 1235, 467, 1317, 0, 0, 0, 2020,
1310, 1774, 0, 1984, 1970, 1576, 1253, 1666, 5, 0, 0, 0, 0, 3866, 1608, 1022,
2036, 1541, 0, 0, 3463, 2681, 0, 151, 0, 1514, 1431, 0, 0, 657, 2420, 1138,
0, 511, 0, 2862, 0, 0, 2112, 335, 374, 0, 1633, 3431, 2234, 0, 1917, 0,
0, 0, 1463, 0, 1479, 2534, 0, 0, 3101, 3053, 2960, 426, 3640, 2198, 2870, 1132,
3408, 0, 2876, 1012, 0, 0, 0, 0, 3071, 0, 0, 1005, 315, 44, 0, 0,
1002, 1920, 1183, 0, 0, 2613, 2154, 1517, 0, 3444, 0, 3593, 0, 2733, 1891, 3882,
40, 918, 242, 0, 3341, 1565, 2210, 1290, 1846, 3872, 2684, 1526, 58, 815, 1012, 2657,
1402, 0, 0, 0, 84, 2751, 0, 0, 0, 3074, 0, 3785, 1199, 0, 924, 3605,
0, 0, 1074, 0, 3857, 167, 2251, 0, 0, 0, 0, 0, 1650, 1696, 0, 0,
0, 0, 910, 2774, 1579, 643, 0, 1834, 0, 3599, 0, 0, 0, 116, 2817, 754,
0, 0, 0, 3835, 662, 826, 638, 0, 818, 0, 2527, 0, 0, 0, 376, 0,
2114, 0, 523, 2881, 1323, 3508, 293, 830, 2124, 490, 1006, 3688, 0, 3863, 2800, 0,
0, 878, 0, 2214, 0, 0, 210, 1404, 0, 0, 0, 0, 3177, 255, 0, 0,
3673, 540, 1528, 2066, 452, 1568, 1052, 2062, 0, 2630, 2504, 0, 448, 408, 0, 672,
1255, 720, 0, 1607, 1228, 0, 1921, 0, 0, 2585, 0, 34, 0, 0, 1571, 3473,
0, 315, 409, 628, 0, 0, 0, 3006, 1559, 2084, 1538, 1570, 2157, 0, 582, 0,
0, 1519, 0, 1262, 0, 3257, 2850, 0, 0, 1074, 0, 0, 0, 748, 1477, 1600,
0, 0, 0, 2851, 3302, 0, 0, 0, 0, 219, 1185, 2753, 1834, 0, 3303, 0,
2714, 0, 908, 0, 3167, 1033, 1614, 0, 2484, 0, 0, 138, 285, 0, 0, 83,
0, 1725, 1523, 0, 782, 0, 1889, 1651, 2226, 0, 2741, 1363, 1560, 0, 0, 2891,
0, 1451, 0, 493, 0, 2128, 403, 1797, 3240, 1981, 1644, 3337, 260, 39, 614, 1547,
1877, 1072, 1355, 0, 0, 0, 2458, 645, 2145, 181, 1081, 0, 0, 0, 0, 0,
0, 1268, 0, 0, 0, 0, 0, 693, 2656, 326, 0, 689, 582, 2199, 3405, 1820,
1081, 1843, 634, 0, 0, 0, 0, 3336, 0, 3418, 0, 1685, 0, 0, 0, 0,
1697, 2997, 2608, 409, 921, 0, 0, 624, 3482, 0, 0, 1992, 1272, 2445, 0, 0,
1328, 0, 989, 3597, 0, 3585, 3883, 3195, 1598, 0, 0, 1417, 0, 2660, 2003, 0,
0, 0, 0, 1971, 0, 431, 160, 512, 1344, 863, 0, 1273, 1499, 3397, 1480, 0,
0, 0, 3238, 0, 0, 1553, 0, 0, 0, 2065, 0, 143, 733, 910, 1186, 1340,
0, 0, 0, 1678, 0, 0, 736, 0, 2918, 699, 0, 0, 33, 478, 3397, 0,
2897, 2569, 2150, 701, 2982, 3486, 0, 2549, 998, 0, 2305, 412, 149, 1843, 498, 3831,
245, 0, 2317, 1282, 0, 0, 3008, 0, 0, 0, 771, 5, 0, 2406, 481, 333,
0, 3753, 0, 0, 0, 1925, 0, 1245, 2106, 133, 0, 942, 563, 1043, 0, 54,
0, 0, 2897, 3358, 0, 213, 1382, 0, 0, 1246, 0, 0, 3242, 0, 2560, 1193,
1880, 3657, 0, 0, 0, 0, 3103, 1572, 3218, 976, 1336, 1869, 0, 3441, 0, 0,
0, 1761, 0, 475, 3499, 2223, 1580, 3241, 1448, 1505, 340, 2161, 971, 2778, 0, 0,
0, 0, 2277, 1238, 0, 0, 0, 0, 1550, 2419, 3198, 269, 0, 215, 1443, 1331,
0, 0, 0, 0, 312, 1759, 644, 0, 2454, 2484, 0, 1085, 2497, 1881, 0, 733,
2926, 2823, 2087, 0, 3876, 2674, 1042, 1476, 0, 825, 0, 0, 2309, 0, 3179, 1074,
0, 2737, 0, 2037, 164, 1974, 0, 0, 3615, 0, 557, 2285, 543, 0, 3274, 0,
0, 0, 1549, 3418, 3545, 1415, 0, 3788, 927, 3182, 0, 0, 0, 147, 0, 2151,
929, 0, 575, 0, 2082, 0, 0, 0, 2292, 2688, 0, 1215, 2858, 3040, 0, 0,
0, 727, 0, 486, 0, 0, 0, 2010, 0, 3631, 791, 3414, 2056, 0, 0, 0,
0, 0, 320, 0, 1929, 1448, 2701, 867, 44, 0, 827, 8, 0, 2172, 0, 3685,
1006, 1809, 421, 1808, 1618, 2961, 1651, 0, 2796, 0, 0, 276, 0, 141, 0, 0,
0, 1427, 0, 0, 3638, 0, 0, 0, 2652, 1428, 2064, 558, 3346, 0, 0, 0,
1444, 2779, 0, 1502, 0, 0, 7, 523, 3403, 3075, 454, 0, 0, 0, 963, 1610,
1687, 753, 0, 0, 0, 2369, 348, 0, 0, 0, 1220, 3088, 1970, 1862, 0, 2015,
0, 0, 861, 69, 947, 1072, 0, 0, 0, 2095, 1403, 0, 0, 0, 668, 3574,
0, 0, 1587, 0, 2643, 766, 3064, 839, 1646, 1932, 967, 0, 1379, 159, 747, 0,
2986, 0, 1369, 0, 0, 2173, 0, 0, 0, 2164, 2861, 0, 1971, 0, 924, 2951,
1118, 0, 3774, 54, 1008, 0, 3208, 0, 1540, 1133, 0, 1514, 0, 3621, 737, 3311,
0, 0, 0, 0, 0, 235, 1998, 776, 0, 1671, 214, 2035, 0, 0, 0, 0,
500, 0, 191, 0, 0, 3520, 0, 2050, 1952, 3160, 0, 2269, 222, 1112, 229, 716,
140, 0, 1725, 2620, 1604, 3612, 2868, 670, 1860, 1275, 1799, 123, 0, 1244, 2992, 0,
0, 3772, 0, 1911, 0, 2896, 1208, 52, 594, 20, 0, 0, 0, 0, 3813, 673,
543, 521, 2132, 0, 2137, 2681, 0, 496, 2754, 369, 0, 3887, 0, 1005, 1821, 0,
3674, 996, 0, 1672, 1164, 0, 1661, 3564, 564, 0, 151, 2700, 0, 0, 0, 1941,
683, 0, 0, 0, 2105, 0, 1640, 1792, 1356, 2551, 1462, 2050, 0, 823, 646, 0,
91, 0, 0, 2709, 798, 0, 1885, 3777, 0, 1968, 2045, 3416, 3606, 1968, 3614, 2815,
54, 2233, 0, 0, 0, 2119, 1871, 0, 1299, 217, 0, 0, 0, 753, 0, 0,
1621, 2166, 2026, 778, 1997, 732, 2396, 0, 0, 310, 882, 1292, 0, 886, 3716, 3263,
338, 0, 0, 0, 0, 3015, 3108, 2660, 1977, 0, 776, 1231, 0, 550, 432, 1992,
276, 0, 0, 0, 0, 0, 2115, 2554, 2917, 915, 1098, 0, 439, 0, 630, 2970,
0, 626, 2180, 1762, 0, 966, 66, 760, 1864, 1993, 951, 357, 0, 0, 1268, 0,
0, 259, 0, 0, 3066, 2879, 0, 0, 1747, 3380, 0, 1650, 352, 2055, 626, 1650,
0, 2663, 0, 0, 102, 0, 2088, 0, 1340, 3313, 1109, 650, 0, 0, 0, 2916,
3143, 972, 1052, 2786, 0, 0, 1334, 1546, 672, 381, 3707, 2004, 0, 3114, 1348, 0,
55, 0, 2183, 0, 2973, 1513, 1206, 0, 742, 2276, 0, 2719, 0, 0, 315, 0,
0, 1075, 684, 3143, 3873, 3825, 1541, 1932, 0, 1638, 0, 0, 0, 3215, 3824, 2212,
2929, 560, 748, 0, 1287, 3340, 410, 2005, 1419, 3408, 2366, 0, 0, 0, 2126, 3536,
1576, 1016, 0, 3899, 0, 593, 2370, 0, 0, 2878, 0, 40, 1304, 1411, 0, 816,
3294, 0, 2800, 0, 3428, 578, 3641, 3056, 129, 3496, 709, 2110, 0, 0, 1387, 69,
873, 3302, 3226, 0, 1736, 3183, 566, 531, 0, 3203, 687, 3338, 0, 202, 2062, 0,
0, 895, 0, 0, 1546, 0, 1288, 2919, 1815, 0, 0, 1287, 0, 3736, 1315, 266,
821, 2741, 33, 0, 3497, 0, 1059, 3896, 0, 0, 0, 1379, 1597, 118, 1255, 3567,
3067, 0, 3673, 1079, 0, 275, 1694, 51, 3858, 0, 353, 2263, 0, 3597, 1664, 381,
1902, 0, 2133, 1741, 898, 0, 1995, 0, 0, 0, 0, 843, 1864, 3428, 2262, 3349,
0, 2645, 1507, 725, 210, 258, 2887, 0, 681, 2731, 17, 948, 0, 2977, 0, 2370,
3597, 349, 2424, 2150, 3421, 2596, 1164, 210, 2153, 53, 1962, 471, 99, 2018, 1728, 0,
0, 2155, 2013, 595, 3828, 2895, 2329, 984, 0, 204, 453, 1341, 1667, 3773, 0, 1817,
0, 3108, 3707, 1093, 508, 349, 578, 0, 2159, 0, 0, 974, 2466, 3540, 0, 856,
3793, 1704, 1090, 0, 1657, 470, 0, 0, 1637, 2749, 0, 2442, 3890, 1344, 356, 0,
63, 2310, 1212, 0, 0, 1520, 2167, 1233, 0, 0, 2035, 2484, 3569, 2255, 0, 0,
2198, 3562, 0, 927, 1927, 1159, 0, 3827, 1770, 973, 2030, 0, 3891, 0, 0, 2649,
354, 0, 0, 2788, 0, 2069, 0, 52, 0, 508, 0, 418, 1919, 2246, 884, 1128,
571, 1174, 1465, 1946, 1264, 3418, 527, 0, 0, 0, 1243, 481, 0, 836, 2770, 1577,
2660, 3473, 0, 0, 71, 3828, 1713, 0, 1228, 2355, 1192, 0, 1790, 738, 0, 3738,
3650, 0, 73, 0, 1702, 1863, 0, 617, 0, 0, 1530, 0, 2405, 1775, 929, 0,
0, 0, 2080, 2768, 0, 3012, 0, 935, 0, 0, 0, 1003, 0, 3536, 0, 1845,
3873, 3629, 967, 0, 1653, 1452, 2371, 0, 0, 116, 1012, 2871, 0, 0, 855, 3097,
0, 208, 2550, 0, 2060, 0, 0, 861, 3686, 1367, 3365, 0, 0, 0, 84, 0,
1296, 1430, 1322, 0, 0, 0, 1698, 2567, 1659, 533, 3172, 3401, 23, 3182, 0, 1090,
1740, 1020, 0, 0, 0, 0, 0, 1681, 427, 2766, 2834, 2909, 1449, 197, 0, 877,
285, 3718, 162, 567, 1071, 75, 3783, 0, 635, 0, 2080, 1818, 0, 0, 2750, 0,
255, 351, 0, 0, 1196, 0, 1084, 0, 810, 2790, 0, 2276, 0, 3083, 2887, 0,
1301, 617, 3341, 1907, 2568, 2996, 946, 3338, 0, 1090, 898, 521, 0, 1203, 1921, 0,
2995, 0, 2073, 0, 3755, 0, 2973, 0, 742, 3720, 1032, 493, 42, 2256, 0, 0,
1189, 2243, 904, 0, 0, 0, 0, 532, 310, 2242, 0, 2165, 0, 3791, 0, 2406,
0, 0, 1277, 774, 1326, 662, 0, 505, 1959, 3652, 594, 999, 1303, 0, 1756, 0,
1077, 1337, 2229, 2158, 0, 0, 1816, 0, 348, 1764, 1873, 3387, 3181, 49, 1999, 0,
929, 82, 0, 0, 0, 1000, 1311, 3475, 507, 1749, 798, 1128, 0, 2962, 1515, 422,
1931, 256, 0, 0, 1089, 0, 392, 0, 190, 0, 0, 2007, 0, 2846, 2930, 1950,
0, 940, 0, 3178, 3521, 1228, 1240, 0, 515, 746, 0, 1097, 404, 1554, 3192, 388,
3497, 715, 1118, 3907, 2484, 1613, 786, 852, 24, 0, 1019, 0, 3664, 0, 81, 0,
1065, 1587, 1434, 0, 1032, 3497, 1920, 2071, 251, 1394, 0, 3717, 235, 0, 0, 3880,
323, 0, 0, 182, 0, 2350, 210, 56, 1538, 1135, 819, 2434, 423, 2662, 1661, 0,
0, 190, 0, 2191, 0, 1829, 3781, 703, 14, 0, 0, 3759, 2941, 0, 968, 0,
1718, 0, 2519, 3033, 1851, 797, 2103, 2602, 2372, 0, 0, 0, 0, 3672, 0, 3417,
0, 1068, 758, 3885, 0, 3359, 157, 0, 1456, 1946, 2636, 0, 984, 3785, 3502, 2470,
2911, 273, 361, 187, 559, 1561, 754, 1164, 0, 1829, 131, 0, 2173, 0, 0, 429,
1648, 3554, 0, 0, 0, 0, 0, 2723, 1456, 2893, 0, 3325, 920, 0, 1278, 1415,
870, 0, 1202, 301, 0, 0, 2119, 0, 2843, 0, 865, 1455, 3408, 1013, 0, 3761,
2880, 1846, 0, 1986, 1336, 0, 0, 0, 3325, 679, 2137, 0, 747, 61, 0, 3632,
724, 1253, 1210, 0, 1026, 543, 1075, 2140, 1769, 1444, 898, 728, 3618, 3121, 1167, 0,
0, 1207, 0, 832, 3100, 2689, 0, 0, 0, 0, 0, 1148, 1496, 0, 1068, 379,
2170, 1804, 3492, 462, 3818, 0, 1488, 1143, 1894, 1053, 0, 2106, 2699, 986, 0, 1591,
3767, 1635, 420, 2928, 0, 0, 0, 0, 0, 194, 0, 553, 0, 1270, 0, 1388,
1274, 2357, 159, 1175, 0, 2959, 2994, 0, 1557, 0, 398, 3809, 946, 1030, 0, 1274,
0, 870, 0, 2234, 3167, 0, 2329, 0, 1596, 0, 0, 57, 1748, 1362, 3827, 1303,
0, 0, 0, 3452, 0, 1579, 2160, 1638, 3335, 451, 1783, 1139, 2761, 463, 602, 0,
1461, 0, 1261, 146, 0, 612, 0, 0, 1987, 846, 3795, 211, 598, 0, 0, 979,
0, 0, 2009, 2219, 53, 2346, 3000, 658, 624, 698, 0, 3845, 2293, 0, 0, 0,
1642, 0, 0, 711, 2977, 2381, 470, 2439, 14, 1300, 0, 3020, 654, 0, 1307, 541,
467, 322, 966, 0, 3758, 3079, 0, 0, 646, 594, 2445, 0, 0, 282, 0, 1600,
0, 660, 430, 1050, 2570, 2336, 1306, 0, 0, 2560, 227, 0, 3467, 1714, 1026, 3810,
0, 2372, 0, 0, 1855, 0, 0, 1725, 3572, 3321, 0, 0, 0, 72, 448, 0,
1816, 0, 1048, 3814, 2844, 0, 0, 1786, 2735, 1808, 2014, 703, 0, 0, 0, 0,
499, 687, 3740, 0, 803, 3524, 447, 747, 456, 3216, 1880, 2958, 0, 103, 341, 812,
3732, 0, 216, 441, 1629, 1804, 1117, 0, 2048, 0, 0, 253, 1574, 177, 1932, 648,
1705, 0, 0, 1780, 3640, 236, 0, 3881, 2044, 1761, 552, 983, 465, 3346, 1482, 1918,
633, 1984, 2185, 2179, 996, 580, 1853, 387, 2568, 0, 1221, 0, 1881, 3433, 962, 3650,
1942, 0, 351, 0, 0, 0, 0, 2090, 0, 1138, 0, 1539, 1706, 127, 0, 958,
1263, 3282, 1796, 280, 0, 692, 0, 1164, 463, 2582, 0, 722, 0, 0, 0, 3517,
0, 0, 311, 1146, 2765, 0, 353, 252, 0, 0, 0, 0, 580, 0, 0, 3907,
420, 2946, 0, 2534, 1985, 596, 74, 10, 0, 0, 0, 0, 0, 1914, 0, 3602,
2121, 0, 0, 3874, 0, 1719, 507, 1037, 0, 0, 532, 0, 1720, 958, 700, 2964,
405, 0, 0, 0, 1373, 576, 204, 1618, 0, 0, 0, 0, 478, 2877, 104, 966,
0, 3745, 839, 526, 0, 66, 1675, 0, 1136, 3165, 1399, 2593, 0, 41, 783, 0,
0, 1271, 636, 0, 1738, 1800, 0, 2813, 530, 1144, 692, 1594, 797, 1260, 2077, 0,
0, 0, 0, 0, 2201, 2617, 1101, 29, 0, 3363, 474, 0, 0, 833, 980, 0,
623, 1926, 2010, 602, 0, 373, 1501, 784, 1252, 601, 1760, 0, 1921, 0, 0, 1690,
0, 549, 321, 0, 0, 1382, 1924, 869, 1, 717, 1573, 1272, 840, 67, 1776, 827,
246, 397, 1012, 206, 3230, 0, 557, 0, 1454, 0, 2327, 3180, 3134, 2236, 3342, 1649,
1942, 3752, 0, 0, 238, 510, 1887, 2231, 3144, 309, 1591, 0, 3625, 0, 1143, 0,
794, 0, 0, 0, 0, 0, 514, 0, 0, 0, 1699, 1158, 1604, 226, 0, 3901,
0, 1753, 3618, 1600, 2160, 719, 658, 0, 0, 2870, 1425, 555, 0, 321, 0, 0,
1282, 1168, 0, 0, 0, 0, 3295, 1959, 0, 3542, 825, 3888, 0, 2118, 0, 0,
513, 3796, 944, 1189, 2590, 0, 0, 3440, 0, 99, 0, 1078, 2205, 0, 0, 560,
3491, 562, 864, 0, 851, 3573, 1087, 0, 1405, 0, 1024, 1590, 0, 75, 3130, 0,
1195, 0, 784, 0, 0, 0};
int MangledHashG(const char *key, const int *T)
{
@ -322,45 +288,46 @@ int MangledHashG(const char *key, const int *T)
for (int i = 0; key[i] != '\0'; i++)
{
sum += T[i] * key[i];
sum %= 4455;
sum %= 3910;
}
return mangledkG[sum];
}
int MangledPerfectHash(const char *key)
{
if (strlen(key) > 37)
if (strlen(key) > 40)
return 0;
return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 4455;
return (MangledHashG(key, mangledkT1) + MangledHashG(key, mangledkT2)) % 3910;
}
constexpr int unmangledkT1[] = {152, 85, 131, 46, 141, 140, 355, 227, 157, 95, 193, 274, 113,
293, 338, 312, 38, 56, 305, 7, 299, 103, 63, 14, 147, 26};
constexpr int unmangledkT2[] = {16, 254, 132, 341, 351, 23, 144, 38, 280, 327, 291, 81, 145,
376, 164, 258, 319, 373, 246, 29, 53, 104, 148, 299, 8, 288};
constexpr int unmangledkT1[] = {361, 84, 287, 107, 189, 235, 216, 268, 315, 73, 365, 67, 31,
103, 108, 1, 206, 276, 63, 133, 161, 27, 70, 359, 69, 354};
constexpr int unmangledkT2[] = {116, 270, 65, 391, 92, 345, 246, 10, 306, 20, 206, 346, 291,
195, 244, 398, 269, 237, 25, 394, 247, 248, 315, 180, 233, 167};
constexpr int unmangledkG[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 340, 0, 0, 207, 0, 0, 0, 0, 155,
106, 0, 305, 0, 0, 8, 0, 0, 0, 0, 0, 195, 0, 252, 0, 0, 0, 84, 0,
0, 0, 179, 24, 0, 0, 0, 0, 0, 54, 317, 0, 288, 264, 8, 0, 0, 342, 0,
0, 0, 122, 0, 0, 365, 135, 361, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0, 0,
212, 0, 0, 152, 0, 25, 0, 134, 0, 167, 0, 0, 0, 355, 92, 0, 265, 374, 0,
92, 0, 102, 0, 158, 152, 0, 0, 0, 0, 0, 288, 32, 0, 139, 0, 103, 365, 296,
0, 66, 0, 370, 122, 149, 0, 0, 0, 0, 0, 349, 148, 191, 281, 172, 0, 374, 0,
0, 0, 148, 0, 357, 272, 0, 115, 50, 0, 142, 11, 0, 0, 367, 49, 223, 54, 0,
0, 0, 171, 84, 130, 0, 252, 0, 0, 85, 0, 116, 0, 0, 0, 0, 119, 270, 296,
23, 71, 180, 59, 216, 284, 73, 0, 0, 0, 63, 0, 236, 115, 71, 171, 4, 0, 369,
0, 0, 0, 267, 330, 90, 133, 81, 39, 0, 378, 190, 23, 346, 0, 0, 176, 0, 119,
0, 0, 0, 0, 0, 0, 12, 298, 248, 97, 0, 34, 0, 53, 80, 247, 150, 387, 88,
21, 0, 183, 341, 23, 363, 0, 14, 143, 111, 26, 0, 40, 28, 46, 0, 0, 165, 182,
0, 0, 19, 0, 0, 0, 0, 235, 209, 305, 74, 339, 198, 14, 0, 200, 250, 35, 190,
22, 194, 0, 122, 66, 167, 0, 0, 135, 0, 0, 201, 0, 157, 0, 255, 163, 339, 73,
0, 271, 0, 0, 0, 101, 0, 0, 182, 0, 27, 364, 0, 87, 20, 0, 385, 383, 33,
0, 0, 128, 0, 213, 232, 74, 150, 8, 16, 244, 0, 0, 55, 5, 72, 189, 186, 0,
17, 116, 378, 55, 352, 148, 0, 285, 0, 123, 0, 43, 0, 0, 0, 305, 240, 0, 131,
0, 69, 185, 174, 0, 34, 70, 378, 170, 104, 208, 281, 118, 0, 260, 173, 0, 0, 166,
6, 30, 0, 254, 214, 204, 0, 0, 153, 0, 67, 368, 121, 2, 0, 139, 193, 0, 0,
285, 325, 0, 0, 0, 0, 0, 96};
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 34, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 42, 391, 0, 0, 0, 0, 7, 0, 187, 0, 64, 237,
350, 377, 112, 192, 0, 217, 0, 133, 0, 0, 0, 0, 0, 384, 0, 0, 0, 0, 0,
122, 0, 107, 0, 283, 276, 9, 317, 215, 0, 147, 167, 232, 169, 15, 0, 0, 247, 25,
348, 0, 364, 68, 195, 0, 345, 0, 0, 154, 31, 0, 0, 180, 0, 0, 342, 321, 0,
0, 0, 0, 2, 244, 73, 61, 0, 0, 259, 0, 51, 178, 0, 0, 12, 28, 202, 0,
113, 144, 0, 0, 0, 196, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 309, 0, 232, 56, 0, 315, 358, 0, 0, 0, 341, 21, 360, 0, 0, 0, 0, 0,
46, 0, 325, 17, 11, 272, 0, 0, 126, 401, 0, 85, 40, 305, 0, 0, 0, 0, 0,
0, 0, 7, 201, 56, 142, 405, 0, 0, 0, 339, 164, 0, 192, 0, 109, 206, 60, 40,
0, 0, 243, 17, 0, 145, 0, 163, 88, 0, 0, 0, 128, 0, 117, 0, 0, 0, 257,
285, 0, 16, 0, 191, 0, 0, 12, 0, 339, 71, 323, 21, 99, 0, 0, 187, 0, 22,
167, 274, 0, 258, 0, 0, 0, 17, 30, 0, 0, 0, 181, 218, 0, 0, 109, 0, 212,
154, 332, 54, 259, 0, 0, 0, 319, 14, 149, 82, 50, 0, 0, 15, 218, 0, 0, 0,
0, 123, 0, 218, 162, 0, 50, 226, 219, 0, 86, 120, 310, 197, 101, 0, 0, 0, 0,
127, 1, 207, 86, 0, 0, 0, 377, 0, 8, 75, 0, 0, 395, 106, 374, 0, 197, 0,
356, 179, 297, 0, 3, 70, 0, 164, 7, 0, 0, 136, 0, 250, 193, 0, 52, 319, 248,
0, 357, 112, 0, 77, 0, 0, 0, 230, 136, 81, 101, 0, 217, 0, 0, 0, 37, 0,
172, 0, 0, 0, 14, 175, 0, 53, 361, 0, 134, 191, 304, 43, 0, 0, 198, 0, 82,
0, 336, 0, 0, 0, 338, 280, 0, 386, 360, 8, 139, 87, 30, 281, 0, 0, 0, 11,
262, 389, 301, 236, 36, 190, 150, 0, 0, 0, 325, 0, 388, 0, 155, 33, 379, 6, 4,
0, 165, 129, 214, 369, 0, 0, 17};
int UnmangledHashG(const char *key, const int *T)
{
@ -369,7 +336,7 @@ int UnmangledHashG(const char *key, const int *T)
for (int i = 0; key[i] != '\0'; i++)
{
sum += T[i] * key[i];
sum %= 388;
sum %= 407;
}
return unmangledkG[sum];
}
@ -379,7 +346,7 @@ int UnmangledPerfectHash(const char *key)
if (strlen(key) > 26)
return 0;
return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 388;
return (UnmangledHashG(key, unmangledkT1) + UnmangledHashG(key, unmangledkT2)) % 407;
}
} // namespace

Просмотреть файл

@ -9,6 +9,7 @@
#include <math.h>
#include <stdlib.h>
#include "GLSLANG/ShaderLang.h"
#include "compiler/translator/Common.h"
#include "compiler/translator/Severity.h"
@ -103,17 +104,39 @@ class TInfoSinkBase
return *this;
}
void erase() { sink.clear(); }
int size() { return static_cast<int>(sink.size()); }
void erase()
{
sink.clear();
binarySink.clear();
}
int size() { return static_cast<int>(isBinary() ? binarySink.size() : sink.size()); }
const TPersistString &str() const { return sink; }
const char *c_str() const { return sink.c_str(); }
const TPersistString &str() const
{
ASSERT(!isBinary());
return sink;
}
const char *c_str() const
{
ASSERT(!isBinary());
return sink.c_str();
}
void prefix(Severity severity);
void location(int file, int line);
bool isBinary() const { return !binarySink.empty(); }
void setBinary(BinaryBlob &&binary) { binarySink = std::move(binary); }
const BinaryBlob &getBinary() const
{
ASSERT(isBinary());
return binarySink;
}
private:
// The data in the info sink is either in human readable form (|sink|) or binary (|binarySink|).
TPersistString sink;
BinaryBlob binarySink;
};
class TInfoSink

Просмотреть файл

@ -53,6 +53,10 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior[TExtension::EXT_shader_framebuffer_fetch] = EBhUndefined;
}
if (resources.EXT_shader_framebuffer_fetch_non_coherent)
{
extBehavior[TExtension::EXT_shader_framebuffer_fetch_non_coherent] = EBhUndefined;
}
if (resources.NV_shader_framebuffer_fetch)
{
extBehavior[TExtension::NV_shader_framebuffer_fetch] = EBhUndefined;
@ -81,6 +85,14 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior[TExtension::EXT_geometry_shader] = EBhUndefined;
}
if (resources.OES_shader_io_blocks)
{
extBehavior[TExtension::OES_shader_io_blocks] = EBhUndefined;
}
if (resources.EXT_shader_io_blocks)
{
extBehavior[TExtension::EXT_shader_io_blocks] = EBhUndefined;
}
if (resources.EXT_gpu_shader5)
{
extBehavior[TExtension::EXT_gpu_shader5] = EBhUndefined;
@ -137,6 +149,10 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior[TExtension::OES_shader_image_atomic] = EBhUndefined;
}
if (resources.EXT_tessellation_shader)
{
extBehavior[TExtension::EXT_tessellation_shader] = EBhUndefined;
}
if (resources.OES_texture_buffer)
{
extBehavior[TExtension::OES_texture_buffer] = EBhUndefined;
@ -145,6 +161,14 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior[TExtension::EXT_texture_buffer] = EBhUndefined;
}
if (resources.OES_sample_variables)
{
extBehavior[TExtension::OES_sample_variables] = EBhUndefined;
}
if (resources.EXT_clip_cull_distance)
{
extBehavior[TExtension::EXT_clip_cull_distance] = EBhUndefined;
}
}
void ResetExtensionBehavior(const ShBuiltInResources &resources,
@ -157,7 +181,7 @@ void ResetExtensionBehavior(const ShBuiltInResources &resources,
}
if (resources.ARB_texture_rectangle)
{
if (compileOptions & SH_DISABLE_ARB_TEXTURE_RECTANGLE)
if ((compileOptions & SH_DISABLE_ARB_TEXTURE_RECTANGLE) != 0)
{
// Remove ARB_texture_rectangle so it can't be enabled by extension directives.
extBehavior.erase(TExtension::ARB_texture_rectangle);

Просмотреть файл

@ -413,6 +413,9 @@ TIntermBlock::TIntermBlock(const TIntermBlock &node)
{
mStatements.push_back(node->deepCopy());
}
ASSERT(!node.mIsTreeRoot);
mIsTreeRoot = false;
}
size_t TIntermBlock::getChildCount() const
@ -430,6 +433,12 @@ bool TIntermBlock::replaceChildNode(TIntermNode *original, TIntermNode *replacem
return replaceChildNodeInternal(original, replacement);
}
void TIntermBlock::replaceAllChildren(const TIntermSequence &newStatements)
{
mStatements.clear();
mStatements.insert(mStatements.begin(), newStatements.begin(), newStatements.end());
}
size_t TIntermFunctionPrototype::getChildCount() const
{
return 0;
@ -461,6 +470,14 @@ bool TIntermDeclaration::replaceChildNode(TIntermNode *original, TIntermNode *re
return replaceChildNodeInternal(original, replacement);
}
TIntermDeclaration::TIntermDeclaration(const TIntermDeclaration &node)
{
for (TIntermNode *node : node.mDeclarators)
{
mDeclarators.push_back(node->deepCopy());
}
}
bool TIntermAggregateBase::replaceChildNodeInternal(TIntermNode *original, TIntermNode *replacement)
{
for (size_t ii = 0; ii < getSequence()->size(); ++ii)
@ -1040,9 +1057,9 @@ TIntermAggregate::TIntermAggregate(const TIntermAggregate &node)
TIntermAggregate *TIntermAggregate::shallowCopy() const
{
TIntermSequence *copySeq = new TIntermSequence();
copySeq->insert(copySeq->begin(), getSequence()->begin(), getSequence()->end());
TIntermAggregate *copyNode = new TIntermAggregate(mFunction, mType, mOp, copySeq);
TIntermSequence copySeq;
copySeq.insert(copySeq.begin(), getSequence()->begin(), getSequence()->end());
TIntermAggregate *copyNode = new TIntermAggregate(mFunction, mType, mOp, &copySeq);
copyNode->setLine(mLine);
return copyNode;
}

Просмотреть файл

@ -673,7 +673,7 @@ class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
class TIntermBlock : public TIntermNode, public TIntermAggregateBase
{
public:
TIntermBlock() : TIntermNode() {}
TIntermBlock() : TIntermNode(), mIsTreeRoot(false) {}
~TIntermBlock() override {}
TIntermBlock *getAsBlock() override { return this; }
@ -683,6 +683,7 @@ class TIntermBlock : public TIntermNode, public TIntermAggregateBase
size_t getChildCount() const final;
TIntermNode *getChildNode(size_t index) const final;
bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
void replaceAllChildren(const TIntermSequence &newStatements);
// Only intended for initially building the block.
void appendStatement(TIntermNode *statement);
@ -693,9 +694,16 @@ class TIntermBlock : public TIntermNode, public TIntermAggregateBase
TIntermBlock *deepCopy() const override { return new TIntermBlock(*this); }
void setIsTreeRoot() { mIsTreeRoot = true; }
bool isTreeRoot() const { return mIsTreeRoot; }
protected:
TIntermSequence mStatements;
// Used to distinguish the tree root from the other blocks. When validating the AST, some
// validations are not applicable if not run on the entire tree and are thus skipped.
bool mIsTreeRoot;
private:
TIntermBlock(const TIntermBlock &);
};
@ -793,13 +801,23 @@ class TIntermDeclaration : public TIntermNode, public TIntermAggregateBase
TIntermSequence *getSequence() override { return &mDeclarators; }
const TIntermSequence *getSequence() const override { return &mDeclarators; }
TIntermNode *deepCopy() const override
TIntermDeclaration *deepCopy() const override
{
UNREACHABLE();
return nullptr;
// Note: This is only useful as support for deepCopy of TIntermBlock and TIntermLoop, but is
// not sufficient as it will be redeclaring the same TVariable. If a function body is
// duplicated for example, it means that both functions reference the same TVariable pointer
// which works, but is technically not correct. In particular, maps with TVariable * as key
// can get confused.
//
// After deepCopy() is issued, ReplaceVariables must be used to replace every declared
// variable with a duplicate. This is NOT automatically done when deepCopy-ing TIntermBlock
// and TIntermLoop nodes.
return new TIntermDeclaration(*this);
}
protected:
TIntermDeclaration(const TIntermDeclaration &node);
TIntermSequence mDeclarators;
};

Просмотреть файл

@ -258,8 +258,7 @@ void TOutputGLSLBase::writeLayoutQualifier(TIntermTyped *variable)
if (type.getBasicType() == EbtInterfaceBlock)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
declareInterfaceBlockLayout(interfaceBlock);
declareInterfaceBlockLayout(type);
return;
}
@ -396,8 +395,8 @@ void TOutputGLSLBase::writeVariableType(const TType &type,
out << getMemoryQualifiers(type);
}
// Declare the struct if we have not done so already.
if (type.getBasicType() == EbtStruct && !structDeclared(type.getStruct()))
// Declare the struct.
if (type.isStructSpecifier())
{
const TStructure *structure = type.getStruct();
@ -405,8 +404,7 @@ void TOutputGLSLBase::writeVariableType(const TType &type,
}
else if (type.getBasicType() == EbtInterfaceBlock)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
declareInterfaceBlock(interfaceBlock);
declareInterfaceBlock(type);
}
else
{
@ -1091,9 +1089,10 @@ bool TOutputGLSLBase::visitDeclaration(Visit visit, TIntermDeclaration *node)
const TIntermSequence &sequence = *(node->getSequence());
TIntermTyped *variable = sequence.front()->getAsTyped();
TIntermSymbol *symbolNode = variable->getAsSymbolNode();
if (!symbolNode || symbolNode->getName() != "gl_ClipDistance")
if (!symbolNode || (symbolNode->getName() != "gl_ClipDistance" &&
symbolNode->getName() != "gl_CullDistance"))
{
// gl_ClipDistance re-declaration doesn't need layout.
// gl_Clip/CullDistance re-declaration doesn't need layout.
writeLayoutQualifier(variable);
}
writeVariableType(variable->getType(), symbolNode ? &symbolNode->variable() : nullptr,
@ -1280,17 +1279,6 @@ ImmutableString TOutputGLSLBase::hashFunctionNameIfNeeded(const TFunction *func)
}
}
bool TOutputGLSLBase::structDeclared(const TStructure *structure) const
{
ASSERT(structure);
if (structure->symbolType() == SymbolType::Empty)
{
return false;
}
return (mDeclaredStructs.count(structure->uniqueId().get()) > 0);
}
void TOutputGLSLBase::declareStruct(const TStructure *structure)
{
TInfoSinkBase &out = objSink();
@ -1314,16 +1302,20 @@ void TOutputGLSLBase::declareStruct(const TStructure *structure)
out << ";\n";
}
out << "}";
if (structure->symbolType() != SymbolType::Empty)
{
mDeclaredStructs.insert(structure->uniqueId().get());
}
}
void TOutputGLSLBase::declareInterfaceBlockLayout(const TInterfaceBlock *interfaceBlock)
void TOutputGLSLBase::declareInterfaceBlockLayout(const TType &type)
{
TInfoSinkBase &out = objSink();
// 4.4.5 Uniform and Shader Storage Block Layout Qualifiers in GLSL 4.5 spec.
// Layout qualifiers can be used for uniform and shader storage blocks,
// but not for non-block uniform declarations.
if (IsShaderIoBlock(type.getQualifier()))
{
return;
}
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
TInfoSinkBase &out = objSink();
out << "layout(";
@ -1361,20 +1353,56 @@ void TOutputGLSLBase::declareInterfaceBlockLayout(const TInterfaceBlock *interfa
out << ") ";
}
void TOutputGLSLBase::declareInterfaceBlock(const TInterfaceBlock *interfaceBlock)
const char *getVariableInterpolation(TQualifier qualifier)
{
TInfoSinkBase &out = objSink();
switch (qualifier)
{
case EvqSmoothOut:
return "smooth out ";
case EvqFlatOut:
return "flat out ";
case EvqNoPerspectiveOut:
return "noperspective out ";
case EvqCentroidOut:
return "centroid out ";
case EvqSmoothIn:
return "smooth in ";
case EvqFlatIn:
return "flat in ";
case EvqNoPerspectiveIn:
return "noperspective in ";
case EvqCentroidIn:
return "centroid in ";
default:
break;
}
return nullptr;
}
void TOutputGLSLBase::declareInterfaceBlock(const TType &type)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
TInfoSinkBase &out = objSink();
out << hashName(interfaceBlock) << "{\n";
const TFieldList &fields = interfaceBlock->fields();
for (const TField *field : fields)
{
writeFieldLayoutQualifier(field);
if (!IsShaderIoBlock(type.getQualifier()) && type.getQualifier() != EvqPatchIn &&
type.getQualifier() != EvqPatchOut)
{
writeFieldLayoutQualifier(field);
}
out << getMemoryQualifiers(*field->type());
if (writeVariablePrecision(field->type()->getPrecision()))
out << " ";
const char *qualifier = getVariableInterpolation(field->type()->getQualifier());
if (qualifier != nullptr)
out << qualifier;
out << getTypeName(*field->type()) << " " << hashFieldName(field);
if (field->type()->isArray())
out << ArrayString(*field->type());
out << ";\n";
@ -1430,6 +1458,40 @@ void WriteGeometryShaderLayoutQualifiers(TInfoSinkBase &out,
}
}
void WriteTessControlShaderLayoutQualifiers(TInfoSinkBase &out, int inputVertices)
{
if (inputVertices != 0)
{
out << "layout (vertices = " << inputVertices << ") out;\n";
}
}
void WriteTessEvaluationShaderLayoutQualifiers(TInfoSinkBase &out,
sh::TLayoutTessEvaluationType inputPrimitive,
sh::TLayoutTessEvaluationType inputVertexSpacing,
sh::TLayoutTessEvaluationType inputOrdering,
sh::TLayoutTessEvaluationType inputPoint)
{
if (inputPrimitive != EtetUndefined)
{
out << "layout (";
out << getTessEvaluationShaderTypeString(inputPrimitive);
if (inputVertexSpacing != EtetUndefined)
{
out << ", " << getTessEvaluationShaderTypeString(inputVertexSpacing);
}
if (inputOrdering != EtetUndefined)
{
out << ", " << getTessEvaluationShaderTypeString(inputOrdering);
}
if (inputPoint != EtetUndefined)
{
out << ", " << getTessEvaluationShaderTypeString(inputPoint);
}
out << ") in;\n";
}
}
// If SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS is enabled, layout qualifiers are spilled whenever
// variables with specified layout qualifiers are copied. Additional checks are needed against the
// type and storage qualifier of the variable to verify that layout qualifiers have to be outputted.

Просмотреть файл

@ -89,24 +89,20 @@ class TOutputGLSLBase : public TIntermTraverser
void declareStruct(const TStructure *structure);
void writeQualifier(TQualifier qualifier, const TType &type, const TSymbol *symbol);
bool structDeclared(const TStructure *structure) const;
const char *mapQualifierToString(TQualifier qualifier);
sh::GLenum getShaderType() { return mShaderType; }
private:
void declareInterfaceBlockLayout(const TInterfaceBlock *interfaceBlock);
void declareInterfaceBlock(const TInterfaceBlock *interfaceBlock);
void declareInterfaceBlockLayout(const TType &type);
void declareInterfaceBlock(const TType &type);
void writeBuiltInFunctionTriplet(Visit visit, TOperator op, bool useEmulatedFunction);
TInfoSinkBase &mObjSink;
bool mDeclaringVariable;
// This set contains all the ids of the structs from every scope.
std::set<int> mDeclaredStructs;
ShArrayIndexClampingStrategy mClampingStrategy;
// name hashing.
@ -129,6 +125,14 @@ void WriteGeometryShaderLayoutQualifiers(TInfoSinkBase &out,
sh::TLayoutPrimitiveType outputPrimitive,
int maxVertices);
void WriteTessControlShaderLayoutQualifiers(TInfoSinkBase &out, int inputVertices);
void WriteTessEvaluationShaderLayoutQualifiers(TInfoSinkBase &out,
sh::TLayoutTessEvaluationType inputPrimitive,
sh::TLayoutTessEvaluationType inputVertexSpacing,
sh::TLayoutTessEvaluationType inputOrdering,
sh::TLayoutTessEvaluationType inputPoint);
bool NeedsToWriteLayoutQualifier(const TType &type);
} // namespace sh

Просмотреть файл

@ -24,7 +24,7 @@
#include "compiler/translator/TranslatorHLSL.h"
#include "compiler/translator/UtilsHLSL.h"
#include "compiler/translator/blocklayout.h"
#include "compiler/translator/tree_ops/RemoveSwitchFallThrough.h"
#include "compiler/translator/tree_ops/d3d/RemoveSwitchFallThrough.h"
#include "compiler/translator/tree_util/FindSymbolNode.h"
#include "compiler/translator/tree_util/NodeSearch.h"
#include "compiler/translator/util.h"
@ -297,22 +297,21 @@ const TConstantUnion *OutputHLSL::writeConstantUnionArray(TInfoSinkBase &out,
return constUnionIterated;
}
OutputHLSL::OutputHLSL(
sh::GLenum shaderType,
ShShaderSpec shaderSpec,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
int maxDualSourceDrawBuffers,
const std::vector<ShaderVariable> &uniforms,
ShCompileOptions compileOptions,
sh::WorkGroupSize workGroupSize,
TSymbolTable *symbolTable,
PerformanceDiagnostics *perfDiagnostics,
const std::map<int, const TInterfaceBlock *> &uniformBlocksTranslatedToStructuredBuffers,
const std::vector<InterfaceBlock> &shaderStorageBlocks)
OutputHLSL::OutputHLSL(sh::GLenum shaderType,
ShShaderSpec shaderSpec,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
int maxDualSourceDrawBuffers,
const std::vector<ShaderVariable> &uniforms,
ShCompileOptions compileOptions,
sh::WorkGroupSize workGroupSize,
TSymbolTable *symbolTable,
PerformanceDiagnostics *perfDiagnostics,
const std::map<int, const TInterfaceBlock *> &uniformBlockOptimizedMap,
const std::vector<InterfaceBlock> &shaderStorageBlocks)
: TIntermTraverser(true, true, true, symbolTable),
mShaderType(shaderType),
mShaderSpec(shaderSpec),
@ -323,7 +322,7 @@ OutputHLSL::OutputHLSL(
mCompileOptions(compileOptions),
mInsideFunction(false),
mInsideMain(false),
mUniformBlocksTranslatedToStructuredBuffers(uniformBlocksTranslatedToStructuredBuffers),
mUniformBlockOptimizedMap(uniformBlockOptimizedMap),
mNumRenderTargets(numRenderTargets),
mMaxDualSourceDrawBuffers(maxDualSourceDrawBuffers),
mCurrentFunctionMetadata(nullptr),
@ -373,7 +372,7 @@ OutputHLSL::OutputHLSL(
new AtomicCounterFunctionHLSL((compileOptions & SH_FORCE_ATOMIC_VALUE_RESOLUTION) != 0);
unsigned int firstUniformRegister =
((compileOptions & SH_SKIP_D3D_CONSTANT_REGISTER_ZERO) != 0) ? 1u : 0u;
(compileOptions & SH_SKIP_D3D_CONSTANT_REGISTER_ZERO) != 0 ? 1u : 0u;
mResourcesHLSL = new ResourcesHLSL(mStructureHLSL, outputType, uniforms, firstUniformRegister);
if (mOutputType == SH_HLSL_3_0_OUTPUT)
@ -388,8 +387,7 @@ OutputHLSL::OutputHLSL(
// Reserve registers for the default uniform block and driver constants
mResourcesHLSL->reserveUniformBlockRegisters(2);
mSSBOOutputHLSL =
new ShaderStorageBlockOutputHLSL(this, symbolTable, mResourcesHLSL, shaderStorageBlocks);
mSSBOOutputHLSL = new ShaderStorageBlockOutputHLSL(this, mResourcesHLSL, shaderStorageBlocks);
}
OutputHLSL::~OutputHLSL()
@ -661,8 +659,7 @@ void OutputHLSL::header(TInfoSinkBase &out,
out << mStructureHLSL->structsHeader();
mResourcesHLSL->uniformsHeader(out, mOutputType, mReferencedUniforms, mSymbolTable);
out << mResourcesHLSL->uniformBlocksHeader(mReferencedUniformBlocks,
mUniformBlocksTranslatedToStructuredBuffers);
out << mResourcesHLSL->uniformBlocksHeader(mReferencedUniformBlocks, mUniformBlockOptimizedMap);
mSSBOOutputHLSL->writeShaderStorageBlocksHeader(out);
if (!mEqualityFunctions.empty())
@ -1650,8 +1647,8 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
{
const TInterfaceBlock *interfaceBlock =
GetInterfaceBlockOfUniformBlockNearestIndexOperator(node->getLeft());
if (interfaceBlock && mUniformBlocksTranslatedToStructuredBuffers.count(
interfaceBlock->uniqueId().get()) != 0)
if (interfaceBlock &&
mUniformBlockOptimizedMap.count(interfaceBlock->uniqueId().get()) != 0)
{
// If the uniform block member's type is not structure, we had explicitly
// packed the member into a structure, so need to add an operator of field
@ -1685,8 +1682,8 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
{
const TInterfaceBlock *interfaceBlock =
GetInterfaceBlockOfUniformBlockNearestIndexOperator(node->getLeft());
if (interfaceBlock && mUniformBlocksTranslatedToStructuredBuffers.count(
interfaceBlock->uniqueId().get()) != 0)
if (interfaceBlock &&
mUniformBlockOptimizedMap.count(interfaceBlock->uniqueId().get()) != 0)
{
// If the uniform block member's type is not structure, we had explicitly
// packed the member into a structure, so need to add an operator of field
@ -1757,8 +1754,8 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
node->getLeft()->getType().getInterfaceBlock();
const TIntermConstantUnion *index = node->getRight()->getAsConstantUnion();
const TField *field = interfaceBlock->fields()[index->getIConst(0)];
if (structInStd140UniformBlock || mUniformBlocksTranslatedToStructuredBuffers.count(
interfaceBlock->uniqueId().get()) != 0)
if (structInStd140UniformBlock ||
mUniformBlockOptimizedMap.count(interfaceBlock->uniqueId().get()) != 0)
{
out << "_";
}
@ -3206,7 +3203,7 @@ void OutputHLSL::outputTriplet(TInfoSinkBase &out,
void OutputHLSL::outputLineDirective(TInfoSinkBase &out, int line)
{
if ((mCompileOptions & SH_LINE_DIRECTIVES) && (line > 0))
if ((mCompileOptions & SH_LINE_DIRECTIVES) != 0 && line > 0)
{
out << "\n";
out << "#line " << line;

Просмотреть файл

@ -37,22 +37,21 @@ using ReferencedVariables = std::map<int, const TVariable *>;
class OutputHLSL : public TIntermTraverser
{
public:
OutputHLSL(
sh::GLenum shaderType,
ShShaderSpec shaderSpec,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
int maxDualSourceDrawBuffers,
const std::vector<ShaderVariable> &uniforms,
ShCompileOptions compileOptions,
sh::WorkGroupSize workGroupSize,
TSymbolTable *symbolTable,
PerformanceDiagnostics *perfDiagnostics,
const std::map<int, const TInterfaceBlock *> &uniformBlocksTranslatedToStructuredBuffers,
const std::vector<InterfaceBlock> &shaderStorageBlocks);
OutputHLSL(sh::GLenum shaderType,
ShShaderSpec shaderSpec,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
int maxDualSourceDrawBuffers,
const std::vector<ShaderVariable> &uniforms,
ShCompileOptions compileOptions,
sh::WorkGroupSize workGroupSize,
TSymbolTable *symbolTable,
PerformanceDiagnostics *perfDiagnostics,
const std::map<int, const TInterfaceBlock *> &uniformBlockOptimizedMap,
const std::vector<InterfaceBlock> &shaderStorageBlocks);
~OutputHLSL() override;
@ -181,7 +180,7 @@ class OutputHLSL : public TIntermTraverser
// Indexed by block id, not instance id.
ReferencedInterfaceBlocks mReferencedUniformBlocks;
std::map<int, const TInterfaceBlock *> mUniformBlocksTranslatedToStructuredBuffers;
std::map<int, const TInterfaceBlock *> mUniformBlockOptimizedMap;
ReferencedVariables mReferencedAttributes;
ReferencedVariables mReferencedVaryings;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -64,7 +64,7 @@ class TParseContext : angle::NonCopyable
const char *token);
TIntermBlock *getTreeRoot() const { return mTreeRoot; }
void setTreeRoot(TIntermBlock *treeRoot) { mTreeRoot = treeRoot; }
void setTreeRoot(TIntermBlock *treeRoot);
bool getFragmentPrecisionHigh() const
{
@ -177,7 +177,8 @@ class TParseContext : angle::NonCopyable
// Done only for empty declarations.
void emptyDeclarationErrorCheck(const TType &type, const TSourceLoc &location);
void checkLayoutQualifierSupported(const TSourceLoc &location,
void checkCanUseLayoutQualifier(const TSourceLoc &location);
bool checkLayoutQualifierSupported(const TSourceLoc &location,
const ImmutableString &layoutQualifierName,
int versionRequired);
bool checkWorkGroupSizeIsNotSpecified(const TSourceLoc &location,
@ -190,6 +191,7 @@ class TParseContext : angle::NonCopyable
const TPublicType &type,
const TSourceLoc &qualifierLocation);
void checkLocalVariableConstStorageQualifier(const TQualifierWrapperBase &qualifier);
void checkTCSOutVarIndexIsValid(TIntermBinary *binaryExpression, const TSourceLoc &location);
const TPragma &pragma() const { return mDirectiveHandler.pragma(); }
const TExtensionBehavior &extensionBehavior() const
{
@ -358,8 +360,8 @@ class TParseContext : angle::NonCopyable
TFieldList *fieldList,
const ImmutableString &instanceName,
const TSourceLoc &instanceLine,
TIntermTyped *arrayIndex,
const TSourceLoc &arrayIndexLine);
const TVector<unsigned int> *arraySizes,
const TSourceLoc &arraySizesLine);
void parseLocalSize(const ImmutableString &qualifierType,
const TSourceLoc &qualifierTypeLine,
@ -380,6 +382,10 @@ class TParseContext : angle::NonCopyable
const TSourceLoc &intValueLine,
const std::string &intValueString,
int *numMaxVertices);
void parseVertices(int intValue,
const TSourceLoc &intValueLine,
const std::string &intValueString,
int *numVertices);
void parseIndexLayoutQualifier(int intValue,
const TSourceLoc &intValueLine,
const std::string &intValueString,
@ -465,6 +471,23 @@ class TParseContext : angle::NonCopyable
{
return mGeometryShaderOutputPrimitiveType;
}
int getTessControlShaderOutputVertices() const { return mTessControlShaderOutputVertices; }
TLayoutTessEvaluationType getTessEvaluationShaderInputPrimitiveType() const
{
return mTessEvaluationShaderInputPrimitiveType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputVertexSpacingType() const
{
return mTessEvaluationShaderInputVertexSpacingType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputOrderingType() const
{
return mTessEvaluationShaderInputOrderingType;
}
TLayoutTessEvaluationType getTessEvaluationShaderInputPointType() const
{
return mTessEvaluationShaderInputPointType;
}
ShShaderOutput getOutputType() const { return mOutputType; }
@ -554,9 +577,18 @@ class TParseContext : angle::NonCopyable
void checkEarlyFragmentTestsIsNotSpecified(const TSourceLoc &location, bool earlyFragmentTests);
void checkNoncoherentIsSpecified(const TSourceLoc &location, bool noncoherent);
void checkNoncoherentIsNotSpecified(const TSourceLoc &location, bool noncoherent);
bool checkUnsizedArrayConstructorArgumentDimensionality(const TIntermSequence &arguments,
TType type,
const TSourceLoc &line);
void checkCombinedClipCullDistanceIsValid(const TSourceLoc &line,
const ImmutableString &identifier,
const int arraySize);
// Check texture offset is within range.
void checkSingleTextureOffset(const TSourceLoc &line,
const TConstantUnion *values,
@ -569,6 +601,11 @@ class TParseContext : angle::NonCopyable
const ImmutableString &token,
TType *type);
// Similar, for tessellation shaders.
void checkTessellationShaderUnsizedArraysAndSetSize(const TSourceLoc &location,
const ImmutableString &token,
TType *type);
// Will size any unsized array type so unsized arrays won't need to be taken into account
// further along the line in parsing.
void checkIsNotUnsizedArray(const TSourceLoc &line,
@ -611,13 +648,16 @@ class TParseContext : angle::NonCopyable
bool parseGeometryShaderOutputLayoutQualifier(const TTypeQualifier &typeQualifier);
void setGeometryShaderInputArraySize(unsigned int inputArraySize, const TSourceLoc &line);
bool parseTessControlShaderOutputLayoutQualifier(const TTypeQualifier &typeQualifier);
bool parseTessEvaluationShaderInputLayoutQualifier(const TTypeQualifier &typeQualifier);
// Set to true when the last/current declarator list was started with an empty declaration. The
// non-empty declaration error check will need to be performed if the empty declaration is
// followed by a declarator.
bool mDeferredNonEmptyDeclarationErrorCheck;
sh::GLenum mShaderType; // vertex or fragment language (future: pack or unpack)
ShShaderSpec mShaderSpec; // The language specification compiler conforms to - GLES2 or WebGL.
sh::GLenum mShaderType; // vertex/fragment/geometry/etc shader
ShShaderSpec mShaderSpec; // The language specification compiler conforms to - GLES/WebGL/etc.
ShCompileOptions mCompileOptions; // Options passed to TCompiler
int mShaderVersion;
TIntermBlock *mTreeRoot; // root of parse tree being created
@ -674,6 +714,14 @@ class TParseContext : angle::NonCopyable
int mGeometryShaderMaxVertices;
int mMaxGeometryShaderInvocations;
int mMaxGeometryShaderMaxVertices;
unsigned int mGeometryInputArraySize;
int mMaxPatchVertices;
int mTessControlShaderOutputVertices;
TLayoutTessEvaluationType mTessEvaluationShaderInputPrimitiveType;
TLayoutTessEvaluationType mTessEvaluationShaderInputVertexSpacingType;
TLayoutTessEvaluationType mTessEvaluationShaderInputOrderingType;
TLayoutTessEvaluationType mTessEvaluationShaderInputPointType;
// Track when we add new scope for func body in ESSL 1.00 spec
bool mFunctionBodyNewScope;

Просмотреть файл

@ -2,7 +2,7 @@
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
// builtin_function_declarations.txt.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// 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.
//
@ -21,77 +21,77 @@ namespace BuiltInGroup
bool isTextureOffsetNoBias(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3680 && id <= 3749;
return id >= 3792 && id <= 3861;
}
bool isTextureOffsetBias(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3750 && id <= 3769;
}
bool isTextureGatherOffsetsComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3807 && id <= 3819;
}
bool isTextureGatherOffsetsNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3820 && id <= 3835;
}
bool isTextureGatherOffsets(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3807 && id <= 3835;
}
bool isTextureGatherOffsetComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3836 && id <= 3841;
return id >= 3862 && id <= 3881;
}
bool isTextureGatherOffsetNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3842 && id <= 3849;
return id >= 3919 && id <= 3926;
}
bool isTextureGatherOffsetComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3927 && id <= 3932;
}
bool isTextureGatherOffset(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3836 && id <= 3849;
return id >= 3919 && id <= 3932;
}
bool isTextureGatherOffsetsNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3933 && id <= 3949;
}
bool isTextureGatherOffsetsComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3950 && id <= 3961;
}
bool isTextureGatherOffsets(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3933 && id <= 3961;
}
bool isTextureGather(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3783 && id <= 3849;
return id >= 3895 && id <= 3961;
}
bool isInterpolationFS(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3862 && id <= 3885;
return id >= 3974 && id <= 3997;
}
bool isAtomicMemory(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3890 && id <= 3907;
}
bool isImageLoad(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3944 && id <= 3961;
}
bool isImageAtomic(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3962 && id <= 4537;
return id >= 4002 && id <= 4019;
}
bool isImageStore(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 4538 && id <= 4555;
return id >= 4056 && id <= 4073;
}
bool isImageLoad(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 4074 && id <= 4091;
}
bool isImageAtomic(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 4092 && id <= 4667;
}
bool isImage(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 3908 && id <= 4555;
return id >= 4020 && id <= 4667;
}
} // namespace BuiltInGroup

Просмотреть файл

@ -2,7 +2,7 @@
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
// builtin_function_declarations.txt.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// 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.
//
@ -28,35 +28,35 @@ bool isTextureOffsetBias(const TFunction *func)
int id = func->uniqueId().get();
return id >= 1279 && id <= 1313;
}
bool isTextureGatherOffsetsComp(const TFunction *func)
bool isTextureGatherOffsetNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1358 && id <= 1373;
}
bool isTextureGatherOffsetsNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1374 && id <= 1393;
}
bool isTextureGatherOffsets(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1358 && id <= 1393;
return id >= 1358 && id <= 1369;
}
bool isTextureGatherOffsetComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1394 && id <= 1402;
}
bool isTextureGatherOffsetNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1403 && id <= 1414;
return id >= 1370 && id <= 1378;
}
bool isTextureGatherOffset(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1394 && id <= 1414;
return id >= 1358 && id <= 1378;
}
bool isTextureGatherOffsetsNoComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1379 && id <= 1399;
}
bool isTextureGatherOffsetsComp(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1400 && id <= 1414;
}
bool isTextureGatherOffsets(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1379 && id <= 1414;
}
bool isTextureGather(const TFunction *func)
{
@ -73,25 +73,25 @@ bool isAtomicMemory(const TFunction *func)
int id = func->uniqueId().get();
return id >= 1488 && id <= 1505;
}
bool isImageStore(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1578 && id <= 1610;
}
bool isImageLoad(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1578 && id <= 1613;
return id >= 1611 && id <= 1643;
}
bool isImageAtomic(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1614 && id <= 2735;
}
bool isImageStore(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 2736 && id <= 2768;
return id >= 1644 && id <= 2765;
}
bool isImage(const TFunction *func)
{
int id = func->uniqueId().get();
return id >= 1506 && id <= 2768;
return id >= 1506 && id <= 2765;
}
} // namespace BuiltInGroup

Просмотреть файл

@ -177,7 +177,8 @@ bool HasRepeatingQualifiers(const TTypeQualifierBuilder::QualifierSequence &qual
// repetitions.
TQualifier currentQualifier =
static_cast<const TStorageQualifierWrapper *>(qualifiers[i])->getQualifier();
if (currentQualifier == EvqVertexOut || currentQualifier == EvqFragmentOut)
if (currentQualifier == EvqVertexOut || currentQualifier == EvqFragmentOut ||
currentQualifier == EvqFragmentInOut)
{
isOut = true;
}
@ -372,10 +373,14 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
break;
case EvqVertexOut:
case EvqGeometryOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
*joinedQualifier = EvqSmoothOut;
break;
case EvqFragmentIn:
case EvqGeometryIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
*joinedQualifier = EvqSmoothIn;
break;
default:
@ -392,10 +397,14 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
break;
case EvqVertexOut:
case EvqGeometryOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
*joinedQualifier = EvqFlatOut;
break;
case EvqFragmentIn:
case EvqGeometryIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
*joinedQualifier = EvqFlatIn;
break;
default:
@ -412,10 +421,14 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
break;
case EvqVertexOut:
case EvqGeometryOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
*joinedQualifier = EvqNoPerspectiveOut;
break;
case EvqFragmentIn:
case EvqGeometryIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
*joinedQualifier = EvqNoPerspectiveIn;
break;
default:
@ -429,10 +442,14 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
{
case EvqVertexOut:
case EvqGeometryOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
*joinedQualifier = EvqCentroidOut;
break;
case EvqFragmentIn:
case EvqGeometryIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
*joinedQualifier = EvqCentroidIn;
break;
default:
@ -446,10 +463,14 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
{
case EvqVertexOut:
case EvqGeometryOut:
case EvqTessControlOut:
case EvqTessEvaluationOut:
*joinedQualifier = EvqSampleOut;
break;
case EvqFragmentIn:
case EvqGeometryIn:
case EvqTessControlIn:
case EvqTessEvaluationIn:
*joinedQualifier = EvqSampleIn;
break;
default:
@ -457,6 +478,21 @@ bool JoinVariableStorageQualifier(TQualifier *joinedQualifier, TQualifier storag
}
break;
}
case EvqPatch:
{
switch (storageQualifier)
{
case EvqTessControlOut:
*joinedQualifier = EvqPatchOut;
break;
case EvqTessEvaluationIn:
*joinedQualifier = EvqPatchIn;
break;
default:
return false;
}
break;
}
default:
return false;
}
@ -695,6 +731,10 @@ TLayoutQualifier JoinLayoutQualifiers(TLayoutQualifier leftQualifier,
{
joinedQualifier.blockStorage = rightQualifier.blockStorage;
}
if (rightQualifier.noncoherent != false)
{
joinedQualifier.noncoherent = rightQualifier.noncoherent;
}
for (size_t i = 0u; i < rightQualifier.localSize.size(); ++i)
{
@ -757,6 +797,48 @@ TLayoutQualifier JoinLayoutQualifiers(TLayoutQualifier leftQualifier,
joinedQualifier.maxVertices = rightQualifier.maxVertices;
}
if (rightQualifier.tesPrimitiveType != EtetUndefined)
{
if (joinedQualifier.tesPrimitiveType == EtetUndefined)
{
joinedQualifier.tesPrimitiveType = rightQualifier.tesPrimitiveType;
}
}
if (rightQualifier.tesVertexSpacingType != EtetUndefined)
{
if (joinedQualifier.tesVertexSpacingType == EtetUndefined)
{
joinedQualifier.tesVertexSpacingType = rightQualifier.tesVertexSpacingType;
}
}
if (rightQualifier.tesOrderingType != EtetUndefined)
{
if (joinedQualifier.tesOrderingType == EtetUndefined)
{
joinedQualifier.tesOrderingType = rightQualifier.tesOrderingType;
}
}
if (rightQualifier.tesPointType != EtetUndefined)
{
if (joinedQualifier.tesPointType == EtetUndefined)
{
joinedQualifier.tesPointType = rightQualifier.tesPointType;
}
}
if (rightQualifier.vertices != 0)
{
if (joinedQualifier.vertices != 0 && joinedQualifier.vertices != rightQualifier.vertices)
{
diagnostics->error(rightQualifierLocation,
"Cannot have multiple different vertices specifiers", "vertices");
}
joinedQualifier.vertices = rightQualifier.vertices;
}
if (rightQualifier.index != -1)
{
if (joinedQualifier.index != -1)

Просмотреть файл

@ -697,7 +697,7 @@ void ResourcesHLSL::imageMetadataUniforms(TInfoSinkBase &out, unsigned int regIn
TString ResourcesHLSL::uniformBlocksHeader(
const ReferencedInterfaceBlocks &referencedInterfaceBlocks,
const std::map<int, const TInterfaceBlock *> &uniformBlockTranslatedToStructuredBuffer)
const std::map<int, const TInterfaceBlock *> &uniformBlockOptimizedMap)
{
TString interfaceBlocks;
@ -712,7 +712,7 @@ TString ResourcesHLSL::uniformBlocksHeader(
// In order to avoid compile performance issue, translate uniform block to structured
// buffer. anglebug.com/3682.
if (uniformBlockTranslatedToStructuredBuffer.count(interfaceBlock.uniqueId().get()) != 0)
if (uniformBlockOptimizedMap.count(interfaceBlock.uniqueId().get()) != 0)
{
unsigned int structuredBufferRegister = mSRVRegister;
if (instanceVariable != nullptr && instanceVariable->getType().isArray())
@ -915,7 +915,8 @@ TString ResourcesHLSL::uniformBlockMembersString(const TInterfaceBlock &interfac
Std140PaddingHelper padHelper = mStructureHLSL->getPaddingHelper();
for (unsigned int typeIndex = 0; typeIndex < interfaceBlock.fields().size(); typeIndex++)
const unsigned int fieldCount = static_cast<unsigned int>(interfaceBlock.fields().size());
for (unsigned int typeIndex = 0; typeIndex < fieldCount; typeIndex++)
{
const TField &field = *interfaceBlock.fields()[typeIndex];
const TType &fieldType = *field.type();
@ -935,7 +936,8 @@ TString ResourcesHLSL::uniformBlockMembersString(const TInterfaceBlock &interfac
{
const bool useHLSLRowMajorPacking =
(fieldType.getLayoutQualifier().matrixPacking == EmpColumnMajor);
hlsl += padHelper.postPaddingString(fieldType, useHLSLRowMajorPacking, false);
hlsl += padHelper.postPaddingString(fieldType, useHLSLRowMajorPacking,
typeIndex == fieldCount - 1, false);
}
}

Просмотреть файл

@ -40,7 +40,7 @@ class ResourcesHLSL : angle::NonCopyable
void imageMetadataUniforms(TInfoSinkBase &out, unsigned int regIndex);
TString uniformBlocksHeader(
const ReferencedInterfaceBlocks &referencedInterfaceBlocks,
const std::map<int, const TInterfaceBlock *> &uniformBlockTranslatedToStructuredBuffer);
const std::map<int, const TInterfaceBlock *> &uniformBlockOptimizedMap);
TString shaderStorageBlocksHeader(const ReferencedInterfaceBlocks &referencedInterfaceBlocks);
// Used for direct index references

Просмотреть файл

@ -13,6 +13,7 @@
#include "compiler/translator/Compiler.h"
#include "compiler/translator/InitializeDll.h"
#include "compiler/translator/glslang_wrapper.h"
#include "compiler/translator/length_limits.h"
#ifdef ANGLE_ENABLE_HLSL
# include "compiler/translator/TranslatorHLSL.h"
@ -26,7 +27,8 @@ namespace sh
namespace
{
bool isInitialized = false;
bool isInitialized = false;
bool isGlslangInitialized = false;
//
// This is the platform independent interface between an OGL driver
@ -102,6 +104,36 @@ GLenum GetGeometryShaderPrimitiveTypeEnum(sh::TLayoutPrimitiveType primitiveType
}
}
GLenum GetTessellationShaderTypeEnum(sh::TLayoutTessEvaluationType type)
{
switch (type)
{
case EtetTriangles:
return GL_TRIANGLES;
case EtetQuads:
return GL_QUADS;
case EtetIsolines:
return GL_ISOLINES;
case EtetEqualSpacing:
return GL_EQUAL;
case EtetFractionalEvenSpacing:
return GL_FRACTIONAL_EVEN;
case EtetFractionalOddSpacing:
return GL_FRACTIONAL_ODD;
case EtetCw:
return GL_CW;
case EtetCcw:
return GL_CCW;
case EtetPointMode:
return GL_TESS_GEN_POINT_MODE;
case EtetUndefined:
default:
UNREACHABLE();
return GL_INVALID_VALUE;
}
}
} // anonymous namespace
//
@ -160,6 +192,7 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->EXT_shader_texture_lod = 0;
resources->WEBGL_debug_shader_precision = 0;
resources->EXT_shader_framebuffer_fetch = 0;
resources->EXT_shader_framebuffer_fetch_non_coherent = 0;
resources->NV_shader_framebuffer_fetch = 0;
resources->ARM_shader_framebuffer_fetch = 0;
resources->OVR_multiview = 0;
@ -167,6 +200,8 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->EXT_YUV_target = 0;
resources->EXT_geometry_shader = 0;
resources->EXT_gpu_shader5 = 0;
resources->OES_shader_io_blocks = 0;
resources->EXT_shader_io_blocks = 0;
resources->EXT_shader_non_constant_global_initializers = 0;
resources->NV_shader_noperspective_interpolation = 0;
resources->OES_texture_storage_multisample_2d_array = 0;
@ -182,10 +217,15 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->OES_shader_multisample_interpolation = 0;
resources->NV_draw_buffers = 0;
resources->OES_shader_image_atomic = 0;
resources->EXT_tessellation_shader = 0;
resources->OES_texture_buffer = 0;
resources->EXT_texture_buffer = 0;
resources->OES_sample_variables = 0;
resources->EXT_clip_cull_distance = 0;
resources->MaxClipDistances = 0;
resources->MaxClipDistances = 8;
resources->MaxCullDistances = 8;
resources->MaxCombinedClipAndCullDistances = 8;
// Disable highp precision in fragment shader by default.
resources->FragmentPrecisionHigh = 0;
@ -267,7 +307,30 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->MaxGeometryShaderInvocations = 32;
resources->MaxGeometryImageUniforms = 0;
resources->MaxTessControlInputComponents = 64;
resources->MaxTessControlOutputComponents = 64;
resources->MaxTessControlTextureImageUnits = 16;
resources->MaxTessControlUniformComponents = 1024;
resources->MaxTessControlTotalOutputComponents = 2048;
resources->MaxTessControlImageUniforms = 0;
resources->MaxTessControlAtomicCounters = 0;
resources->MaxTessControlAtomicCounterBuffers = 0;
resources->MaxTessPatchComponents = 120;
resources->MaxPatchVertices = 32;
resources->MaxTessGenLevel = 64;
resources->MaxTessEvaluationInputComponents = 64;
resources->MaxTessEvaluationOutputComponents = 64;
resources->MaxTessEvaluationTextureImageUnits = 16;
resources->MaxTessEvaluationUniformComponents = 1024;
resources->MaxTessEvaluationImageUniforms = 0;
resources->MaxTessEvaluationAtomicCounters = 0;
resources->MaxTessEvaluationAtomicCounterBuffers = 0;
resources->SubPixelBits = 8;
resources->MaxSamples = 4;
}
//
@ -381,6 +444,18 @@ const std::string &GetObjectCode(const ShHandle handle)
return infoSink.obj.str();
}
//
// Return any object binary code.
//
const BinaryBlob &GetObjectBinaryBlob(const ShHandle handle)
{
TCompiler *compiler = GetCompilerFromHandle(handle);
ASSERT(compiler);
TInfoSink &infoSink = compiler->getInfoSink();
return infoSink.obj.getBinary();
}
const std::map<std::string, std::string> *GetNameHashingMap(const ShHandle handle)
{
TCompiler *compiler = GetCompilerFromHandle(handle);
@ -518,6 +593,16 @@ bool HasEarlyFragmentTestsOptimization(const ShHandle handle)
return compiler->isEarlyFragmentTestsOptimized();
}
uint32_t GetShaderSpecConstUsageBits(const ShHandle handle)
{
TCompiler *compiler = GetCompilerFromHandle(handle);
if (compiler == nullptr)
{
return 0;
}
return compiler->getSpecConstUsageBits().bits();
}
bool CheckVariablesWithinPackingLimits(int maxVectors, const std::vector<ShaderVariable> &variables)
{
return CheckVariablesInPackingLimits(maxVectors, variables);
@ -592,6 +677,18 @@ const std::map<std::string, unsigned int> *GetUniformRegisterMap(const ShHandle
#endif // ANGLE_ENABLE_HLSL
}
const std::set<std::string> *GetSlowCompilingUniformBlockSet(const ShHandle handle)
{
#ifdef ANGLE_ENABLE_HLSL
TranslatorHLSL *translator = GetTranslatorHLSLFromHandle(handle);
ASSERT(translator);
return translator->getSlowCompilingUniformBlockSet();
#else
return nullptr;
#endif // ANGLE_ENABLE_HLSL
}
unsigned int GetReadonlyImage2DRegisterIndex(const ShHandle handle)
{
#ifdef ANGLE_ENABLE_HLSL
@ -661,6 +758,50 @@ bool HasValidGeometryShaderMaxVertices(const ShHandle handle)
return compiler->getGeometryShaderMaxVertices() >= 0;
}
bool HasValidTessGenMode(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return compiler->getTessEvaluationShaderInputPrimitiveType() != EtetUndefined;
}
bool HasValidTessGenSpacing(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return compiler->getTessEvaluationShaderInputVertexSpacingType() != EtetUndefined;
}
bool HasValidTessGenVertexOrder(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return compiler->getTessEvaluationShaderInputOrderingType() != EtetUndefined;
}
bool HasValidTessGenPointMode(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return compiler->getTessEvaluationShaderInputPointType() != EtetUndefined;
}
GLenum GetGeometryShaderInputPrimitiveType(const ShHandle handle)
{
ASSERT(handle);
@ -707,6 +848,62 @@ int GetGeometryShaderMaxVertices(const ShHandle handle)
return maxVertices;
}
int GetTessControlShaderVertices(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
int vertices = compiler->getTessControlShaderOutputVertices();
return vertices;
}
GLenum GetTessGenMode(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return GetTessellationShaderTypeEnum(compiler->getTessEvaluationShaderInputPrimitiveType());
}
GLenum GetTessGenSpacing(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return GetTessellationShaderTypeEnum(compiler->getTessEvaluationShaderInputVertexSpacingType());
}
GLenum GetTessGenVertexOrder(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return GetTessellationShaderTypeEnum(compiler->getTessEvaluationShaderInputOrderingType());
}
GLenum GetTessGenPointMode(const ShHandle handle)
{
ASSERT(handle);
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
TCompiler *compiler = base->getAsCompiler();
ASSERT(compiler);
return GetTessellationShaderTypeEnum(compiler->getTessEvaluationShaderInputPointType());
}
unsigned int GetShaderSharedMemorySize(const ShHandle handle)
{
ASSERT(handle);
@ -719,6 +916,24 @@ unsigned int GetShaderSharedMemorySize(const ShHandle handle)
return sharedMemorySize;
}
void InitializeGlslang()
{
if (!isGlslangInitialized)
{
GlslangInitialize();
}
isGlslangInitialized = true;
}
void FinalizeGlslang()
{
if (isGlslangInitialized)
{
GlslangFinalize();
}
isGlslangInitialized = false;
}
// Can't prefix with just _ because then we might introduce a double underscore, which is not safe
// in GLSL (ESSL 3.00.6 section 3.8: All identifiers containing a double underscore are reserved for
// use by the underlying implementation). u is short for user-defined.
@ -743,6 +958,17 @@ const char kAtomicCountersBlockName[] = "ANGLEAtomicCounters";
const char kLineRasterEmulationPosition[] = "ANGLEPosition";
const char kXfbEmulationGetOffsetsFunctionName[] = "ANGLEGetXfbOffsets";
const char kXfbEmulationCaptureFunctionName[] = "ANGLECaptureXfb";
const char kXfbEmulationBufferBlockName[] = "ANGLEXfbBuffer";
const char kXfbEmulationBufferName[] = "ANGLEXfb";
const char kXfbEmulationBufferFieldName[] = "xfbOut";
const char kXfbExtensionPositionOutName[] = "ANGLEXfbPosition";
// EXT_shader_framebuffer_fetch / EXT_shader_framebuffer_fetch_non_coherent
const char kInputAttachmentName[] = "ANGLEInputAttachment";
} // namespace vk
} // namespace sh

Просмотреть файл

@ -27,6 +27,7 @@
#include "compiler/translator/ResourcesHLSL.h"
#include "compiler/translator/blocklayoutHLSL.h"
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/util.h"
namespace sh
@ -288,31 +289,23 @@ void GetShaderStorageBlockMembersInfo(const TInterfaceBlock *interfaceBlock,
TraverseShaderVariables(block->fields, false, &visitor);
}
bool IsInArrayOfArraysChain(TIntermTyped *node)
TIntermTyped *Mul(TIntermTyped *left, TIntermTyped *right)
{
if (node->getType().isArrayOfArrays())
return true;
TIntermBinary *binaryNode = node->getAsBinaryNode();
if (binaryNode)
{
if (binaryNode->getLeft()->getType().isArrayOfArrays())
return true;
}
return false;
return left && right ? new TIntermBinary(EOpMul, left, right) : nullptr;
}
TIntermTyped *Add(TIntermTyped *left, TIntermTyped *right)
{
return left ? right ? new TIntermBinary(EOpAdd, left, right) : left : right;
}
} // anonymous namespace
ShaderStorageBlockOutputHLSL::ShaderStorageBlockOutputHLSL(
OutputHLSL *outputHLSL,
TSymbolTable *symbolTable,
ResourcesHLSL *resourcesHLSL,
const std::vector<InterfaceBlock> &shaderStorageBlocks)
: TIntermTraverser(true, true, true, symbolTable),
mMatrixStride(0),
mRowMajor(false),
mLocationAsTheLastArgument(false),
mOutputHLSL(outputHLSL),
: mOutputHLSL(outputHLSL),
mResourcesHLSL(resourcesHLSL),
mShaderStorageBlocks(shaderStorageBlocks)
{
@ -326,27 +319,24 @@ ShaderStorageBlockOutputHLSL::~ShaderStorageBlockOutputHLSL()
void ShaderStorageBlockOutputHLSL::outputStoreFunctionCallPrefix(TIntermTyped *node)
{
mLocationAsTheLastArgument = false;
traverseSSBOAccess(node, SSBOMethod::STORE);
}
void ShaderStorageBlockOutputHLSL::outputLoadFunctionCall(TIntermTyped *node)
{
mLocationAsTheLastArgument = true;
traverseSSBOAccess(node, SSBOMethod::LOAD);
mOutputHLSL->getInfoSink() << ")";
}
void ShaderStorageBlockOutputHLSL::outputLengthFunctionCall(TIntermTyped *node)
{
mLocationAsTheLastArgument = true;
traverseSSBOAccess(node, SSBOMethod::LENGTH);
mOutputHLSL->getInfoSink() << ")";
}
void ShaderStorageBlockOutputHLSL::outputAtomicMemoryFunctionCallPrefix(TIntermTyped *node,
TOperator op)
{
mLocationAsTheLastArgument = false;
switch (op)
{
case EOpAtomicAdd:
@ -382,15 +372,15 @@ void ShaderStorageBlockOutputHLSL::outputAtomicMemoryFunctionCallPrefix(TIntermT
// Note that we must calculate the matrix stride here instead of ShaderStorageBlockFunctionHLSL.
// It's because that if the current node's type is a vector which comes from a matrix, we will
// lose the matrix type info once we enter ShaderStorageBlockFunctionHLSL.
void ShaderStorageBlockOutputHLSL::setMatrixStride(TIntermTyped *node,
TLayoutBlockStorage storage,
bool rowMajor)
int ShaderStorageBlockOutputHLSL::getMatrixStride(TIntermTyped *node,
TLayoutBlockStorage storage,
bool rowMajor,
bool *isRowMajorMatrix) const
{
if (node->getType().isMatrix())
{
mMatrixStride = GetBlockMemberInfoByType(node->getType(), storage, rowMajor).matrixStride;
mRowMajor = rowMajor;
return;
*isRowMajorMatrix = rowMajor;
return GetBlockMemberInfoByType(node->getType(), storage, rowMajor).matrixStride;
}
if (node->getType().isVector())
@ -398,23 +388,70 @@ void ShaderStorageBlockOutputHLSL::setMatrixStride(TIntermTyped *node,
TIntermBinary *binaryNode = node->getAsBinaryNode();
if (binaryNode)
{
return setMatrixStride(binaryNode->getLeft(), storage, rowMajor);
return getMatrixStride(binaryNode->getLeft(), storage, rowMajor, isRowMajorMatrix);
}
else
{
TIntermSwizzle *swizzleNode = node->getAsSwizzleNode();
if (swizzleNode)
{
return setMatrixStride(swizzleNode->getOperand(), storage, rowMajor);
return getMatrixStride(swizzleNode->getOperand(), storage, rowMajor,
isRowMajorMatrix);
}
}
}
return 0;
}
void ShaderStorageBlockOutputHLSL::collectShaderStorageBlocks(TIntermTyped *node)
{
TIntermSwizzle *swizzleNode = node->getAsSwizzleNode();
if (swizzleNode)
{
return collectShaderStorageBlocks(swizzleNode->getOperand());
}
TIntermBinary *binaryNode = node->getAsBinaryNode();
if (binaryNode)
{
switch (binaryNode->getOp())
{
case EOpIndexDirectInterfaceBlock:
case EOpIndexIndirect:
case EOpIndexDirect:
case EOpIndexDirectStruct:
return collectShaderStorageBlocks(binaryNode->getLeft());
default:
UNREACHABLE();
return;
}
}
const TIntermSymbol *symbolNode = node->getAsSymbolNode();
const TType &type = symbolNode->getType();
ASSERT(type.getQualifier() == EvqBuffer);
const TVariable &variable = symbolNode->variable();
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
ASSERT(interfaceBlock);
if (mReferencedShaderStorageBlocks.count(interfaceBlock->uniqueId().get()) == 0)
{
const TVariable *instanceVariable = nullptr;
if (type.isInterfaceBlock())
{
instanceVariable = &variable;
}
mReferencedShaderStorageBlocks[interfaceBlock->uniqueId().get()] =
new TReferencedBlock(interfaceBlock, instanceVariable);
GetShaderStorageBlockMembersInfo(interfaceBlock, mShaderStorageBlocks,
&mBlockMemberInfoMap);
}
}
void ShaderStorageBlockOutputHLSL::traverseSSBOAccess(TIntermTyped *node, SSBOMethod method)
{
mMatrixStride = 0;
mRowMajor = false;
// TODO: Merge collectShaderStorageBlocks and GetBlockLayoutInfo to simplify the code.
collectShaderStorageBlocks(node);
// Note that we don't have correct BlockMemberInfo from mBlockMemberInfoMap at the current
// point. But we must use those information to generate the right function name. So here we have
@ -425,18 +462,45 @@ void ShaderStorageBlockOutputHLSL::traverseSSBOAccess(TIntermTyped *node, SSBOMe
int unsizedArrayStride = 0;
if (node->getType().isUnsizedArray())
{
unsizedArrayStride =
GetBlockMemberInfoByType(node->getType(), storage, rowMajor).arrayStride;
// The unsized array member must be the last member of a shader storage block.
TIntermBinary *binaryNode = node->getAsBinaryNode();
if (binaryNode)
{
const TInterfaceBlock *interfaceBlock =
binaryNode->getLeft()->getType().getInterfaceBlock();
ASSERT(interfaceBlock);
const TIntermConstantUnion *index = binaryNode->getRight()->getAsConstantUnion();
const TField *field = interfaceBlock->fields()[index->getIConst(0)];
auto fieldInfoIter = mBlockMemberInfoMap.find(field);
ASSERT(fieldInfoIter != mBlockMemberInfoMap.end());
unsizedArrayStride = fieldInfoIter->second.arrayStride;
}
else
{
const TIntermSymbol *symbolNode = node->getAsSymbolNode();
const TVariable &variable = symbolNode->variable();
const TInterfaceBlock *interfaceBlock = symbolNode->getType().getInterfaceBlock();
ASSERT(interfaceBlock);
const TField *field =
GetFieldMemberInShaderStorageBlock(interfaceBlock, variable.name());
auto fieldInfoIter = mBlockMemberInfoMap.find(field);
ASSERT(fieldInfoIter != mBlockMemberInfoMap.end());
unsizedArrayStride = fieldInfoIter->second.arrayStride;
}
}
setMatrixStride(node, storage, rowMajor);
bool isRowMajorMatrix = false;
int matrixStride = getMatrixStride(node, storage, rowMajor, &isRowMajorMatrix);
const TString &functionName = mSSBOFunctionHLSL->registerShaderStorageBlockFunction(
node->getType(), method, storage, mRowMajor, mMatrixStride, unsizedArrayStride,
node->getType(), method, storage, isRowMajorMatrix, matrixStride, unsizedArrayStride,
node->getAsSwizzleNode());
TInfoSinkBase &out = mOutputHLSL->getInfoSink();
out << functionName;
out << "(";
node->traverse(this);
BlockMemberInfo blockMemberInfo;
TIntermNode *loc = traverseNode(out, node, &blockMemberInfo);
out << ", ";
loc->traverse(mOutputHLSL);
}
void ShaderStorageBlockOutputHLSL::writeShaderStorageBlocksHeader(TInfoSinkBase &out) const
@ -445,318 +509,144 @@ void ShaderStorageBlockOutputHLSL::writeShaderStorageBlocksHeader(TInfoSinkBase
mSSBOFunctionHLSL->shaderStorageBlockFunctionHeader(out);
}
// Check if the current node is the end of the SSBO access chain. If true, we should output ')' for
// Load method.
bool ShaderStorageBlockOutputHLSL::isEndOfSSBOAccessChain()
TIntermTyped *ShaderStorageBlockOutputHLSL::traverseNode(TInfoSinkBase &out,
TIntermTyped *node,
BlockMemberInfo *blockMemberInfo)
{
TIntermNode *parent = getParentNode();
if (parent)
if (TIntermSymbol *symbolNode = node->getAsSymbolNode())
{
TIntermBinary *parentBinary = parent->getAsBinaryNode();
if (parentBinary != nullptr)
{
switch (parentBinary->getOp())
{
case EOpIndexDirectStruct:
case EOpIndexDirect:
case EOpIndexIndirect:
{
return false;
}
default:
return true;
}
}
const TIntermSwizzle *parentSwizzle = parent->getAsSwizzleNode();
if (parentSwizzle)
{
return false;
}
}
return true;
}
void ShaderStorageBlockOutputHLSL::visitSymbol(TIntermSymbol *node)
{
TInfoSinkBase &out = mOutputHLSL->getInfoSink();
const TVariable &variable = node->variable();
TQualifier qualifier = variable.getType().getQualifier();
if (qualifier == EvqBuffer)
{
const TType &variableType = variable.getType();
const TInterfaceBlock *interfaceBlock = variableType.getInterfaceBlock();
ASSERT(interfaceBlock);
if (mReferencedShaderStorageBlocks.count(interfaceBlock->uniqueId().get()) == 0)
{
const TVariable *instanceVariable = nullptr;
if (variableType.isInterfaceBlock())
{
instanceVariable = &variable;
}
mReferencedShaderStorageBlocks[interfaceBlock->uniqueId().get()] =
new TReferencedBlock(interfaceBlock, instanceVariable);
GetShaderStorageBlockMembersInfo(interfaceBlock, mShaderStorageBlocks,
&mBlockMemberInfoMap);
}
if (variableType.isInterfaceBlock())
const TVariable &variable = symbolNode->variable();
const TType &type = variable.getType();
if (type.isInterfaceBlock())
{
out << DecorateVariableIfNeeded(variable);
}
else
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
out << Decorate(interfaceBlock->name());
out << ", ";
const TField *field =
GetFieldMemberInShaderStorageBlock(interfaceBlock, variable.name());
writeDotOperatorOutput(out, field);
return createFieldOffset(field, blockMemberInfo);
}
}
else
else if (TIntermSwizzle *swizzleNode = node->getAsSwizzleNode())
{
return mOutputHLSL->visitSymbol(node);
return traverseNode(out, swizzleNode->getOperand(), blockMemberInfo);
}
}
void ShaderStorageBlockOutputHLSL::visitConstantUnion(TIntermConstantUnion *node)
{
mOutputHLSL->visitConstantUnion(node);
}
bool ShaderStorageBlockOutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
{
return mOutputHLSL->visitAggregate(visit, node);
}
bool ShaderStorageBlockOutputHLSL::visitTernary(Visit visit, TIntermTernary *node)
{
return mOutputHLSL->visitTernary(visit, node);
}
bool ShaderStorageBlockOutputHLSL::visitUnary(Visit visit, TIntermUnary *node)
{
return mOutputHLSL->visitUnary(visit, node);
}
bool ShaderStorageBlockOutputHLSL::visitSwizzle(Visit visit, TIntermSwizzle *node)
{
if (visit == PostVisit)
else if (TIntermBinary *binaryNode = node->getAsBinaryNode())
{
if (!IsInShaderStorageBlock(node))
switch (binaryNode->getOp())
{
return mOutputHLSL->visitSwizzle(visit, node);
}
TInfoSinkBase &out = mOutputHLSL->getInfoSink();
// TODO(jiajia.qin@intel.com): add swizzle process if the swizzle node is not the last node
// of ssbo access chain. Such as, data.xy[0]
if (mLocationAsTheLastArgument && isEndOfSSBOAccessChain())
{
out << ")";
}
}
return true;
}
bool ShaderStorageBlockOutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
{
TInfoSinkBase &out = mOutputHLSL->getInfoSink();
switch (node->getOp())
{
case EOpIndexDirect:
{
if (!IsInShaderStorageBlock(node->getLeft()))
case EOpIndexDirect:
{
return mOutputHLSL->visitBinary(visit, node);
}
const TType &leftType = node->getLeft()->getType();
if (leftType.isInterfaceBlock())
{
if (visit == PreVisit)
const TType &leftType = binaryNode->getLeft()->getType();
if (leftType.isInterfaceBlock())
{
ASSERT(leftType.getQualifier() == EvqBuffer);
TIntermSymbol *instanceArraySymbol = node->getLeft()->getAsSymbolNode();
const TInterfaceBlock *interfaceBlock = leftType.getInterfaceBlock();
TIntermSymbol *instanceArraySymbol = binaryNode->getLeft()->getAsSymbolNode();
if (mReferencedShaderStorageBlocks.count(interfaceBlock->uniqueId().get()) == 0)
{
mReferencedShaderStorageBlocks[interfaceBlock->uniqueId().get()] =
new TReferencedBlock(interfaceBlock, &instanceArraySymbol->variable());
GetShaderStorageBlockMembersInfo(interfaceBlock, mShaderStorageBlocks,
&mBlockMemberInfoMap);
}
const int arrayIndex = node->getRight()->getAsConstantUnion()->getIConst(0);
const int arrayIndex =
binaryNode->getRight()->getAsConstantUnion()->getIConst(0);
out << mResourcesHLSL->InterfaceBlockInstanceString(
instanceArraySymbol->getName(), arrayIndex);
return false;
}
else
{
return writeEOpIndexDirectOrIndirectOutput(out, binaryNode, blockMemberInfo);
}
break;
}
else
case EOpIndexIndirect:
{
writeEOpIndexDirectOrIndirectOutput(out, visit, node);
// We do not currently support indirect references to interface blocks
ASSERT(binaryNode->getLeft()->getBasicType() != EbtInterfaceBlock);
return writeEOpIndexDirectOrIndirectOutput(out, binaryNode, blockMemberInfo);
break;
}
break;
}
case EOpIndexIndirect:
{
if (!IsInShaderStorageBlock(node->getLeft()))
case EOpIndexDirectStruct:
{
return mOutputHLSL->visitBinary(visit, node);
}
// We do not currently support indirect references to interface blocks
ASSERT(node->getLeft()->getBasicType() != EbtInterfaceBlock);
writeEOpIndexDirectOrIndirectOutput(out, visit, node);
break;
}
case EOpIndexDirectStruct:
{
if (!IsInShaderStorageBlock(node->getLeft()))
{
return mOutputHLSL->visitBinary(visit, node);
}
if (visit == InVisit)
{
ASSERT(IsInShaderStorageBlock(node->getLeft()));
const TStructure *structure = node->getLeft()->getType().getStruct();
const TIntermConstantUnion *index = node->getRight()->getAsConstantUnion();
// We do not currently support direct references to interface blocks
ASSERT(binaryNode->getLeft()->getBasicType() != EbtInterfaceBlock);
TIntermTyped *left = traverseNode(out, binaryNode->getLeft(), blockMemberInfo);
const TStructure *structure = binaryNode->getLeft()->getType().getStruct();
const TIntermConstantUnion *index = binaryNode->getRight()->getAsConstantUnion();
const TField *field = structure->fields()[index->getIConst(0)];
out << " + ";
writeDotOperatorOutput(out, field);
return false;
return Add(createFieldOffset(field, blockMemberInfo), left);
break;
}
break;
}
case EOpIndexDirectInterfaceBlock:
if (!IsInShaderStorageBlock(node->getLeft()))
case EOpIndexDirectInterfaceBlock:
{
return mOutputHLSL->visitBinary(visit, node);
}
if (visit == InVisit)
{
ASSERT(IsInShaderStorageBlock(node->getLeft()));
out << ", ";
ASSERT(IsInShaderStorageBlock(binaryNode->getLeft()));
traverseNode(out, binaryNode->getLeft(), blockMemberInfo);
const TInterfaceBlock *interfaceBlock =
node->getLeft()->getType().getInterfaceBlock();
const TIntermConstantUnion *index = node->getRight()->getAsConstantUnion();
binaryNode->getLeft()->getType().getInterfaceBlock();
const TIntermConstantUnion *index = binaryNode->getRight()->getAsConstantUnion();
const TField *field = interfaceBlock->fields()[index->getIConst(0)];
writeDotOperatorOutput(out, field);
return false;
return createFieldOffset(field, blockMemberInfo);
break;
}
break;
default:
// It may have other operators in EOpIndexIndirect. Such as buffer.attribs[(y * gridSize
// + x) * 6u + 0u]
return mOutputHLSL->visitBinary(visit, node);
default:
return nullptr;
}
}
return true;
return nullptr;
}
void ShaderStorageBlockOutputHLSL::writeEOpIndexDirectOrIndirectOutput(TInfoSinkBase &out,
Visit visit,
TIntermBinary *node)
TIntermTyped *ShaderStorageBlockOutputHLSL::writeEOpIndexDirectOrIndirectOutput(
TInfoSinkBase &out,
TIntermBinary *node,
BlockMemberInfo *blockMemberInfo)
{
ASSERT(IsInShaderStorageBlock(node->getLeft()));
if (visit == InVisit)
TIntermTyped *left = traverseNode(out, node->getLeft(), blockMemberInfo);
TIntermTyped *right = node->getRight()->deepCopy();
const TType &type = node->getLeft()->getType();
TLayoutBlockStorage storage;
bool rowMajor;
GetBlockLayoutInfo(node, false, &storage, &rowMajor);
if (type.isArray())
{
const TType &type = node->getLeft()->getType();
// For array of arrays, we calculate the offset using the formula below:
// elementStride * (a3 * a2 * a1 * i0 + a3 * a2 * i1 + a3 * i2 + i3)
// Note: assume that there are 4 dimensions.
// a0, a1, a2, a3 is the size of the array in each dimension. (S s[a0][a1][a2][a3])
// i0, i1, i2, i3 is the index of the array in each dimension. (s[i0][i1][i2][i3])
if (IsInArrayOfArraysChain(node->getLeft()))
const TSpan<const unsigned int> &arraySizes = type.getArraySizes();
for (unsigned int i = 0; i < arraySizes.size() - 1; i++)
{
if (type.isArrayOfArrays())
{
const TSpan<const unsigned int> &arraySizes = type.getArraySizes();
// Don't need to concern the tail comma which will be used to multiply the index.
for (unsigned int i = 0; i < (arraySizes.size() - 1); i++)
{
out << arraySizes[i];
out << " * ";
}
}
right = Mul(CreateUIntNode(arraySizes[i]), right);
}
right = Mul(CreateUIntNode(blockMemberInfo->arrayStride), right);
}
else if (type.isMatrix())
{
if (rowMajor)
{
right = Mul(CreateUIntNode(BlockLayoutEncoder::kBytesPerComponent), right);
}
else
{
if (node->getType().isVector() && type.isMatrix())
{
if (mRowMajor)
{
out << " + " << str(BlockLayoutEncoder::kBytesPerComponent);
}
else
{
out << " + " << str(mMatrixStride);
}
}
else if (node->getType().isScalar() && !type.isArray())
{
if (mRowMajor)
{
out << " + " << str(mMatrixStride);
}
else
{
out << " + " << str(BlockLayoutEncoder::kBytesPerComponent);
}
}
out << " * ";
right = Mul(CreateUIntNode(blockMemberInfo->matrixStride), right);
}
}
else if (visit == PostVisit)
else if (type.isVector())
{
// This is used to output the '+' in the array of arrays formula in above.
if (node->getType().isArray() && !isEndOfSSBOAccessChain())
if (blockMemberInfo->isRowMajorMatrix)
{
out << " + ";
right = Mul(CreateUIntNode(blockMemberInfo->matrixStride), right);
}
// This corresponds to '(' in writeDotOperatorOutput when fieldType.isArrayOfArrays() is
// true.
if (IsInArrayOfArraysChain(node->getLeft()) && !node->getType().isArray())
else
{
out << ")";
}
if (mLocationAsTheLastArgument && isEndOfSSBOAccessChain())
{
out << ")";
right = Mul(CreateUIntNode(BlockLayoutEncoder::kBytesPerComponent), right);
}
}
return Add(left, right);
}
void ShaderStorageBlockOutputHLSL::writeDotOperatorOutput(TInfoSinkBase &out, const TField *field)
TIntermTyped *ShaderStorageBlockOutputHLSL::createFieldOffset(const TField *field,
BlockMemberInfo *blockMemberInfo)
{
auto fieldInfoIter = mBlockMemberInfoMap.find(field);
ASSERT(fieldInfoIter != mBlockMemberInfoMap.end());
const BlockMemberInfo &memberInfo = fieldInfoIter->second;
mMatrixStride = memberInfo.matrixStride;
mRowMajor = memberInfo.isRowMajorMatrix;
out << memberInfo.offset;
const TType &fieldType = *field->type();
if (fieldType.isArray() && !isEndOfSSBOAccessChain())
{
out << " + ";
out << memberInfo.arrayStride;
if (fieldType.isArrayOfArrays())
{
out << " * (";
}
}
if (mLocationAsTheLastArgument && isEndOfSSBOAccessChain())
{
out << ")";
}
*blockMemberInfo = fieldInfoIter->second;
return CreateUIntNode(blockMemberInfo->offset);
}
} // namespace sh

Просмотреть файл

@ -10,9 +10,9 @@
#ifndef COMPILER_TRANSLATOR_SHADERSTORAGEBLOCKOUTPUTHLSL_H_
#define COMPILER_TRANSLATOR_SHADERSTORAGEBLOCKOUTPUTHLSL_H_
#include "compiler/translator/IntermNode.h"
#include "compiler/translator/ShaderStorageBlockFunctionHLSL.h"
#include "compiler/translator/blocklayout.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
namespace sh
{
@ -36,15 +36,14 @@ using BlockMemberInfoMap = std::map<const TField *, BlockMemberInfo>;
using ShaderVarToFieldMap = std::map<std::string, const TField *>;
class ShaderStorageBlockOutputHLSL : public TIntermTraverser
class ShaderStorageBlockOutputHLSL
{
public:
ShaderStorageBlockOutputHLSL(OutputHLSL *outputHLSL,
TSymbolTable *symbolTable,
ResourcesHLSL *resourcesHLSL,
const std::vector<InterfaceBlock> &shaderStorageBlocks);
~ShaderStorageBlockOutputHLSL() override;
~ShaderStorageBlockOutputHLSL();
// This writes part of the function call to store a value to a SSBO to the output stream. After
// calling this, ", <stored value>)" should be written to the output stream to complete the
@ -59,26 +58,21 @@ class ShaderStorageBlockOutputHLSL : public TIntermTraverser
void writeShaderStorageBlocksHeader(TInfoSinkBase &out) const;
protected:
void visitSymbol(TIntermSymbol *) override;
void visitConstantUnion(TIntermConstantUnion *) override;
bool visitSwizzle(Visit visit, TIntermSwizzle *node) override;
bool visitBinary(Visit visit, TIntermBinary *) override;
bool visitAggregate(Visit visit, TIntermAggregate *node) override;
bool visitTernary(Visit visit, TIntermTernary *) override;
bool visitUnary(Visit visit, TIntermUnary *) override;
private:
void traverseSSBOAccess(TIntermTyped *node, SSBOMethod method);
void setMatrixStride(TIntermTyped *node, TLayoutBlockStorage storage, bool rowMajor);
bool isEndOfSSBOAccessChain();
void writeEOpIndexDirectOrIndirectOutput(TInfoSinkBase &out, Visit visit, TIntermBinary *node);
TIntermTyped *traverseNode(TInfoSinkBase &out,
TIntermTyped *node,
BlockMemberInfo *blockMemberInfo);
int getMatrixStride(TIntermTyped *node,
TLayoutBlockStorage storage,
bool rowMajor,
bool *isRowMajor) const;
TIntermTyped *writeEOpIndexDirectOrIndirectOutput(TInfoSinkBase &out,
TIntermBinary *node,
BlockMemberInfo *blockMemberInfo);
// Common part in dot operations.
void writeDotOperatorOutput(TInfoSinkBase &out, const TField *field);
int mMatrixStride;
bool mRowMajor;
bool mLocationAsTheLastArgument;
TIntermTyped *createFieldOffset(const TField *field, BlockMemberInfo *blockMemberInfo);
void collectShaderStorageBlocks(TIntermTyped *node);
OutputHLSL *mOutputHLSL;
ShaderStorageBlockFunctionHLSL *mSSBOFunctionHLSL;
ResourcesHLSL *mResourcesHLSL;

Просмотреть файл

@ -40,14 +40,19 @@ ShaderVariable::ShaderVariable(GLenum typeIn)
active(false),
isRowMajorLayout(false),
location(-1),
hasImplicitLocation(false),
binding(-1),
imageUnitFormat(GL_NONE),
offset(-1),
readonly(false),
writeonly(false),
isFragmentInOut(false),
index(-1),
yuv(false),
interpolation(INTERPOLATION_SMOOTH),
isInvariant(false),
isShaderIOBlock(false),
isPatch(false),
texelFetchStaticUse(false),
flattenedOffsetInParentArrays(-1)
{}
@ -69,17 +74,23 @@ ShaderVariable::ShaderVariable(const ShaderVariable &other)
staticUse(other.staticUse),
active(other.active),
fields(other.fields),
structName(other.structName),
structOrBlockName(other.structOrBlockName),
mappedStructOrBlockName(other.mappedStructOrBlockName),
isRowMajorLayout(other.isRowMajorLayout),
location(other.location),
hasImplicitLocation(other.hasImplicitLocation),
binding(other.binding),
imageUnitFormat(other.imageUnitFormat),
offset(other.offset),
readonly(other.readonly),
writeonly(other.writeonly),
isFragmentInOut(other.isFragmentInOut),
index(other.index),
yuv(other.yuv),
interpolation(other.interpolation),
isInvariant(other.isInvariant),
isShaderIOBlock(other.isShaderIOBlock),
isPatch(other.isPatch),
texelFetchStaticUse(other.texelFetchStaticUse),
flattenedOffsetInParentArrays(other.flattenedOffsetInParentArrays)
{}
@ -94,18 +105,24 @@ ShaderVariable &ShaderVariable::operator=(const ShaderVariable &other)
staticUse = other.staticUse;
active = other.active;
fields = other.fields;
structName = other.structName;
structOrBlockName = other.structOrBlockName;
mappedStructOrBlockName = other.mappedStructOrBlockName;
isRowMajorLayout = other.isRowMajorLayout;
flattenedOffsetInParentArrays = other.flattenedOffsetInParentArrays;
location = other.location;
hasImplicitLocation = other.hasImplicitLocation;
binding = other.binding;
imageUnitFormat = other.imageUnitFormat;
offset = other.offset;
readonly = other.readonly;
writeonly = other.writeonly;
isFragmentInOut = other.isFragmentInOut;
index = other.index;
yuv = other.yuv;
interpolation = other.interpolation;
isInvariant = other.isInvariant;
isShaderIOBlock = other.isShaderIOBlock;
isPatch = other.isPatch;
texelFetchStaticUse = other.texelFetchStaticUse;
return *this;
}
@ -115,12 +132,16 @@ bool ShaderVariable::operator==(const ShaderVariable &other) const
if (type != other.type || precision != other.precision || name != other.name ||
mappedName != other.mappedName || arraySizes != other.arraySizes ||
staticUse != other.staticUse || active != other.active ||
fields.size() != other.fields.size() || structName != other.structName ||
fields.size() != other.fields.size() || structOrBlockName != other.structOrBlockName ||
mappedStructOrBlockName != other.mappedStructOrBlockName ||
isRowMajorLayout != other.isRowMajorLayout || location != other.location ||
binding != other.binding || imageUnitFormat != other.imageUnitFormat ||
offset != other.offset || readonly != other.readonly || writeonly != other.writeonly ||
index != other.index || interpolation != other.interpolation ||
isInvariant != other.isInvariant || texelFetchStaticUse != other.texelFetchStaticUse)
hasImplicitLocation != other.hasImplicitLocation || binding != other.binding ||
imageUnitFormat != other.imageUnitFormat || offset != other.offset ||
readonly != other.readonly || writeonly != other.writeonly || index != other.index ||
yuv != other.yuv || interpolation != other.interpolation ||
isInvariant != other.isInvariant || isShaderIOBlock != other.isShaderIOBlock ||
isPatch != other.isPatch || texelFetchStaticUse != other.texelFetchStaticUse ||
isFragmentInOut != other.isFragmentInOut)
{
return false;
}
@ -293,16 +314,28 @@ const sh::ShaderVariable *ShaderVariable::findField(const std::string &fullName,
return nullptr;
}
size_t pos = fullName.find_first_of(".");
std::string topName, fieldName;
if (pos == std::string::npos)
{
return nullptr;
// If this is a shader I/O block without an instance name, return the field given only the
// field name.
if (!isShaderIOBlock || !name.empty())
{
return nullptr;
}
fieldName = fullName;
}
std::string topName = fullName.substr(0, pos);
if (topName != name)
else
{
return nullptr;
std::string baseName = isShaderIOBlock ? structOrBlockName : name;
topName = fullName.substr(0, pos);
if (topName != baseName)
{
return nullptr;
}
fieldName = fullName.substr(pos + 1);
}
std::string fieldName = fullName.substr(pos + 1);
if (fieldName.empty())
{
return nullptr;
@ -320,7 +353,7 @@ const sh::ShaderVariable *ShaderVariable::findField(const std::string &fullName,
bool ShaderVariable::isBuiltIn() const
{
return (name.size() >= 4 && name[0] == 'g' && name[1] == 'l' && name[2] == '_');
return gl::IsBuiltInName(name);
}
bool ShaderVariable::isEmulatedBuiltIn() const
@ -356,11 +389,28 @@ bool ShaderVariable::isSameVariableAtLinkTime(const ShaderVariable &other,
return false;
}
}
if (structName != other.structName)
if (structOrBlockName != other.structOrBlockName ||
mappedStructOrBlockName != other.mappedStructOrBlockName)
return false;
return true;
}
void ShaderVariable::updateEffectiveLocation(const sh::ShaderVariable &parent)
{
if ((location < 0 || hasImplicitLocation) && !parent.hasImplicitLocation)
{
location = parent.location;
}
}
void ShaderVariable::resetEffectiveLocation()
{
if (hasImplicitLocation)
{
location = -1;
}
}
bool ShaderVariable::isSameUniformAtLinkTime(const ShaderVariable &other) const
{
// Enforce a consistent match.
@ -400,11 +450,28 @@ bool ShaderVariable::isSameVaryingAtLinkTime(const ShaderVariable &other) const
bool ShaderVariable::isSameVaryingAtLinkTime(const ShaderVariable &other, int shaderVersion) const
{
return (ShaderVariable::isSameVariableAtLinkTime(other, false, false) &&
InterpolationTypesMatch(interpolation, other.interpolation) &&
(shaderVersion >= 300 || isInvariant == other.isInvariant) &&
(location == other.location) &&
(name == other.name || (shaderVersion >= 310 && location >= 0)));
return ShaderVariable::isSameVariableAtLinkTime(other, false, false) &&
InterpolationTypesMatch(interpolation, other.interpolation) &&
(shaderVersion >= 300 || isInvariant == other.isInvariant) &&
(isPatch == other.isPatch) && location == other.location &&
(isSameNameAtLinkTime(other) || (shaderVersion >= 310 && location >= 0));
}
bool ShaderVariable::isSameNameAtLinkTime(const ShaderVariable &other) const
{
if (isShaderIOBlock != other.isShaderIOBlock)
{
return false;
}
if (isShaderIOBlock)
{
// Shader I/O blocks match by block name.
return structOrBlockName == other.structOrBlockName;
}
// Otherwise match by name.
return name == other.name;
}
InterfaceBlock::InterfaceBlock()
@ -482,7 +549,7 @@ bool InterfaceBlock::isSameInterfaceBlockAtLinkTime(const InterfaceBlock &other)
bool InterfaceBlock::isBuiltIn() const
{
return (name.size() >= 4 && name[0] == 'g' && name[1] == 'l' && name[2] == '_');
return gl::IsBuiltInName(name);
}
void WorkGroupSize::fill(int fillValue)

Просмотреть файл

@ -62,7 +62,7 @@ TString Define(const TStructure &structure,
if (padHelper)
{
string += padHelper->postPaddingString(fieldType, useHLSLRowMajorPacking,
memberSize == 0 && forcePadding);
memberSize == 0, forcePadding);
}
}
}
@ -92,6 +92,12 @@ TString WriteParameterList(const std::vector<TType> &parameters)
return parameterList;
}
int GetElementPadding(int elementIndex, int alignment)
{
const int paddingOffset = elementIndex % alignment;
return paddingOffset != 0 ? (alignment - paddingOffset) : 0;
}
} // anonymous namespace
Std140PaddingHelper::Std140PaddingHelper(const std::map<TString, int> &structElementIndexes,
@ -123,9 +129,19 @@ int Std140PaddingHelper::prePadding(const TType &type, bool forcePadding)
{
if (type.getBasicType() == EbtStruct || type.isMatrix() || type.isArray())
{
// no padding needed, HLSL will align the field to a new register
mElementIndex = 0;
return 0;
if (forcePadding)
{
// Add padding between the structure's members to follow the std140 rules manually.
const int forcePaddingCount = GetElementPadding(mElementIndex, 4);
mElementIndex = 0;
return forcePaddingCount;
}
else
{
// no padding needed, HLSL will align the field to a new register
mElementIndex = 0;
return 0;
}
}
const GLenum glType = GLVariableType(type);
@ -133,18 +149,27 @@ int Std140PaddingHelper::prePadding(const TType &type, bool forcePadding)
if (numComponents >= 4)
{
// no padding needed, HLSL will align the field to a new register
mElementIndex = 0;
return 0;
if (forcePadding)
{
// Add padding between the structure's members to follow the std140 rules manually.
const int forcePaddingCount = GetElementPadding(mElementIndex, 4);
mElementIndex = numComponents % 4;
return forcePaddingCount;
}
else
{
// no padding needed, HLSL will align the field to a new register
mElementIndex = 0;
return 0;
}
}
if (mElementIndex + numComponents > 4)
{
if (forcePadding)
{
// If this structure will be used as HLSL StructuredBuffer member's type, we should add
// padding between the structure's members to follow the std140 rules manually.
const int forcePaddingCount = 4 - mElementIndex;
// Add padding between the structure's members to follow the std140 rules manually.
const int forcePaddingCount = GetElementPadding(mElementIndex, 4);
mElementIndex = numComponents;
return forcePaddingCount;
}
@ -156,9 +181,8 @@ int Std140PaddingHelper::prePadding(const TType &type, bool forcePadding)
}
}
const int alignment = numComponents == 3 ? 4 : numComponents;
const int paddingOffset = (mElementIndex % alignment);
const int paddingCount = (paddingOffset != 0 ? (alignment - paddingOffset) : 0);
const int alignment = numComponents == 3 ? 4 : numComponents;
const int paddingCount = GetElementPadding(mElementIndex, alignment);
mElementIndex += paddingCount;
mElementIndex += numComponents;
@ -183,23 +207,33 @@ TString Std140PaddingHelper::prePaddingString(const TType &type, bool forcePaddi
TString Std140PaddingHelper::postPaddingString(const TType &type,
bool useHLSLRowMajorPacking,
bool isLastElement,
bool forcePadding)
{
if (!type.isMatrix() && !type.isArray() && type.getBasicType() != EbtStruct)
{
if (forcePadding)
{
// If this structure will be used as HLSL StructuredBuffer member's type, we
// should force to pad the end of the structure to follow the std140 rules.
TString forcePaddingStr;
const int paddingOffset = mElementIndex % 4;
const int paddingCount = paddingOffset != 0 ? (4 - paddingOffset) : 0;
for (int paddingIndex = 0; paddingIndex < paddingCount; paddingIndex++)
const GLenum glType = GLVariableType(type);
const int numComponents = gl::VariableComponentCount(glType);
if (isLastElement || (numComponents >= 4))
{
forcePaddingStr += " float pad_" + next() + ";\n";
// If this structure will be used as HLSL StructuredBuffer member's type, in
// order to follow the std140 rules, add padding at the end of the structure
// if necessary. Or if the current element straddles a vec4 boundary, add
// padding to round up the base offset of the next element to the base
// alignment of a vec4.
TString forcePaddingStr;
const int paddingCount = GetElementPadding(mElementIndex, 4);
for (int paddingIndex = 0; paddingIndex < paddingCount; paddingIndex++)
{
forcePaddingStr += " float pad_" + next() + ";\n";
}
mElementIndex = 0;
return forcePaddingStr;
}
return forcePaddingStr;
}
return "";
}

Просмотреть файл

@ -34,7 +34,10 @@ class Std140PaddingHelper
int elementIndex() const { return mElementIndex; }
int prePadding(const TType &type, bool forcePadding);
TString prePaddingString(const TType &type, bool forcePadding);
TString postPaddingString(const TType &type, bool useHLSLRowMajorPacking, bool forcePadding);
TString postPaddingString(const TType &type,
bool useHLSLRowMajorPacking,
bool isLastElement,
bool forcePadding);
private:
TString next();

Просмотреть файл

@ -25,6 +25,7 @@ constexpr const ImmutableString kMainName("main");
constexpr const ImmutableString kImageLoadName("imageLoad");
constexpr const ImmutableString kImageStoreName("imageStore");
constexpr const ImmutableString kImageSizeName("imageSize");
constexpr const ImmutableString kImageAtomicExchangeName("imageAtomicExchange");
constexpr const ImmutableString kAtomicCounterName("atomicCounter");
static const char kFunctionMangledNameSeparator = '(';
@ -214,7 +215,8 @@ bool TFunction::isMain() const
bool TFunction::isImageFunction() const
{
return symbolType() == SymbolType::BuiltIn &&
(name() == kImageSizeName || name() == kImageLoadName || name() == kImageStoreName);
(name() == kImageSizeName || name() == kImageLoadName || name() == kImageStoreName ||
name() == kImageAtomicExchangeName);
}
bool TFunction::isAtomicCounterFunction() const

Просмотреть файл

@ -138,7 +138,7 @@ class TStructure : public TSymbol, public TFieldListCollection
// TODO(zmo): Find a way to get rid of the const_cast in function
// setName(). At the moment keep this function private so only
// friend class RegenerateStructNames may call it.
friend class RegenerateStructNames;
friend class RegenerateStructNamesTraverser;
void setName(const ImmutableString &name);
bool mAtGlobalScope;

Просмотреть файл

@ -39,6 +39,10 @@ bool CheckShaderType(Shader expected, GLenum actual)
return actual == GL_GEOMETRY_SHADER;
case Shader::GEOMETRY_EXT:
return actual == GL_GEOMETRY_SHADER_EXT;
case Shader::TESS_CONTROL_EXT:
return actual == GL_TESS_CONTROL_SHADER_EXT;
case Shader::TESS_EVALUATION_EXT:
return actual == GL_TESS_EVALUATION_SHADER_EXT;
case Shader::NOT_COMPUTE:
return actual != GL_COMPUTE_SHADER;
default:
@ -411,6 +415,8 @@ void TSymbolTable::initializeBuiltIns(sh::GLenum type,
case GL_VERTEX_SHADER:
case GL_COMPUTE_SHADER:
case GL_GEOMETRY_SHADER_EXT:
case GL_TESS_CONTROL_SHADER_EXT:
case GL_TESS_EVALUATION_SHADER_EXT:
setDefaultPrecision(EbtInt, EbpHigh);
setDefaultPrecision(EbtFloat, EbpHigh);
break;

Просмотреть файл

@ -45,11 +45,13 @@
enum class Shader : uint8_t
{
ALL,
FRAGMENT, // GL_FRAGMENT_SHADER
VERTEX, // GL_VERTEX_SHADER
COMPUTE, // GL_COMPUTE_SHADER
GEOMETRY, // GL_GEOMETRY_SHADER
GEOMETRY_EXT, // GL_GEOMETRY_SHADER_EXT
FRAGMENT, // GL_FRAGMENT_SHADER
VERTEX, // GL_VERTEX_SHADER
COMPUTE, // GL_COMPUTE_SHADER
GEOMETRY, // GL_GEOMETRY_SHADER
GEOMETRY_EXT, // GL_GEOMETRY_SHADER_EXT
TESS_CONTROL_EXT, // GL_TESS_CONTROL_SHADER_EXT
TESS_EVALUATION_EXT, // GL_TESS_EVALUATION_SHADER_EXT
NOT_COMPUTE
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -2,7 +2,7 @@
// Generated by gen_builtin_symbols.py using data from builtin_variables.json and
// builtin_function_declarations.txt.
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// 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.
//
@ -18,61 +18,145 @@ namespace sh
class TSymbolTableBase
{
public:
TSymbolTableBase() = default;
TSymbol *m_gl_DepthRangeParameters = nullptr;
TSymbol *m_gl_DepthRange = nullptr;
TSymbol *m_gl_MaxVertexAttribs = nullptr;
TSymbol *m_gl_MaxVertexUniformVectors = nullptr;
TSymbol *m_gl_MaxVertexTextureImageUnits = nullptr;
TSymbol *m_gl_MaxCombinedTextureImageUnits = nullptr;
TSymbol *m_gl_MaxTextureImageUnits = nullptr;
TSymbol *m_gl_MaxFragmentUniformVectors = nullptr;
TSymbol *m_gl_MaxVaryingVectors = nullptr;
TSymbol *m_gl_MaxDrawBuffers = nullptr;
TSymbol *m_gl_MaxDualSourceDrawBuffersEXT = nullptr;
TSymbol *m_gl_MaxVertexOutputVectors = nullptr;
TSymbol *m_gl_MaxFragmentInputVectors = nullptr;
TSymbol *m_gl_MinProgramTexelOffset = nullptr;
TSymbol *m_gl_MaxProgramTexelOffset = nullptr;
TSymbol *m_gl_MaxImageUnits = nullptr;
TSymbol *m_gl_MaxVertexImageUniforms = nullptr;
TSymbol *m_gl_MaxFragmentImageUniforms = nullptr;
TSymbol *m_gl_MaxComputeImageUniforms = nullptr;
TSymbol *m_gl_MaxCombinedImageUniforms = nullptr;
TSymbol *m_gl_MaxCombinedShaderOutputResources = nullptr;
TSymbol *m_gl_MaxComputeWorkGroupCount = nullptr;
TSymbol *m_gl_MaxComputeWorkGroupSize = nullptr;
TSymbol *m_gl_MaxComputeUniformComponents = nullptr;
TSymbol *m_gl_MaxComputeTextureImageUnits = nullptr;
TSymbol *m_gl_MaxComputeAtomicCounters = nullptr;
TSymbol *m_gl_MaxComputeAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxVertexAtomicCounters = nullptr;
TSymbol *m_gl_MaxFragmentAtomicCounters = nullptr;
TSymbol *m_gl_MaxCombinedAtomicCounters = nullptr;
TSymbol *m_gl_MaxAtomicCounterBindings = nullptr;
TSymbol *m_gl_MaxVertexAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxFragmentAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxCombinedAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxAtomicCounterBufferSize = nullptr;
TSymbol *m_gl_MaxGeometryInputComponents = nullptr;
TSymbol *m_gl_MaxGeometryOutputComponents = nullptr;
TSymbol *m_gl_MaxGeometryImageUniforms = nullptr;
TSymbol *m_gl_MaxGeometryTextureImageUnits = nullptr;
TSymbol *m_gl_MaxGeometryOutputVertices = nullptr;
TSymbol *m_gl_MaxGeometryTotalOutputComponents = nullptr;
TSymbol *m_gl_MaxGeometryUniformComponents = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCounters = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCounterBuffers = nullptr;
TSymbol *m_gl_FragData = nullptr;
TSymbol *m_gl_SecondaryFragDataEXT = nullptr;
TSymbol *m_gl_FragDepthEXT = nullptr;
TSymbol *m_gl_LastFragData = nullptr;
TSymbol *m_gl_LastFragDataNV = nullptr;
TSymbol *m_gl_ClipDistance = nullptr;
TSymbol *m_gl_MaxClipDistances = nullptr;
TSymbol *m_gl_PerVertex = nullptr;
TSymbol *m_gl_in = nullptr;
TSymbol *m_gl_PositionGS = nullptr;
TSymbolTableBase() = default;
TSymbol *m_gl_DepthRangeParameters = nullptr;
TSymbol *m_gl_DepthRange = nullptr;
TSymbol *m_gl_MaxVertexAttribs = nullptr;
TSymbol *m_gl_MaxVertexUniformVectors = nullptr;
TSymbol *m_gl_MaxVertexTextureImageUnits = nullptr;
TSymbol *m_gl_MaxCombinedTextureImageUnits = nullptr;
TSymbol *m_gl_MaxTextureImageUnits = nullptr;
TSymbol *m_gl_MaxFragmentUniformVectors = nullptr;
TSymbol *m_gl_MaxVaryingVectors = nullptr;
TSymbol *m_gl_MaxDrawBuffers = nullptr;
TSymbol *m_gl_MaxDualSourceDrawBuffersEXT = nullptr;
TSymbol *m_gl_MaxVertexOutputVectors = nullptr;
TSymbol *m_gl_MaxFragmentInputVectors = nullptr;
TSymbol *m_gl_MinProgramTexelOffset = nullptr;
TSymbol *m_gl_MaxProgramTexelOffset = nullptr;
TSymbol *m_gl_MaxImageUnits = nullptr;
TSymbol *m_gl_MaxVertexImageUniforms = nullptr;
TSymbol *m_gl_MaxFragmentImageUniforms = nullptr;
TSymbol *m_gl_MaxComputeImageUniforms = nullptr;
TSymbol *m_gl_MaxCombinedImageUniforms = nullptr;
TSymbol *m_gl_MaxCombinedShaderOutputResources = nullptr;
TSymbol *m_gl_MaxComputeWorkGroupCount = nullptr;
TSymbol *m_gl_MaxComputeWorkGroupSize = nullptr;
TSymbol *m_gl_MaxComputeUniformComponents = nullptr;
TSymbol *m_gl_MaxComputeTextureImageUnits = nullptr;
TSymbol *m_gl_MaxComputeAtomicCounters = nullptr;
TSymbol *m_gl_MaxComputeAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxVertexAtomicCounters = nullptr;
TSymbol *m_gl_MaxFragmentAtomicCounters = nullptr;
TSymbol *m_gl_MaxCombinedAtomicCounters = nullptr;
TSymbol *m_gl_MaxAtomicCounterBindings = nullptr;
TSymbol *m_gl_MaxVertexAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxFragmentAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxCombinedAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxAtomicCounterBufferSize = nullptr;
TSymbol *m_gl_MaxGeometryInputComponents = nullptr;
TSymbol *m_gl_MaxGeometryInputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryOutputComponents = nullptr;
TSymbol *m_gl_MaxGeometryOutputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryImageUniforms = nullptr;
TSymbol *m_gl_MaxGeometryImageUniformsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryTextureImageUnits = nullptr;
TSymbol *m_gl_MaxGeometryTextureImageUnitsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryOutputVertices = nullptr;
TSymbol *m_gl_MaxGeometryOutputVerticesES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryTotalOutputComponents = nullptr;
TSymbol *m_gl_MaxGeometryTotalOutputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryUniformComponents = nullptr;
TSymbol *m_gl_MaxGeometryUniformComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCounters = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCountersES3_2 = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxGeometryAtomicCounterBuffersES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlInputComponents = nullptr;
TSymbol *m_gl_MaxTessControlInputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlOutputComponents = nullptr;
TSymbol *m_gl_MaxTessControlOutputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlTextureImageUnits = nullptr;
TSymbol *m_gl_MaxTessControlTextureImageUnitsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlUniformComponents = nullptr;
TSymbol *m_gl_MaxTessControlUniformComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlTotalOutputComponents = nullptr;
TSymbol *m_gl_MaxTessControlTotalOutputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlImageUniforms = nullptr;
TSymbol *m_gl_MaxTessControlImageUniformsES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlAtomicCounters = nullptr;
TSymbol *m_gl_MaxTessControlAtomicCountersES3_2 = nullptr;
TSymbol *m_gl_MaxTessControlAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxTessControlAtomicCounterBuffersES3_2 = nullptr;
TSymbol *m_gl_MaxTessPatchComponents = nullptr;
TSymbol *m_gl_MaxTessPatchComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxPatchVertices = nullptr;
TSymbol *m_gl_MaxPatchVerticesES3_2 = nullptr;
TSymbol *m_gl_MaxTessGenLevel = nullptr;
TSymbol *m_gl_MaxTessGenLevelES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationInputComponents = nullptr;
TSymbol *m_gl_MaxTessEvaluationInputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationOutputComponents = nullptr;
TSymbol *m_gl_MaxTessEvaluationOutputComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationTextureImageUnits = nullptr;
TSymbol *m_gl_MaxTessEvaluationTextureImageUnitsES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationUniformComponents = nullptr;
TSymbol *m_gl_MaxTessEvaluationUniformComponentsES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationImageUniforms = nullptr;
TSymbol *m_gl_MaxTessEvaluationImageUniformsES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationAtomicCounters = nullptr;
TSymbol *m_gl_MaxTessEvaluationAtomicCountersES3_2 = nullptr;
TSymbol *m_gl_MaxTessEvaluationAtomicCounterBuffers = nullptr;
TSymbol *m_gl_MaxTessEvaluationAtomicCounterBuffersES3_2 = nullptr;
TSymbol *m_gl_MaxSamples = nullptr;
TSymbol *m_gl_MaxSamplesES3_2 = nullptr;
TSymbol *m_gl_MaxClipDistancesAPPLE = nullptr;
TSymbol *m_gl_MaxCullDistancesEXT = nullptr;
TSymbol *m_gl_MaxCombinedClipAndCullDistancesEXT = nullptr;
TSymbol *m_gl_FragData = nullptr;
TSymbol *m_gl_SecondaryFragDataEXT = nullptr;
TSymbol *m_gl_FragDepthEXT = nullptr;
TSymbol *m_gl_LastFragData = nullptr;
TSymbol *m_gl_LastFragDataNonCoherent = nullptr;
TSymbol *m_gl_LastFragDataNV = nullptr;
TSymbol *m_gl_SampleMaskIn = nullptr;
TSymbol *m_gl_SampleMaskInES3_2 = nullptr;
TSymbol *m_gl_SampleMask = nullptr;
TSymbol *m_gl_SampleMaskES3_2 = nullptr;
TSymbol *m_gl_CullDistance = nullptr;
TSymbol *m_gl_ClipDistance = nullptr;
TSymbol *m_gl_ClipDistanceAPPLE = nullptr;
TSymbol *m_gl_CullDistanceEXT = nullptr;
TSymbol *m_gl_PerVertex = nullptr;
TSymbol *m_gl_PerVertexES3_2 = nullptr;
TSymbol *m_gl_in = nullptr;
TSymbol *m_gl_inES3_2 = nullptr;
TSymbol *m_gl_PositionGS = nullptr;
TSymbol *m_gl_PositionGSES3_2 = nullptr;
TSymbol *m_gl_TessLevelOuterTCS = nullptr;
TSymbol *m_gl_TessLevelOuterTCSES3_2 = nullptr;
TSymbol *m_gl_TessLevelInnerTCS = nullptr;
TSymbol *m_gl_TessLevelInnerTCSES3_2 = nullptr;
TSymbol *m_gl_PerVertexTCS = nullptr;
TSymbol *m_gl_PerVertexTCSES3_2 = nullptr;
TSymbol *m_gl_inTCS = nullptr;
TSymbol *m_gl_inTCSES3_2 = nullptr;
TSymbol *m_gl_outTCS = nullptr;
TSymbol *m_gl_outTCSES3_2 = nullptr;
TSymbol *m_gl_PositionTCS = nullptr;
TSymbol *m_gl_PositionTCSES3_2 = nullptr;
TSymbol *m_gl_TessLevelOuterTES = nullptr;
TSymbol *m_gl_TessLevelOuterTESES3_2 = nullptr;
TSymbol *m_gl_TessLevelInnerTES = nullptr;
TSymbol *m_gl_TessLevelInnerTESES3_2 = nullptr;
TSymbol *m_gl_PerVertexTES = nullptr;
TSymbol *m_gl_PerVertexTESES3_2 = nullptr;
TSymbol *m_gl_inTES = nullptr;
TSymbol *m_gl_inTESES3_2 = nullptr;
TSymbol *m_gl_outTES = nullptr;
TSymbol *m_gl_outTESES3_2 = nullptr;
TSymbol *m_gl_PositionTES = nullptr;
TSymbol *m_gl_PositionTESES3_2 = nullptr;
};
} // namespace sh

Просмотреть файл

@ -9,7 +9,7 @@
#include "angle_gl.h"
#include "compiler/translator/BuiltInFunctionEmulatorGLSL.h"
#include "compiler/translator/OutputESSL.h"
#include "compiler/translator/tree_ops/RecordConstantPrecision.h"
#include "compiler/translator/tree_ops/gl/RecordConstantPrecision.h"
namespace sh
{
@ -21,7 +21,7 @@ TranslatorESSL::TranslatorESSL(sh::GLenum type, ShShaderSpec spec)
void TranslatorESSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions)
{
if (compileOptions & SH_EMULATE_ATAN2_FLOAT_FUNCTION)
if ((compileOptions & SH_EMULATE_ATAN2_FLOAT_FUNCTION) != 0)
{
InitBuiltInAtanFunctionEmulatorForGLSLWorkarounds(emu);
}

Просмотреть файл

@ -11,9 +11,9 @@
#include "compiler/translator/ExtensionGLSL.h"
#include "compiler/translator/OutputGLSL.h"
#include "compiler/translator/VersionGLSL.h"
#include "compiler/translator/tree_ops/RewriteRowMajorMatrices.h"
#include "compiler/translator/tree_ops/RewriteTexelFetchOffset.h"
#include "compiler/translator/tree_ops/RewriteUnaryMinusOperatorFloat.h"
#include "compiler/translator/tree_ops/gl/mac/RewriteRowMajorMatrices.h"
#include "compiler/translator/tree_ops/gl/mac/RewriteUnaryMinusOperatorFloat.h"
namespace sh
{
@ -25,17 +25,17 @@ TranslatorGLSL::TranslatorGLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutpu
void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions)
{
if (compileOptions & SH_EMULATE_ABS_INT_FUNCTION)
if ((compileOptions & SH_EMULATE_ABS_INT_FUNCTION) != 0)
{
InitBuiltInAbsFunctionEmulatorForGLSLWorkarounds(emu, getShaderType());
}
if (compileOptions & SH_EMULATE_ISNAN_FLOAT_FUNCTION)
if ((compileOptions & SH_EMULATE_ISNAN_FLOAT_FUNCTION) != 0)
{
InitBuiltInIsnanFunctionEmulatorForGLSLWorkarounds(emu, getShaderVersion());
}
if (compileOptions & SH_EMULATE_ATAN2_FLOAT_FUNCTION)
if ((compileOptions & SH_EMULATE_ATAN2_FLOAT_FUNCTION) != 0)
{
InitBuiltInAtanFunctionEmulatorForGLSLWorkarounds(emu);
}
@ -234,7 +234,7 @@ bool TranslatorGLSL::shouldFlattenPragmaStdglInvariantAll()
bool TranslatorGLSL::shouldCollectVariables(ShCompileOptions compileOptions)
{
return (compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL) ||
return (compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL) != 0 ||
TCompiler::shouldCollectVariables(compileOptions);
}

Просмотреть файл

@ -7,26 +7,24 @@
#include "compiler/translator/TranslatorHLSL.h"
#include "compiler/translator/OutputHLSL.h"
#include "compiler/translator/tree_ops/AddDefaultReturnStatements.h"
#include "compiler/translator/tree_ops/ArrayReturnValueToOutParameter.h"
#include "compiler/translator/tree_ops/BreakVariableAliasingInInnerLoops.h"
#include "compiler/translator/tree_ops/ExpandIntegerPowExpressions.h"
#include "compiler/translator/tree_ops/PruneEmptyCases.h"
#include "compiler/translator/tree_ops/RecordUniformBlocksTranslatedToStructuredBuffers.h"
#include "compiler/translator/tree_ops/RemoveDynamicIndexing.h"
#include "compiler/translator/tree_ops/RewriteAtomicFunctionExpressions.h"
#include "compiler/translator/tree_ops/RewriteElseBlocks.h"
#include "compiler/translator/tree_ops/RewriteExpressionsWithShaderStorageBlock.h"
#include "compiler/translator/tree_ops/RewriteTexelFetchOffset.h"
#include "compiler/translator/tree_ops/RewriteUnaryMinusOperatorInt.h"
#include "compiler/translator/tree_ops/SeparateArrayConstructorStatements.h"
#include "compiler/translator/tree_ops/SeparateArrayInitialization.h"
#include "compiler/translator/tree_ops/SeparateDeclarations.h"
#include "compiler/translator/tree_ops/SeparateExpressionsReturningArrays.h"
#include "compiler/translator/tree_ops/SimplifyLoopConditions.h"
#include "compiler/translator/tree_ops/SplitSequenceOperator.h"
#include "compiler/translator/tree_ops/UnfoldShortCircuitToIf.h"
#include "compiler/translator/tree_ops/WrapSwitchStatementsInBlocks.h"
#include "compiler/translator/tree_ops/d3d/AddDefaultReturnStatements.h"
#include "compiler/translator/tree_ops/d3d/ArrayReturnValueToOutParameter.h"
#include "compiler/translator/tree_ops/d3d/BreakVariableAliasingInInnerLoops.h"
#include "compiler/translator/tree_ops/d3d/ExpandIntegerPowExpressions.h"
#include "compiler/translator/tree_ops/d3d/RecordUniformBlocksWithLargeArrayMember.h"
#include "compiler/translator/tree_ops/d3d/RewriteAtomicFunctionExpressions.h"
#include "compiler/translator/tree_ops/d3d/RewriteElseBlocks.h"
#include "compiler/translator/tree_ops/d3d/RewriteExpressionsWithShaderStorageBlock.h"
#include "compiler/translator/tree_ops/d3d/RewriteUnaryMinusOperatorInt.h"
#include "compiler/translator/tree_ops/d3d/SeparateArrayConstructorStatements.h"
#include "compiler/translator/tree_ops/d3d/SeparateArrayInitialization.h"
#include "compiler/translator/tree_ops/d3d/SeparateExpressionsReturningArrays.h"
#include "compiler/translator/tree_ops/d3d/UnfoldShortCircuitToIf.h"
#include "compiler/translator/tree_ops/d3d/WrapSwitchStatementsInBlocks.h"
#include "compiler/translator/tree_util/IntermNodePatternMatcher.h"
namespace sh
@ -184,25 +182,26 @@ bool TranslatorHLSL::translate(TIntermBlock *root,
}
}
mUniformBlocksTranslatedToStructuredBuffers.clear();
mUniformBlockOptimizedMap.clear();
mSlowCompilingUniformBlockSet.clear();
// In order to get the exact maximum of slots are available for shader resources, which would
// been bound with StructuredBuffer, we only translate uniform block with a large array member
// into StructuredBuffer when shader version is 300.
if (getShaderVersion() == 300 &&
(compileOptions & SH_ALLOW_TRANSLATE_UNIFORM_BLOCK_TO_STRUCTUREDBUFFER) != 0)
{
if (!sh::RecordUniformBlocksTranslatedToStructuredBuffers(
root, mUniformBlocksTranslatedToStructuredBuffers))
if (!sh::RecordUniformBlocksWithLargeArrayMember(root, mUniformBlockOptimizedMap,
mSlowCompilingUniformBlockSet))
{
return false;
}
}
sh::OutputHLSL outputHLSL(
getShaderType(), getShaderSpec(), getShaderVersion(), getExtensionBehavior(),
getSourcePath(), getOutputType(), numRenderTargets, maxDualSourceDrawBuffers, getUniforms(),
compileOptions, getComputeShaderLocalSize(), &getSymbolTable(), perfDiagnostics,
mUniformBlocksTranslatedToStructuredBuffers, mShaderStorageBlocks);
sh::OutputHLSL outputHLSL(getShaderType(), getShaderSpec(), getShaderVersion(),
getExtensionBehavior(), getSourcePath(), getOutputType(),
numRenderTargets, maxDualSourceDrawBuffers, getUniforms(),
compileOptions, getComputeShaderLocalSize(), &getSymbolTable(),
perfDiagnostics, mUniformBlockOptimizedMap, mShaderStorageBlocks);
outputHLSL.output(root, getInfoSink().obj);
@ -251,6 +250,11 @@ const std::map<std::string, unsigned int> *TranslatorHLSL::getUniformRegisterMap
return &mUniformRegisterMap;
}
const std::set<std::string> *TranslatorHLSL::getSlowCompilingUniformBlockSet() const
{
return &mSlowCompilingUniformBlockSet;
}
unsigned int TranslatorHLSL::getReadonlyImage2DRegisterIndex() const
{
return mReadonlyImage2DRegisterIndex;

Просмотреть файл

@ -24,6 +24,7 @@ class TranslatorHLSL : public TCompiler
bool hasUniformBlock(const std::string &interfaceBlockName) const;
unsigned int getUniformBlockRegister(const std::string &interfaceBlockName) const;
bool shouldUniformBlockUseStructuredBuffer(const std::string &uniformBlockName) const;
const std::set<std::string> *getSlowCompilingUniformBlockSet() const;
const std::map<std::string, unsigned int> *getUniformRegisterMap() const;
unsigned int getReadonlyImage2DRegisterIndex() const;
@ -46,7 +47,8 @@ class TranslatorHLSL : public TCompiler
unsigned int mReadonlyImage2DRegisterIndex;
unsigned int mImage2DRegisterIndex;
std::set<std::string> mUsedImage2DFunctionNames;
std::map<int, const TInterfaceBlock *> mUniformBlocksTranslatedToStructuredBuffers;
std::map<int, const TInterfaceBlock *> mUniformBlockOptimizedMap;
std::set<std::string> mSlowCompilingUniformBlockSet;
};
} // namespace sh

Просмотреть файл

@ -0,0 +1,76 @@
//
// 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.
//
// TranslatorMetal:
// A GLSL-based translator that outputs shaders that fit GL_KHR_vulkan_glsl.
// It takes into account some considerations for Metal backend also.
// The shaders are then fed into glslang to spit out SPIR-V.
// See: https://www.khronos.org/registry/vulkan/specs/misc/GL_KHR_vulkan_glsl.txt
//
// The SPIR-V will then be translated to Metal Shading Language later in Metal backend.
//
#ifndef LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_
#define LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_
#include "compiler/translator/TranslatorVulkan.h"
#include "compiler/translator/tree_util/DriverUniform.h"
#include "compiler/translator/tree_util/SpecializationConstant.h"
namespace sh
{
// TODO: http://anglebug.com/5339 Implement it using actual specialization constant. For now we are
// redirecting to driver uniforms
class SpecConstMetal : public SpecConst
{
public:
SpecConstMetal(TSymbolTable *symbolTable, ShCompileOptions compileOptions, GLenum shaderType)
: SpecConst(symbolTable, compileOptions, shaderType)
{}
~SpecConstMetal() override {}
private:
};
class DriverUniformMetal : public DriverUniform
{
public:
DriverUniformMetal() : DriverUniform() {}
~DriverUniformMetal() override {}
TIntermBinary *getHalfRenderAreaRef() const override;
TIntermBinary *getFlipXYRef() const override;
TIntermBinary *getNegFlipXYRef() const override;
TIntermSwizzle *getNegFlipYRef() const override;
TIntermBinary *getCoverageMaskFieldRef() const;
protected:
TFieldList *createUniformFields(TSymbolTable *symbolTable) override;
};
class TranslatorMetal : public TranslatorVulkan
{
public:
TranslatorMetal(sh::GLenum type, ShShaderSpec spec);
protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override;
ANGLE_NO_DISCARD bool transformDepthBeforeCorrection(
TIntermBlock *root,
const DriverUniform *driverUniforms) override;
ANGLE_NO_DISCARD bool insertSampleMaskWritingLogic(TInfoSinkBase &sink,
TIntermBlock *root,
const DriverUniformMetal *driverUniforms);
ANGLE_NO_DISCARD bool insertRasterizerDiscardLogic(TInfoSinkBase &sink, TIntermBlock *root);
};
} // namespace sh
#endif /* LIBANGLE_RENDERER_METAL_TRANSLATORMETAL_H_ */

Просмотреть файл

@ -0,0 +1,59 @@
//
// Copyright 2016 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.
//
// TranslatorVulkan:
// A GLSL-based translator that outputs shaders that fit GL_KHR_vulkan_glsl and feeds them into
// glslang to spit out SPIR-V.
// See: https://www.khronos.org/registry/vulkan/specs/misc/GL_KHR_vulkan_glsl.txt
//
#ifndef COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#define COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_
#include "compiler/translator/Compiler.h"
namespace sh
{
class TOutputVulkanGLSL;
class SpecConst;
class DriverUniform;
class TranslatorVulkan : public TCompiler
{
public:
TranslatorVulkan(sh::GLenum type, ShShaderSpec spec);
protected:
ANGLE_NO_DISCARD bool translate(TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
// Subclass can call this method to transform the AST before writing the final output.
// See TranslatorMetal.cpp.
ANGLE_NO_DISCARD bool translateImpl(TInfoSinkBase &sink,
TIntermBlock *root,
ShCompileOptions compileOptions,
PerformanceDiagnostics *perfDiagnostics,
SpecConst *specConst,
DriverUniform *driverUniforms);
// Give subclass such as TranslatorMetal a chance to do depth transform before
// TranslatorVulkan apply its own transform.
ANGLE_NO_DISCARD virtual bool transformDepthBeforeCorrection(
TIntermBlock *root,
const DriverUniform *driverUniforms)
{
return true;
}
// Generate SPIR-V out of intermediate GLSL through glslang.
ANGLE_NO_DISCARD bool compileToSpirv(const TInfoSinkBase &glsl);
};
} // namespace sh
#endif // COMPILER_TRANSLATOR_TRANSLATORVULKAN_H_

Просмотреть файл

@ -142,6 +142,18 @@ const char *getBasicString(TBasicType t)
return "atomic_uint";
case EbtSamplerVideoWEBGL:
return "samplerVideoWEBGL";
case EbtSubpassInput:
return "subpassInput";
case EbtISubpassInput:
return "isubpassInput";
case EbtUSubpassInput:
return "usubpassInput";
case EbtSubpassInputMS:
return "subpassInputMS";
case EbtISubpassInputMS:
return "isubpassInputMS";
case EbtUSubpassInputMS:
return "usubpassInputMS";
default:
UNREACHABLE();
return "unknown type";
@ -173,6 +185,7 @@ TType::TType(const TPublicType &p)
mInterfaceBlock(nullptr),
mStructure(nullptr),
mIsStructSpecifier(false),
mInterfaceBlockFieldIndex(0),
mMangledName(nullptr)
{
ASSERT(primarySize <= 4);
@ -211,20 +224,21 @@ TType::TType(const TType &t)
TType &TType::operator=(const TType &t)
{
type = t.type;
precision = t.precision;
qualifier = t.qualifier;
invariant = t.invariant;
precise = t.precise;
memoryQualifier = t.memoryQualifier;
layoutQualifier = t.layoutQualifier;
primarySize = t.primarySize;
secondarySize = t.secondarySize;
mArraySizesStorage = nullptr;
mInterfaceBlock = t.mInterfaceBlock;
mStructure = t.mStructure;
mIsStructSpecifier = t.mIsStructSpecifier;
mMangledName = t.mMangledName;
type = t.type;
precision = t.precision;
qualifier = t.qualifier;
invariant = t.invariant;
precise = t.precise;
memoryQualifier = t.memoryQualifier;
layoutQualifier = t.layoutQualifier;
primarySize = t.primarySize;
secondarySize = t.secondarySize;
mArraySizesStorage = nullptr;
mInterfaceBlock = t.mInterfaceBlock;
mStructure = t.mStructure;
mIsStructSpecifier = t.mIsStructSpecifier;
mInterfaceBlockFieldIndex = t.mInterfaceBlockFieldIndex;
mMangledName = t.mMangledName;
if (t.mArraySizesStorage)
{
@ -695,6 +709,12 @@ void TType::setInterfaceBlock(const TInterfaceBlock *interfaceBlockIn)
}
}
void TType::setInterfaceBlockField(const TInterfaceBlock *interfaceBlockIn, size_t fieldIndex)
{
setInterfaceBlock(interfaceBlockIn);
mInterfaceBlockFieldIndex = fieldIndex;
}
const char *TType::getMangledName() const
{
if (mMangledName == nullptr)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше