From 4b24a27a88438711aa329dc55eec7c90b619118d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 6 Jun 2020 18:18:12 +0200 Subject: [PATCH] GL: expose AMD_sample_positions and NV_sample_locations. No wrapping yet, just recognize the extensions and load entrypoints. --- doc/changelog.dox | 4 ++- doc/opengl-support.dox | 3 ++ src/Magnum/GL/Context.cpp | 3 ++ src/Magnum/GL/Extensions.h | 15 ++++---- src/MagnumExternal/OpenGL/GL/extensions.txt | 2 ++ src/MagnumExternal/OpenGL/GL/flextGL.cpp | 8 +++++ src/MagnumExternal/OpenGL/GL/flextGL.h | 35 +++++++++++++++++++ .../OpenGL/GL/flextGLPlatform.cpp | 8 +++++ .../OpenGL/GLES2/extensions.txt | 1 + src/MagnumExternal/OpenGL/GLES2/flextGL.h | 23 ++++++++++++ .../OpenGL/GLES2/flextGLPlatform.cpp | 5 +++ .../OpenGL/GLES2/flextGLPlatformIOS.cpp | 10 ++++++ .../GLES2/flextGLPlatformWindowsDesktop.cpp | 5 +++ .../OpenGL/GLES2/flextGLWindowsDesktop.h | 23 ++++++++++++ .../OpenGL/GLES3/extensions.txt | 1 + src/MagnumExternal/OpenGL/GLES3/flextGL.h | 23 ++++++++++++ .../OpenGL/GLES3/flextGLPlatform.cpp | 5 +++ .../OpenGL/GLES3/flextGLPlatformIOS.cpp | 10 ++++++ .../GLES3/flextGLPlatformWindowsDesktop.cpp | 5 +++ .../OpenGL/GLES3/flextGLWindowsDesktop.h | 23 ++++++++++++ 20 files changed, 205 insertions(+), 7 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index fa6cd753a..6b246bc48 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -87,7 +87,9 @@ See also: @gl_extension{OVR,multiview2} extensions and the WebGL @webgl_extension{OVR,multiview2} extension. See also [mosra/magnum#385](https://github.com/mosra/magnum/issues/385). - - @gl_extension{ARB,sample_locations} desktop extension + - @gl_extension{ARB,sample_locations} and + @gl_extension{AMD,sample_positions} desktop extensions; + @gl_extension{NV,sample_locations} desktop and ES extension - Implemented @gl_extension{EXT,draw_buffers2}, @gl_extension{ARB,draw_buffers_blend} desktop extensions, @gl_extension{EXT,draw_buffers_indexed} ES extension and diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 5be87f735..591e94d94 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -309,6 +309,7 @@ Extension | Status Extension | Status ------------------------------------------- | ------ @gl_extension{AMD,transform_feedback3_lines_triangles} | done (nothing to do) +@gl_extension{AMD,sample_positions} | | @gl_extension{AMD,vertex_shader_layer} | done (shading language only) @gl_extension{AMD,shader_trinary_minmax} | done (shading language only) @gl_extension{AMD,shader_explicit_vertex_parameter} | done (shading language only) @@ -323,6 +324,7 @@ Extension | Status @gl_extension{EXT,debug_marker} | done @gl_extension{EXT,sRGB_R8} | done @gl_extension{GREMEDY,string_marker} | done +@gl_extension{NV,sample_locations} | | @gl_extension{NV,fragment_shader_barycentric} | done (shading language only) @gl_extension{OVR,multiview} | | @gl_extension{OVR,multiview2} | | @@ -487,6 +489,7 @@ Extension | Status @gl_extension{NV,read_depth_stencil} | done @gl_extension{NV,texture_border_clamp} | done @gl_extension{NV,shader_noperspective_interpolation} | done (shading language only) +@gl_extension{NV,sample_locations} | | @gl_extension{NV,polygon_mode} | done @gl_extension{OES,depth32} | done @gl_extension{OES,mapbuffer} | done diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index d37dfcee3..681fcdba2 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -78,6 +78,7 @@ namespace { #ifndef MAGNUM_TARGET_GLES constexpr Extension ExtensionList[]{ _extension(AMD,transform_feedback3_lines_triangles), + _extension(AMD,sample_positions), _extension(AMD,vertex_shader_layer), _extension(AMD,shader_trinary_minmax), _extension(AMD,shader_explicit_vertex_parameter), @@ -108,6 +109,7 @@ constexpr Extension ExtensionList[]{ _extension(KHR,blend_equation_advanced), _extension(KHR,blend_equation_advanced_coherent), _extension(KHR,texture_compression_astc_sliced_3d), + _extension(NV,sample_locations), _extension(NV,fragment_shader_barycentric), _extension(OVR,multiview), _extension(OVR,multiview2)}; @@ -355,6 +357,7 @@ constexpr Extension ExtensionList[]{ #ifndef MAGNUM_TARGET_GLES2 _extension(NV,shader_noperspective_interpolation), #endif + _extension(NV,sample_locations), _extension(NV,polygon_mode), #ifndef MAGNUM_TARGET_GLES2 _extension(NV,fragment_shader_barycentric), diff --git a/src/Magnum/GL/Extensions.h b/src/Magnum/GL/Extensions.h index a40b7a16b..bb04b6a8a 100644 --- a/src/Magnum/GL/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -90,9 +90,10 @@ namespace Extensions { #ifndef MAGNUM_TARGET_GLES namespace AMD { _extension( 0,AMD,transform_feedback3_lines_triangles, GL210, None) // #397 - _extension( 1,AMD,vertex_shader_layer, GL210, None) // #417 - _extension( 2,AMD,shader_trinary_minmax, GL210, None) // #428 - _extension( 3,AMD,shader_explicit_vertex_parameter, GL210, None) // #485 + _extension( 1,AMD,sample_positions, GL210, None) // #405 + _extension( 2,AMD,vertex_shader_layer, GL210, None) // #417 + _extension( 3,AMD,shader_trinary_minmax, GL210, None) // #428 + _extension( 4,AMD,shader_explicit_vertex_parameter, GL210, None) // #485 } namespace ARB { _extension( 10,ARB,texture_rectangle, GL210, GL310) // #38 _extension( 11,ARB,color_buffer_float, GL210, GL300) // #39 @@ -259,7 +260,8 @@ namespace AMD { _extension(176,NV,depth_buffer_float, GL210, GL300) // #334 _extension(177,NV,conditional_render, GL210, GL300) // #346 /* NV_draw_texture not supported */ // #430 - _extension(178,NV,fragment_shader_barycentric, GL450, None) // #526 + _extension(178,NV,sample_locations, GL210, None) // #472 + _extension(179,NV,fragment_shader_barycentric, GL450, None) // #526 } namespace OVR { _extension(185,OVR,multiview, GL300, None) // #478 _extension(186,OVR,multiview2, GL300, None) // #479 @@ -480,9 +482,10 @@ namespace ANDROID { #ifndef MAGNUM_TARGET_GLES2 _extension( 95,NV,shader_noperspective_interpolation, GLES300, None) // #201 #endif - _extension( 96,NV,polygon_mode, GLES200, None) // #238 + _extension( 96,NV,sample_locations, GLES200, None) // #235 + _extension( 97,NV,polygon_mode, GLES200, None) // #238 #ifndef MAGNUM_TARGET_GLES2 - _extension( 97,NV,fragment_shader_barycentric, GLES320, None) // #316 + _extension( 98,NV,fragment_shader_barycentric, GLES320, None) // #316 #endif } namespace OES { #ifdef MAGNUM_TARGET_GLES2 diff --git a/src/MagnumExternal/OpenGL/GL/extensions.txt b/src/MagnumExternal/OpenGL/GL/extensions.txt index ed5dabb6f..6730c237c 100644 --- a/src/MagnumExternal/OpenGL/GL/extensions.txt +++ b/src/MagnumExternal/OpenGL/GL/extensions.txt @@ -9,6 +9,7 @@ version 4.6 core extension EXT_texture_sRGB optional extension AMD_transform_feedback3_lines_triangles optional +extension AMD_sample_positions optional extension AMD_vertex_shader_layer optional extension AMD_shader_trinary_minmax optional extension AMD_shader_explicit_vertex_parameter optional @@ -39,6 +40,7 @@ extension KHR_texture_compression_astc_ldr optional extension KHR_blend_equation_advanced optional extension KHR_blend_equation_advanced_coherent optional # extension KHR_texture_compression_astc_sliced_3d optional +extension NV_sample_locations optional extension NV_fragment_shader_barycentric optional extension OVR_multiview optional extension OVR_multiview2 optional diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.cpp b/src/MagnumExternal/OpenGL/GL/flextGL.cpp index f554c290a..43a87a26d 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGL.cpp @@ -157,6 +157,9 @@ extern void APIENTRY glTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsiz FlextGL flextGL{ + /* GL_AMD_sample_positions */ + nullptr, + /* GL_ARB_ES3_2_compatibility */ nullptr, @@ -219,6 +222,11 @@ FlextGL flextGL{ /* GL_KHR_blend_equation_advanced */ nullptr, + /* GL_NV_sample_locations */ + nullptr, + nullptr, + nullptr, + /* GL_OVR_multiview */ nullptr, diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index 7c8ff9c15..bed91e482 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -1612,6 +1612,10 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +/* GL_AMD_sample_positions */ + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + /* GL_ARB_robustness */ #define GL_NO_ERROR 0 @@ -1766,6 +1770,17 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +/* GL_NV_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + /* GL_OVR_multiview */ #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 @@ -1781,6 +1796,10 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum why those functions aren't listed as direct prototypes. */ struct FlextGL { + /* GL_AMD_sample_positions */ + + void(APIENTRY *SetMultisamplefvAMD)(GLenum, GLuint, const GLfloat *); + /* GL_ARB_ES3_2_compatibility */ void(APIENTRY *PrimitiveBoundingBoxARB)(GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); @@ -1854,6 +1873,12 @@ struct FlextGL { void(APIENTRY *BlendBarrierKHR)(void); + /* GL_NV_sample_locations */ + + void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *NamedFramebufferSampleLocationsfvNV)(GLuint, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *ResolveDepthValuesNV)(void); + /* GL_OVR_multiview */ void(APIENTRY *FramebufferTextureMultiviewOVR)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei); @@ -2575,6 +2600,10 @@ struct FlextGL { extern FLEXTGL_EXPORT FlextGL flextGL; +/* GL_AMD_sample_positions */ + +#define glSetMultisamplefvAMD flextGL.SetMultisamplefvAMD + /* GL_ARB_ES3_2_compatibility */ #define glPrimitiveBoundingBoxARB flextGL.PrimitiveBoundingBoxARB @@ -2648,6 +2677,12 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glBlendBarrierKHR flextGL.BlendBarrierKHR +/* GL_NV_sample_locations */ + +#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV +#define glNamedFramebufferSampleLocationsfvNV flextGL.NamedFramebufferSampleLocationsfvNV +#define glResolveDepthValuesNV flextGL.ResolveDepthValuesNV + /* GL_OVR_multiview */ #define glFramebufferTextureMultiviewOVR flextGL.FramebufferTextureMultiviewOVR diff --git a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp index 9163f8036..58bbdfcbe 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp @@ -118,6 +118,9 @@ void flextGLInit(Magnum::GL::Context& context) { static_cast(context); #endif + /* GL_AMD_sample_positions */ + flextGL.SetMultisamplefvAMD = reinterpret_cast(loader.load("glSetMultisamplefvAMD")); + /* GL_ARB_ES3_2_compatibility */ flextGL.PrimitiveBoundingBoxARB = reinterpret_cast(loader.load("glPrimitiveBoundingBoxARB")); @@ -180,6 +183,11 @@ void flextGLInit(Magnum::GL::Context& context) { /* GL_KHR_blend_equation_advanced */ flextGL.BlendBarrierKHR = reinterpret_cast(loader.load("glBlendBarrierKHR")); + /* GL_NV_sample_locations */ + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvNV")); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvNV")); + flextGL.ResolveDepthValuesNV = reinterpret_cast(loader.load("glResolveDepthValuesNV")); + /* GL_OVR_multiview */ flextGL.FramebufferTextureMultiviewOVR = reinterpret_cast(loader.load("glFramebufferTextureMultiviewOVR")); diff --git a/src/MagnumExternal/OpenGL/GLES2/extensions.txt b/src/MagnumExternal/OpenGL/GLES2/extensions.txt index b1de39367..a54bd2612 100644 --- a/src/MagnumExternal/OpenGL/GLES2/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES2/extensions.txt @@ -102,6 +102,7 @@ extension NV_read_depth optional extension NV_read_stencil optional extension NV_read_depth_stencil optional extension NV_texture_border_clamp optional +extension NV_sample_locations optional extension NV_polygon_mode optional extension OES_depth32 optional extension OES_mapbuffer optional diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index 35e64f5c6..c0572e6b4 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -1033,6 +1033,17 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_CLAMP_TO_BORDER_NV 0x812D +/* GL_NV_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + /* GL_NV_polygon_mode */ #define GL_POLYGON_MODE_NV 0x0B40 @@ -1416,6 +1427,12 @@ struct FlextGL { void(APIENTRY *ReadBufferNV)(GLenum); + /* GL_NV_sample_locations */ + + void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *NamedFramebufferSampleLocationsfvNV)(GLuint, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *ResolveDepthValuesNV)(void); + /* GL_OES_mapbuffer */ void(APIENTRY *GetBufferPointervOES)(GLenum, GLenum, void **); @@ -1644,6 +1661,12 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glReadBufferNV flextGL.ReadBufferNV +/* GL_NV_sample_locations */ + +#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV +#define glNamedFramebufferSampleLocationsfvNV flextGL.NamedFramebufferSampleLocationsfvNV +#define glResolveDepthValuesNV flextGL.ResolveDepthValuesNV + /* GL_OES_mapbuffer */ #define glGetBufferPointervOES flextGL.GetBufferPointervOES diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp index cf5e0cb8b..b369e7164 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp @@ -206,6 +206,11 @@ void flextGLInit(Magnum::GL::Context&) { /* GL_NV_read_buffer */ flextGL.ReadBufferNV = reinterpret_cast(loader.load("glReadBufferNV")); + /* GL_NV_sample_locations */ + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvNV")); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvNV")); + flextGL.ResolveDepthValuesNV = reinterpret_cast(loader.load("glResolveDepthValuesNV")); + /* GL_OES_mapbuffer */ flextGL.GetBufferPointervOES = reinterpret_cast(loader.load("glGetBufferPointervOES")); flextGL.MapBufferOES = reinterpret_cast(loader.load("glMapBufferOES")); diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp index 32935ce25..eb78f3015 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp @@ -138,6 +138,9 @@ #undef glVertexAttribDivisorNV #undef glPolygonModeNV #undef glReadBufferNV +#undef glFramebufferSampleLocationsfvNV +#undef glNamedFramebufferSampleLocationsfvNV +#undef glResolveDepthValuesNV #undef glGetBufferPointervOES #undef glMapBufferOES #undef glUnmapBufferOES @@ -392,6 +395,13 @@ void flextGLInit(Magnum::GL::Context&) { flextGL.ReadBufferNV = reinterpret_cast(glReadBufferNV); #endif + /* GL_NV_sample_locations */ + #if GL_NV_sample_locations + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(glFramebufferSampleLocationsfvNV); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(glNamedFramebufferSampleLocationsfvNV); + flextGL.ResolveDepthValuesNV = reinterpret_cast(glResolveDepthValuesNV); + #endif + /* GL_OES_mapbuffer */ #if GL_OES_mapbuffer flextGL.GetBufferPointervOES = reinterpret_cast(glGetBufferPointervOES); diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp index bc945910b..dd55ecd24 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp @@ -305,6 +305,11 @@ void flextGLInit(Magnum::GL::Context&) { /* GL_NV_read_buffer */ flextGL.ReadBufferNV = reinterpret_cast(loader.load("glReadBufferNV")); + /* GL_NV_sample_locations */ + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvNV")); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvNV")); + flextGL.ResolveDepthValuesNV = reinterpret_cast(loader.load("glResolveDepthValuesNV")); + /* GL_OES_mapbuffer */ flextGL.GetBufferPointervOES = reinterpret_cast(loader.load("glGetBufferPointervOES")); flextGL.MapBufferOES = reinterpret_cast(loader.load("glMapBufferOES")); diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h index d0df12a4c..5e2099685 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h @@ -1028,6 +1028,17 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_CLAMP_TO_BORDER_NV 0x812D +/* GL_NV_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + /* GL_NV_polygon_mode */ #define GL_POLYGON_MODE_NV 0x0B40 @@ -1415,6 +1426,12 @@ struct FlextGL { void(APIENTRY *ReadBufferNV)(GLenum); + /* GL_NV_sample_locations */ + + void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *NamedFramebufferSampleLocationsfvNV)(GLuint, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *ResolveDepthValuesNV)(void); + /* GL_OES_mapbuffer */ void(APIENTRY *GetBufferPointervOES)(GLenum, GLenum, void **); @@ -1743,6 +1760,12 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glReadBufferNV flextGL.ReadBufferNV +/* GL_NV_sample_locations */ + +#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV +#define glNamedFramebufferSampleLocationsfvNV flextGL.NamedFramebufferSampleLocationsfvNV +#define glResolveDepthValuesNV flextGL.ResolveDepthValuesNV + /* GL_OES_mapbuffer */ #define glGetBufferPointervOES flextGL.GetBufferPointervOES diff --git a/src/MagnumExternal/OpenGL/GLES3/extensions.txt b/src/MagnumExternal/OpenGL/GLES3/extensions.txt index 2a3fafed6..83dbeb272 100644 --- a/src/MagnumExternal/OpenGL/GLES3/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES3/extensions.txt @@ -75,6 +75,7 @@ extension NV_read_stencil optional extension NV_read_depth_stencil optional extension NV_texture_border_clamp optional extension NV_shader_noperspective_interpolation optional +extension NV_sample_locations optional extension NV_polygon_mode optional extension NV_fragment_shader_barycentric optional extension OES_depth32 optional diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index 024111827..d4b769e89 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -1628,6 +1628,17 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_CLAMP_TO_BORDER_NV 0x812D +/* GL_NV_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + /* GL_NV_polygon_mode */ #define GL_POLYGON_MODE_NV 0x0B40 @@ -2207,6 +2218,12 @@ struct FlextGL { void(APIENTRY *PolygonModeNV)(GLenum, GLenum); + /* GL_NV_sample_locations */ + + void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *NamedFramebufferSampleLocationsfvNV)(GLuint, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *ResolveDepthValuesNV)(void); + /* GL_OES_mapbuffer */ void(APIENTRY *GetBufferPointervOES)(GLenum, GLenum, void **); @@ -2513,6 +2530,12 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glPolygonModeNV flextGL.PolygonModeNV +/* GL_NV_sample_locations */ + +#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV +#define glNamedFramebufferSampleLocationsfvNV flextGL.NamedFramebufferSampleLocationsfvNV +#define glResolveDepthValuesNV flextGL.ResolveDepthValuesNV + /* GL_OES_mapbuffer */ #define glGetBufferPointervOES flextGL.GetBufferPointervOES diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp index 9b0ec00ce..e8508a19b 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp @@ -297,6 +297,11 @@ void flextGLInit(Magnum::GL::Context&) { /* GL_NV_polygon_mode */ flextGL.PolygonModeNV = reinterpret_cast(loader.load("glPolygonModeNV")); + /* GL_NV_sample_locations */ + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvNV")); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvNV")); + flextGL.ResolveDepthValuesNV = reinterpret_cast(loader.load("glResolveDepthValuesNV")); + /* GL_OES_mapbuffer */ flextGL.GetBufferPointervOES = reinterpret_cast(loader.load("glGetBufferPointervOES")); flextGL.MapBufferOES = reinterpret_cast(loader.load("glMapBufferOES")); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp index c9ee6fbd9..2ffdaf77d 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp @@ -135,6 +135,9 @@ #undef glGetnUniformuivKHR #undef glReadnPixelsKHR #undef glPolygonModeNV +#undef glFramebufferSampleLocationsfvNV +#undef glNamedFramebufferSampleLocationsfvNV +#undef glResolveDepthValuesNV #undef glGetBufferPointervOES #undef glMapBufferOES #undef glUnmapBufferOES @@ -332,6 +335,13 @@ void flextGLInit(Magnum::GL::Context&) { flextGL.PolygonModeNV = reinterpret_cast(glPolygonModeNV); #endif + /* GL_NV_sample_locations */ + #if GL_NV_sample_locations + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(glFramebufferSampleLocationsfvNV); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(glNamedFramebufferSampleLocationsfvNV); + flextGL.ResolveDepthValuesNV = reinterpret_cast(glResolveDepthValuesNV); + #endif + /* GL_OES_mapbuffer */ #if GL_OES_mapbuffer flextGL.GetBufferPointervOES = reinterpret_cast(glGetBufferPointervOES); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp index 1317aad6f..46a4e121c 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp @@ -499,6 +499,11 @@ void flextGLInit(Magnum::GL::Context&) { /* GL_NV_polygon_mode */ flextGL.PolygonModeNV = reinterpret_cast(loader.load("glPolygonModeNV")); + /* GL_NV_sample_locations */ + flextGL.FramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvNV")); + flextGL.NamedFramebufferSampleLocationsfvNV = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvNV")); + flextGL.ResolveDepthValuesNV = reinterpret_cast(loader.load("glResolveDepthValuesNV")); + /* GL_OES_mapbuffer */ flextGL.GetBufferPointervOES = reinterpret_cast(loader.load("glGetBufferPointervOES")); flextGL.MapBufferOES = reinterpret_cast(loader.load("glMapBufferOES")); diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h index de75a69fb..c117abe4c 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h @@ -1620,6 +1620,17 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_TEXTURE_BORDER_COLOR_NV 0x1004 #define GL_CLAMP_TO_BORDER_NV 0x812D +/* GL_NV_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 + /* GL_NV_polygon_mode */ #define GL_POLYGON_MODE_NV 0x0B40 @@ -2210,6 +2221,12 @@ struct FlextGL { void(APIENTRY *PolygonModeNV)(GLenum, GLenum); + /* GL_NV_sample_locations */ + + void(APIENTRY *FramebufferSampleLocationsfvNV)(GLenum, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *NamedFramebufferSampleLocationsfvNV)(GLuint, GLuint, GLsizei, const GLfloat *); + void(APIENTRY *ResolveDepthValuesNV)(void); + /* GL_OES_mapbuffer */ void(APIENTRY *GetBufferPointervOES)(GLenum, GLenum, void **); @@ -2720,6 +2737,12 @@ extern FLEXTGL_EXPORT FlextGL flextGL; #define glPolygonModeNV flextGL.PolygonModeNV +/* GL_NV_sample_locations */ + +#define glFramebufferSampleLocationsfvNV flextGL.FramebufferSampleLocationsfvNV +#define glNamedFramebufferSampleLocationsfvNV flextGL.NamedFramebufferSampleLocationsfvNV +#define glResolveDepthValuesNV flextGL.ResolveDepthValuesNV + /* GL_OES_mapbuffer */ #define glGetBufferPointervOES flextGL.GetBufferPointervOES