Skip to content

Commit

Permalink
Added support for OpenGL 4.6.
Browse files Browse the repository at this point in the history
Added pre-generated files.
  • Loading branch information
akb825 committed Dec 21, 2017
1 parent 916fcc3 commit 1c84bd9
Show file tree
Hide file tree
Showing 18 changed files with 96,411 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AnyGL/DebugGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def getFormatStr(self, param, groups):
(param.group and param.group in groups and ptype[-1] != '*'):
return '%s'
elif ptype[-1] == '*' or (len(ptype) > 4 and ptype[-4:] == 'PROC') or \
ptype == 'GLsync' or ptype == 'GLeglImageOES':
ptype == 'GLsync' or ptype == 'GLeglImageOES' or ptype == 'GLeglClientBufferEXT':
return '%p'
elif ptype == 'GLbyte' or ptype == 'GLshort' or ptype == 'GLint' or ptype == 'GLsizei':
return '%i'
Expand Down Expand Up @@ -225,7 +225,7 @@ def endFile(self):
usedGroups = set()
for function in self.functions:
for param in function.getParamList():
if param.group:
if (param.type == 'GLenum' or param.type == 'GLboolean') and param.group:
usedGroups.add(param.group)

self.outputEnums('Any', self.enums)
Expand Down
3 changes: 2 additions & 1 deletion AnyGL/FunctionInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'glDeleteTexturesEXT': 'EXT',
'glGenTexturesEXT': 'EXT',
'glIsTextureEXT': 'EXT',
'glClipControlEXT': 'EXT',
'glProgramParameteriARB': 'ARB',
'glFramebufferTextureARB': 'ARB',
'glFramebufferTextureLayerARB': 'ARB'
Expand Down Expand Up @@ -66,7 +67,7 @@ def __init__(self, cmd, feature = None):
self.returnType = self.returnType.strip()

