From acd44bb898996ff4e36b39b10e870e40bcaf2634 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Fri, 10 Nov 2023 19:24:56 -0500 Subject: One last push Signed-off-by: Andrew Opalach --- subprojects/glad/include/KHR/khrplatform.h | 27 ++++++++++-- subprojects/glad/include/glad/gl.h | 69 ++++++------------------------ subprojects/glad/meson.build | 7 +-- subprojects/glad/src/gl.c | 16 ++++--- 4 files changed, 48 insertions(+), 71 deletions(-) (limited to 'subprojects/glad') diff --git a/subprojects/glad/include/KHR/khrplatform.h b/subprojects/glad/include/KHR/khrplatform.h index dd22d92..0164644 100644 --- a/subprojects/glad/include/KHR/khrplatform.h +++ b/subprojects/glad/include/KHR/khrplatform.h @@ -153,6 +153,20 @@ typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 +/* + * To support platform where unsigned long cannot be used interchangeably with + * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. + * Ideally, we could just use (u)intptr_t everywhere, but this could result in + * ABI breakage if khronos_uintptr_t is changed from unsigned long to + * unsigned long long or similar (this results in different C++ name mangling). + * To avoid changes for existing platforms, we restrict usage of intptr_t to + * platforms where the size of a pointer is larger than the size of long. + */ +#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) +#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ +#define KHRONOS_USE_INTPTR_T +#endif +#endif #elif defined(__VMS ) || defined(__sgi) @@ -235,14 +249,21 @@ typedef unsigned short int khronos_uint16_t; * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears * to be the only LLP64 architecture in current use. */ -#ifdef _WIN64 +#ifdef KHRONOS_USE_INTPTR_T +typedef intptr_t khronos_intptr_t; +typedef uintptr_t khronos_uintptr_t; +#elif defined(_WIN64) typedef signed long long int khronos_intptr_t; typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; #else typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; +#endif + +#if defined(_WIN64) +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else typedef signed long int khronos_ssize_t; typedef unsigned long int khronos_usize_t; #endif diff --git a/subprojects/glad/include/glad/gl.h b/subprojects/glad/include/glad/gl.h index 936fbdd..4df7f2a 100644 --- a/subprojects/glad/include/glad/gl.h +++ b/subprojects/glad/include/glad/gl.h @@ -1,27 +1,28 @@ /** - * Loader generated by glad 2.0.0-beta on Tue Oct 27 23:17:49 2020 + * Loader generated by glad 2.0.4 on Fri Jul 21 17:13:42 2023 + * + * SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0 * * Generator: C/C++ * Specification: gl - * Extensions: 2 + * Extensions: 1 * * APIs: * - gl:core=3.3 * * Options: - * - MX_GLOBAL = False - * - ON_DEMAND = False - * - LOADER = False * - ALIAS = False - * - HEADER_ONLY = False * - DEBUG = False + * - HEADER_ONLY = False + * - LOADER = False * - MX = False + * - ON_DEMAND = False * * Commandline: - * --api='gl:core=3.3' --extensions='GL_EXT_texture_filter_anisotropic,GL_EXT_texture_lod_bias' c + * --api='gl:core=3.3' --extensions='GL_EXT_texture_filter_anisotropic' c * * Online: - * http://glad.sh/#api=gl%3Acore%3D3.3&extensions=GL_EXT_texture_filter_anisotropic%2CGL_EXT_texture_lod_bias&generator=c&options= + * http://glad.sh/#api=gl%3Acore%3D3.3&extensions=GL_EXT_texture_filter_anisotropic&generator=c&options= * */ @@ -114,6 +115,8 @@ extern "C" { #define GLAD_GNUC_EXTENSION #endif +#define GLAD_UNUSED(x) (void)(x) + #ifndef GLAD_API_CALL #if defined(GLAD_API_CALL_EXPORT) #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__) @@ -160,7 +163,7 @@ extern "C" { #define GLAD_VERSION_MAJOR(version) (version / 10000) #define GLAD_VERSION_MINOR(version) (version % 10000) -#define GLAD_GENERATOR_VERSION "2.0.0-beta" +#define GLAD_GENERATOR_VERSION "2.0.4" typedef void (*GLADapiproc)(void); @@ -514,7 +517,6 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #define GL_MAX_TEXTURE_SIZE 0x0D33 @@ -866,14 +868,12 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro #define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_GREEN_TYPE 0x8C11 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MAX_ANISOTROPY 0x84FE #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE @@ -1000,113 +1000,70 @@ typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apipro #include - typedef unsigned int GLenum; - typedef unsigned char GLboolean; - typedef unsigned int GLbitfield; - typedef void GLvoid; - typedef khronos_int8_t GLbyte; - typedef khronos_uint8_t GLubyte; - typedef khronos_int16_t GLshort; - typedef khronos_uint16_t GLushort; - typedef int GLint; - typedef unsigned int GLuint; - typedef khronos_int32_t GLclampx; - typedef int GLsizei; - typedef khronos_float_t GLfloat; - typedef khronos_float_t GLclampf; - typedef double GLdouble; - typedef double GLclampd; - typedef void *GLeglClientBufferEXT; - typedef void *GLeglImageOES; - typedef char GLchar; - typedef char GLcharARB; - #ifdef __APPLE__ typedef void *GLhandleARB; #else typedef unsigned int GLhandleARB; #endif - typedef khronos_uint16_t GLhalf; - typedef khronos_uint16_t GLhalfARB; - typedef khronos_int32_t GLfixed; - #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) typedef khronos_intptr_t GLintptr; #else typedef khronos_intptr_t GLintptr; #endif - #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) typedef khronos_intptr_t GLintptrARB; #else typedef khronos_intptr_t GLintptrARB; #endif - #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) typedef khronos_ssize_t GLsizeiptr; #else typedef khronos_ssize_t GLsizeiptr; #endif - #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) typedef khronos_ssize_t GLsizeiptrARB; #else typedef khronos_ssize_t GLsizeiptrARB; #endif - typedef khronos_int64_t GLint64; - typedef khronos_int64_t GLint64EXT; - typedef khronos_uint64_t GLuint64; - typedef khronos_uint64_t GLuint64EXT; - typedef struct __GLsync *GLsync; - struct _cl_context; - struct _cl_event; - typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); - typedef unsigned short GLhalfNV; - typedef GLintptr GLvdpauSurfaceNV; - typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void); - #define GL_VERSION_1_0 1 GLAD_API_CALL int GLAD_GL_VERSION_1_0; #define GL_VERSION_1_1 1 @@ -1133,8 +1090,6 @@ GLAD_API_CALL int GLAD_GL_VERSION_3_2; GLAD_API_CALL int GLAD_GL_VERSION_3_3; #define GL_EXT_texture_filter_anisotropic 1 GLAD_API_CALL int GLAD_GL_EXT_texture_filter_anisotropic; -#define GL_EXT_texture_lod_bias 1 -GLAD_API_CALL int GLAD_GL_EXT_texture_lod_bias; typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture); diff --git a/subprojects/glad/meson.build b/subprojects/glad/meson.build index 710e4d0..f998dd9 100644 --- a/subprojects/glad/meson.build +++ b/subprojects/glad/meson.build @@ -1,8 +1,5 @@ -project('glad', 'c') +project('glad', 'c', version: '2.0.4') glad_inc = include_directories('include') - -glad_lib = static_library('glad', 'src/gl.c', - include_directories : glad_inc) - +glad_lib = static_library('glad', 'src/gl.c', include_directories: glad_inc) glad = declare_dependency(link_with: glad_lib, include_directories: glad_inc) diff --git a/subprojects/glad/src/gl.c b/subprojects/glad/src/gl.c index f4d8fa9..3f9ef66 100644 --- a/subprojects/glad/src/gl.c +++ b/subprojects/glad/src/gl.c @@ -1,3 +1,6 @@ +/** + * SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0 + */ #include #include #include @@ -33,7 +36,6 @@ int GLAD_GL_VERSION_3_1 = 0; int GLAD_GL_VERSION_3_2 = 0; int GLAD_GL_VERSION_3_3 = 0; int GLAD_GL_EXT_texture_filter_anisotropic = 0; -int GLAD_GL_EXT_texture_lod_bias = 0; @@ -779,9 +781,9 @@ static int glad_gl_get_extensions( int version, const char **out_exts, unsigned #if GLAD_GL_IS_SOME_NEW_VERSION if(GLAD_VERSION_MAJOR(version) < 3) { #else - (void) version; - (void) out_num_exts_i; - (void) out_exts_i; + GLAD_UNUSED(version); + GLAD_UNUSED(out_num_exts_i); + GLAD_UNUSED(out_exts_i); #endif if (glad_glGetString == NULL) { return 0; @@ -874,7 +876,6 @@ static int glad_gl_find_extensions_gl( int version) { if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0; GLAD_GL_EXT_texture_filter_anisotropic = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_filter_anisotropic"); - GLAD_GL_EXT_texture_lod_bias = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_texture_lod_bias"); glad_gl_free_extensions(exts_i, num_exts_i); @@ -882,14 +883,17 @@ static int glad_gl_find_extensions_gl( int version) { } static int glad_gl_find_core_gl(void) { - int i, major, minor; + int i; const char* version; const char* prefixes[] = { "OpenGL ES-CM ", "OpenGL ES-CL ", "OpenGL ES ", + "OpenGL SC ", NULL }; + int major = 0; + int minor = 0; version = (const char*) glad_glGetString(GL_VERSION); if (!version) return 0; for (i = 0; prefixes[i]; i++) { -- cgit v1.2.3-101-g0448