From 3a0d7703da32e9a5ddf08a334f18588a78038d88 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 15 Jul 2013 13:39:22 +0200 Subject: Add Support for GL 4.3 (Bug 716) and ES 3.0 (Bug 717) ES3 / GL4.3: - Update all EGL, GLX, WGL and GL (desktop and mobile) khronos headers to latest version. - GL3/gl3* -> GL/glcorearb* - Explicitly preserve ES2_compatibility and ES3_compatibility in header, most extension grouping was removed in new headers. - Always load all GLHeader to ensure proper extension association across all profiles. - Unified method signatures - Added GL_EXT_map_buffer_range to core - Using common 'glMapBufferImpl(..)' for all glMapBuffer(..) and glMapBufferRange(..) impl. - Init necessary fields of GL instances via 'finalizeInit()' called by reflection, if exist. This allows removing initialization checks, i.e. for all buffer validations. - BuildStaticGLInfo: Can handle new GL header structure, i.e. one CPP extenstion block incl. define + funcs. - GLJavaMethodBindingEmitter: Simply print the - No GL duplication due to new intermediate interfaces, see below - OO lineare inheritance (Added GL2ES3, GL3ES3 and GL4ES3 intemediates): GLBase - GL - GL2ES2 - GLES2 GLBase - GL - GL2ES2 - GL2GL3 - [ GL2, GL3 ] GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - [ GL3 ] GLBase - GL - GL2ES2 - GL2ES3 - GL3ES3 - GL4ES3 - [ GLES3, GL4, .. ] - Expose 'usable' intermediate interfaces GL3ES3 and GL4ES3 in GLBase/GLProfile/GLContext via is*() and get*(). - GLContext*: - isGL3core() is true if [ GL4, GL3, GLES3 ] (added GLES3) - Added ctxProfile argument to allow handling ES versions: - getMaxMajor(..), getMaxMinor(..), isValidGLVersion(..) and decrementGLVersion(..) - mapGLVersions(..) prepared for ES ARB/KHR validation - EGLContext checks ES3 (via old ctx's GL_VERSION) - ExtensionAvailabilityCache adds GL_ES_Version_X_Y for ES. - Prelim tests w/ Mesa 9.1.3 GL Version 3.0 (ES profile, ES2 compat, ES3 compat, FBO, hardware) - OpenGL ES 3.0 Mesa 9.1.3 [GL 3.0.0, vendor 9.1.3 (Mesa 9.1.3)] - TODO: - Use KHR_create_context in EGLContext.createContextARBImpl(..) - More tests (Mobile, ..) +++ Misc: - GLContext*: - Complete glAllocateMemoryNV w/ glFreeMemoryNV. --- make/stub_includes/opengl/GL/gl-platform.h | 80 ++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 make/stub_includes/opengl/GL/gl-platform.h (limited to 'make/stub_includes/opengl/GL/gl-platform.h') diff --git a/make/stub_includes/opengl/GL/gl-platform.h b/make/stub_includes/opengl/GL/gl-platform.h new file mode 100644 index 000000000..58df2cfd3 --- /dev/null +++ b/make/stub_includes/opengl/GL/gl-platform.h @@ -0,0 +1,80 @@ +#ifndef __gl_platform_h_ +#define __gl_platform_h_ + +#if defined(__BEOS__) +#include /* to get some BeOS-isms */ +#endif + +#if !defined(OPENSTEP) && (defined(NeXT) || defined(NeXT_PDO)) +#define OPENSTEP +#endif + +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) +#define __WIN32__ +#endif + +#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) +# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# define APIENTRY __stdcall +#else +/* non-Windows compilation */ +# ifndef GLAPI +# define GLAPI extern +# endif +# define APIENTRY +#endif /* WIN32 / CYGWIN bracket */ + +#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) +# define PRAGMA_EXPORT_SUPPORTED 1 +#endif + +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) +#include +#endif + +#if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED +#pragma import on +#endif + +#ifdef CENTERLINE_CLPP +#define signed +#endif + +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export on +#endif + +/** + * The defaults for all .. + */ +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +#endif /* __gl_platform_h_ */ + -- cgit v1.2.3 From 4af77a92acf5bc2e27f9dea444a8c84d6775cf77 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 15 Jul 2013 20:08:52 +0200 Subject: Fix regressions of commit 3a0d7703da32e9a5ddf08a334f18588a78038d88: Avoid CPP redefinitions --- make/stub_includes/opengl/GL/gl-platform.h | 10 ++++++++-- make/stub_includes/opengl/GL/glext.h | 12 ++++++++++-- make/stub_includes/opengl/GL/wglext.h | 6 ++++++ make/stub_includes/opengl/GLES2/gl2ext.h | 2 ++ 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'make/stub_includes/opengl/GL/gl-platform.h') diff --git a/make/stub_includes/opengl/GL/gl-platform.h b/make/stub_includes/opengl/GL/gl-platform.h index 58df2cfd3..d07fd92ce 100644 --- a/make/stub_includes/opengl/GL/gl-platform.h +++ b/make/stub_includes/opengl/GL/gl-platform.h @@ -21,13 +21,17 @@ # else /* for use with static link lib build of Win32 edition only */ # define GLAPI extern # endif /* _STATIC_MESA support */ -# define APIENTRY __stdcall +# ifndef APIENTRY +# define APIENTRY __stdcall +# endif /* APIENTRY */ #else /* non-Windows compilation */ # ifndef GLAPI # define GLAPI extern # endif -# define APIENTRY +# ifndef APIENTRY +# define APIENTRY +# endif /* APIENTRY */ #endif /* WIN32 / CYGWIN bracket */ #if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__) @@ -47,9 +51,11 @@ #include #endif +/** #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__) #include #endif +*/ #if defined(macintosh) && PRAGMA_IMPORT_SUPPORTED #pragma import on diff --git a/make/stub_includes/opengl/GL/glext.h b/make/stub_includes/opengl/GL/glext.h index cba6c98fb..b4851803f 100644 --- a/make/stub_includes/opengl/GL/glext.h +++ b/make/stub_includes/opengl/GL/glext.h @@ -54,12 +54,14 @@ extern "C" { #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 +#ifndef GL_VERSION_1_0 typedef unsigned int GLenum; typedef int GLsizei; typedef void GLvoid; typedef float GLfloat; typedef int GLint; typedef unsigned char GLboolean; +#endif /* GL_VERSION_1_0 */ #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 @@ -1497,7 +1499,7 @@ GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIn #define GL_VERSION_3_2 1 #ifndef GLEXT_64_TYPES_DEFINED /* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED +#define GLEXT_64_TYPES_DEFINED 1 /* Define int32_t, int64_t, and uint64_t types for UST/MSC */ /* (as used in the GL_EXT_timer_query extension). */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L @@ -1531,10 +1533,10 @@ typedef unsigned __int64 uint64_t; /* Fallback if nothing above works */ #include #endif -#endif typedef int64_t GLint64; typedef struct __GLsync *GLsync; typedef uint64_t GLuint64; +#endif /* GLEXT_64_TYPES_DEFINED */ #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 #define GL_LINES_ADJACENCY 0x000A @@ -4650,7 +4652,9 @@ GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent) #ifndef GL_OES_single_precision #define GL_OES_single_precision 1 +#ifndef GL_VERSION_1_0 typedef float GLclampf; +#endif /* GL_VERSION_1_0 */ typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); @@ -5846,7 +5850,9 @@ GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 +#ifndef GL_VERSION_1_0 typedef double GLclampd; +#endif /* GL_VERSION_1_0 */ #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 #define GL_DEPTH_BOUNDS_EXT 0x8891 typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); @@ -7357,8 +7363,10 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #ifndef GL_EXT_timer_query #define GL_EXT_timer_query 1 +#ifndef GLEXT_64_TYPES_DEFINED typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; +#endif /* GLEXT_64_TYPES_DEFINED */ #define GL_TIME_ELAPSED_EXT 0x88BF typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); diff --git a/make/stub_includes/opengl/GL/wglext.h b/make/stub_includes/opengl/GL/wglext.h index ed5d6a7db..df5abb22b 100644 --- a/make/stub_includes/opengl/GL/wglext.h +++ b/make/stub_includes/opengl/GL/wglext.h @@ -697,6 +697,7 @@ BOOL WINAPI wglDeleteDCNV (HDC hdc); #define WGL_COLOR_SAMPLES_NV 0x20B9 #endif /* WGL_NV_multisample_coverage */ +#if 0 /* problems on Windows ..*/ #ifndef WGL_NV_present_video #define WGL_NV_present_video 1 #ifndef SKIP_WGL_HANDLE_DEFINITIONS @@ -712,6 +713,7 @@ BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUT BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); #endif #endif /* WGL_NV_present_video */ +#endif /* problems on Windows ..*/ #ifndef WGL_NV_render_depth_texture #define WGL_NV_render_depth_texture 1 @@ -757,6 +759,7 @@ void WINAPI wglFreeMemoryNV (void *pointer); #endif #endif /* WGL_NV_vertex_array_range */ +#if 0 /* problems on Windows ..*/ #ifndef WGL_NV_video_capture #define WGL_NV_video_capture 1 #ifndef SKIP_WGL_HANDLE_DEFINITIONS @@ -777,7 +780,9 @@ BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); #endif #endif /* WGL_NV_video_capture */ +#endif /* problems on Windows ..*/ +#if 0 /* problems on Windows ..*/ #ifndef WGL_NV_video_output #define WGL_NV_video_output 1 #ifndef SKIP_WGL_HANDLE_DEFINITIONS @@ -811,6 +816,7 @@ BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsi BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); #endif #endif /* WGL_NV_video_output */ +#endif /* problems on Windows ..*/ #ifndef WGL_OML_sync_control #define WGL_OML_sync_control 1 diff --git a/make/stub_includes/opengl/GLES2/gl2ext.h b/make/stub_includes/opengl/GLES2/gl2ext.h index b658fc8ba..c3c909a61 100644 --- a/make/stub_includes/opengl/GLES2/gl2ext.h +++ b/make/stub_includes/opengl/GLES2/gl2ext.h @@ -1571,6 +1571,7 @@ GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); #endif +#ifndef GL_EXT_disjoint_timer_query typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); @@ -1578,6 +1579,7 @@ typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); +#endif /* GL_EXT_disjoint_timer_query */ #endif /* GL_EXT_read_format_bgra */ -- cgit v1.2.3