alias = cmd.find('alias')
if alias == None:
if alias == None or alias.get('name') == self.name:
self.alias = None
if feature:
if feature in manualFeatureAliases:
Expand Down
2 changes: 1 addition & 1 deletion OpenGLRegistry
Submodule OpenGLRegistry updated 92 files
+12 −8 README.adoc
+90 −13 api/GL/glcorearb.h
+290 −16 api/GL/glext.h
+15 −1 api/GL/glxext.h
+1 −1 api/GL/wglext.h
+6 −2 api/GLES/gl.h
+27 −5 api/GLES/glext.h
+1 −1 api/GLES2/gl2.h
+298 −7 api/GLES2/gl2ext.h
+1 −1 api/GLES3/gl3.h
+662 −0 extensions/AMD/AMD_gpu_shader_int16.txt
+186 −0 extensions/AMD/AMD_shader_image_load_store_lod.txt
+21 −2 extensions/ARB/ARB_copy_buffer.txt
+16 −9 extensions/ARB/ARB_direct_state_access.txt
+112 −21 extensions/ARB/ARB_gl_spirv.txt
+17 −2 extensions/ARB/ARB_indirect_parameters.txt
+45 −4 extensions/ARB/ARB_pipeline_statistics_query.txt
+203 −0 extensions/ARB/ARB_polygon_offset_clamp.txt
+1 −1 extensions/ARB/ARB_shader_ballot.txt
+7 −9 extensions/ARB/ARB_shader_draw_parameters.txt
+488 −0 extensions/ARB/ARB_spirv_extensions.txt
+17 −2 extensions/ARB/ARB_texture_buffer_object.txt
+299 −0 extensions/ARB/ARB_texture_filter_anisotropic.txt
+8 −4 extensions/ARB/ARB_transform_feedback_overflow_query.txt
+166 −3 extensions/ARB/ARB_uniform_buffer_object.txt
+88 −85 extensions/EXT/EXT_EGL_image_array.txt
+190 −0 extensions/EXT/EXT_clip_control.txt
+1 −1 extensions/EXT/EXT_clip_cull_distance.txt
+11 −2 extensions/EXT/EXT_color_buffer_half_float.txt
+101 −3 extensions/EXT/EXT_draw_buffers2.txt
+259 −0 extensions/EXT/EXT_external_buffer.txt
+1,183 −0 extensions/EXT/EXT_external_objects.txt
+167 −0 extensions/EXT/EXT_external_objects_fd.txt
+306 −0 extensions/EXT/EXT_external_objects_win32.txt
+20 −2 extensions/EXT/EXT_protected_textures.txt
+44 −3 extensions/EXT/EXT_shader_framebuffer_fetch.txt
+757 −0 extensions/EXT/EXT_texture_compression_bptc.txt
+12 −7 extensions/EXT/EXT_texture_compression_latc.txt
+105 −25 extensions/EXT/EXT_texture_compression_rgtc.txt
+371 −0 extensions/EXT/EXT_texture_compression_s3tc_srgb.txt
+157 −0 extensions/EXT/EXT_texture_mirror_clamp_to_edge.txt
+125 −0 extensions/EXT/EXT_win32_keyed_mutex.txt
+11 −3 extensions/EXT/EXT_window_rectangles.txt
+292 −0 extensions/EXT/GLX_EXT_no_config_context.txt
+167 −0 extensions/KHR/KHR_parallel_shader_compile.txt
+38 −1 extensions/KHR/KHR_texture_compression_astc_hdr.txt
+11 −3 extensions/MESA/GLX_MESA_copy_sub_buffer.txt
+8 −3 extensions/MESA/GLX_MESA_query_renderer.txt
+4 −4 extensions/MESA/GLX_MESA_release_buffers.txt
+131 −0 extensions/MESA/GLX_MESA_swap_control.txt
+1 −1 extensions/MESA/MESA_pack_invert.txt
+88 −0 extensions/MESA/MESA_program_binary_formats.txt
+127 −0 extensions/MESA/MESA_tile_raster_order.txt
+4 −4 extensions/MESA/MESA_window_pos.txt
+8 −7 extensions/MESA/MESA_ycbcr_texture.txt
+296 −0 extensions/NV/NV_blend_minmax_factor.txt
+26 −5 extensions/NV/NV_clip_space_w_scaling.txt
+151 −0 extensions/NV/NV_conservative_raster_pre_snap.txt
+186 −0 extensions/NV/NV_conservative_raster_underestimation.txt
+118 −9 extensions/NV/NV_framebuffer_mixed_samples.txt
+2 −2 extensions/NV/NV_geometry_shader_passthrough.txt
+108 −10 extensions/NV/NV_gpu_shader5.txt
+10 −0 extensions/NV/NV_path_rendering.txt
+9 −6 extensions/NV/NV_primitive_restart.txt
+192 −0 extensions/NV/NV_query_resource.txt
+193 −0 extensions/NV/NV_query_resource_tag.txt
+25 −3 extensions/NV/NV_stereo_view_rendering.txt
+95 −0 extensions/NV/NV_texture_rectangle_compressed.txt
+452 −46 extensions/OVR/OVR_multiview.txt
+473 −0 extensions/QCOM/QCOM_texture_foveated.txt
+8 −0 extensions/arbext.php
+45 −3 extensions/esext.php
+38 −0 extensions/glext.php
+159 −3 extensions/registry.py
+3 −11 index.php
+21 −26 index_es.php
+38 −36 index_gl.php
+7 −14 index_sc.php
+ specs/gl/GLSLangSpec.4.50.diff.pdf
+ specs/gl/GLSLangSpec.4.50.pdf
+ specs/gl/GLSLangSpec.4.60.diff.pdf
+ specs/gl/GLSLangSpec.4.60.pdf
+ specs/gl/glspec45.compatibility.pdf
+ specs/gl/glspec45.compatibility.withchanges.pdf
+ specs/gl/glspec45.core.pdf
+ specs/gl/glspec45.core.withchanges.pdf
+ specs/gl/glspec46.compatibility.pdf
+ specs/gl/glspec46.core.pdf
+1 −1 xml/Makefile
+3,110 −1,044 xml/gl.xml
+16 −1 xml/glx.xml
+411 −0 xml/glxproto.reserved.txt
119 changes: 119 additions & 0 deletions generated/AnyGL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#pragma once
#ifndef __AnyGL_h_
#define __AnyGL_h_ 1

#include "AnyGLConfig.h"

/**
* @brief Initializes the AnyGL library.
*
* This will initialize the loading library, such as GLX or WGL. On some platforms this is
* necessary to load extensions in the loading library required to properly create an OpenGL
* context.
*
* @return 1 if the initialization succeeded, 0 if it failed.
*/
ANYGL_EXPORT int AnyGL_initialize(void);

/**
* @brief Loads the OpenGL functions based on the currently bound context.
* @return 1 if the load succeedd, 0 if it failed.
*/
ANYGL_EXPORT int AnyGL_load(void);

/**
* @brief Gets the version of OpenGL.
* @param[out] major The major version.
* @param[out] minor The minor viersion.
* @param[out] es 1 if OpenGL ES, 0 if desktop OpenGL.
*/
ANYGL_EXPORT void AnyGL_getGLVersion(int* major, int* minor, int* es);

/**
* @brief Checks to see if the OpenGL version is at least the version provided.
* @param major The major version.
* @param minor The minor version.
* @param es 1 if OpenGL ES, 0 if desktop OpenGL.
* @return 1 if the OpenGL version is less than or equal to the major and minor version and es
* matches whether or not OpenGL ES is enabled.
*/
ANYGL_EXPORT int AnyGL_atLeastVersion(int major, int minor, int es);

/**
* @brief Shuts down the AnyGL library, freeing any persistently held resources.
*/
ANYGL_EXPORT void AnyGL_shutdown(void);

/**
* @brief Gets the string for an OpenGL error.
* @param error The error code returned from glGetError() or glCheckFramebufferStatus().
* @return The string for the error, or "UNKNOWN" if not a known error code.
*/
ANYGL_EXPORT const char* AnyGL_errorString(unsigned int error);

/**
* @brief Function pointer type for the error function.
* @param file The file for the original call into OpenGL.
* @param function The function for the original call into OpenGL.
* @Param line The line for the original call into OpenGL.
* @param glError The OpenGL error code.
* @param glFunction The GL function called, including parameters passed in.
*/
typedef void (*AnyGLErrorFunc)(const char* file, const char* function, unsigned int line,
unsigned int glError, const char* glFunction);

/**
* @brief Sets the error function.
*
* This is used when debugging is enabled and a GL error is is thrown.
*
* @param errorFunc The function to set. If NULL, the default error function will be used.
*/
ANYGL_EXPORT void AnyGL_setErrorFunc(AnyGLErrorFunc func);

/**
* @brief Gets whether or not debugging is enabled.
* @return 1 if debugging is enabled, 0 of not.
*/
ANYGL_EXPORT int AnyGL_getDebugEnabled(void);

/**
* @brief Sets whether or not debugging is enabled.
*
* This will check for an OpenGL error for each function call, calling the error function if one
* occurred, passing in a string version of the function call with parameter values and information
* about the callsite. This will do nothing if ANYGL_ALLOW_DEBUG is defined to 0.
*
* @param enabled 1 if debugging should be enabled, 0 if not.
*/
ANYGL_EXPORT void AnyGL_setDebugEnabled(int enabled);

/**
* @brief Gets whether or not error checking is enabled for debug functions.
* @return 1 if error checking is enabled, 0 if not.
*/
ANYGL_EXPORT int AnyGL_getErrorCheckingEnabled(void);

/**
* @brief Sets whether or not error checking is enabled for debug functions.
*
* This can be used to disable error checking for situations such as loading resources where you
* may want to check for error codes yourself.
* @remark This is maintained separately for each thread.
* @param enabled 1 if error checking should be enabled, 0 if not.
*/
ANYGL_EXPORT void AnyGL_setErrorCheckingEnabled(int enabled);

/**
* @brief Gets the last OpenGL callsite.
* @remark This is maintained separately for each thread and is only recorded when
* ANYGL_ALLOW_DEBUG is 1, though debugging doesn't need to be enabled.
* @param[out] file The file of the callsite.
* @param[out] function The function of the callsite.
* @param[out] line The line of the callsite.
*/
ANYGL_EXPORT void AnyGL_getLastCallsite(const char** file, const char** function,
unsigned int* line);

#endif
111 changes: 111 additions & 0 deletions generated/AnyGLConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#pragma once
#ifndef __AnyGLConfig_h_
#define __AnyGLConfig_h_ 1

#if defined(_WIN32)
# define ANYGL_WINDOWS 1
#elif defined(__ANDROID__)
# define ANYGL_ANDROID 1
#elif defined(__APPLE__)
# define ANYGL_APPLE 1
# include "TargetConditionals.h"
# if TARGET_OS_IPHONE
# define ANYGL_IOS 1
# endif
#endif

#ifndef ANYGL_WINDOWS
#define ANYGL_WINDOWS 0
#endif

#ifndef ANYGL_ANDROID
#define ANYGL_ANDROID 0
#endif

#ifndef ANYGL_APPLE
#define ANYGL_APPLE 0
#endif

#ifndef ANYGL_IOS
#define ANYGL_IOS 0
#endif

/* #define this to override whether or not to use OpenGL ES. */
#ifndef ANYGL_GLES
#define ANYGL_GLES (ANYGL_ANDROID || ANYGL_IOS)
#endif

/* #define this to the OpenGL version (times 10) to include when loading via function pointer. */
#ifndef ANYGL_GL_VERSION
#define ANYGL_GL_VERSION 33
#endif

/* #define this to the OpenGL ES version (times 10) to include when loading via function pointer. */
#ifndef ANYGL_GLES_VERSION
#define ANYGL_GLES_VERSION 30
#endif

/*
* Libraries for loading OpenGL functions.
* ANYGL_LOAD_FPTR takes the function pointer from the system OpenGL includes.
*/
#define ANYGL_LOAD_FPTR 0
#define ANYGL_LOAD_EGL 1
#define ANYGL_LOAD_WGL 2
#define ANYGL_LOAD_GLX 3

/* #define this to override the default library. */
#ifndef ANYGL_LOAD
#if ANYGL_APPLE
# define ANYGL_LOAD ANYGL_LOAD_FPTR
#elif ANYGL_GLES
# define ANYGL_LOAD ANYGL_LOAD_EGL
#elif ANYGL_WINDOWS
# define ANYGL_LOAD ANYGL_LOAD_WGL
#else
# define ANYGL_LOAD ANYGL_LOAD_GLX
#endif
#endif

/*
* #define ANYGL_DYNAMIC to use dynamic linking.
* #define ANYGL_BUILD to export symbols, otherwise they will be imported.
*/
#ifndef ANYGL_EXPORT
#if ANYGL_DYNAMIC
# ifdef _MSC_VER
# ifdef ANYGL_BUILD
# define ANYGL_EXPORT __declspec(dllexport)
# else
# define ANYGL_EXPORT __declspec(dllimport)
# endif
# else
# define ANYGL_EXPORT __attribute__((visibility("default")))
# endif
#else
# define ANYGL_EXPORT
#endif
#endif

/* #define this to override the calling convention. */
#ifndef APIENTRY
#if ANYGL_WINDOWS
# define APIENTRY __stdcall
#else
# define APIENTRY
#endif
#endif

/*
* #define this to 1 if you want to allow debugging OpenGL functions. Useful for debugging, but
* adds some overhead, so not suitable for release builds.
*/
#ifndef ANYGL_ALLOW_DEBUG
#ifdef NDEBUG
# define ANYGL_ALLOW_DEBUG 0
#else
# define ANYGL_ALLOW_DEBUG 1
#endif
#endif

#endif
Loading

0 comments on commit 1c84bd9

Please sign in to comment.