diff --git a/doc/changelog.dox b/doc/changelog.dox index 6699f6a51..353441c13 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -42,11 +42,16 @@ See also: @subsubsection changelog-latest-new-gl GL library -- Exposed entry points from the desktop / ES @gl_extension{OVR,multiview} and - @gl_extension{OVR,multiview2} extensions and the WebGL - @webgl_extension{OVR,multiview2} extension. Note that no wrapper API in the - @ref GL namespace is provided for these at the moment. See also - [mosra/magnum#385](https://github.com/mosra/magnum/issues/385). +- Exposed new entry points. Note that no wrapper API in the @ref GL namespace + is provided for the extensions listed below, at the moment: + - Desktop / ES @gl_extension{OVR,multiview} and + @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 +- Recognizing @gl_extension{AMD,shader_explicit_vertex_parameter} desktop + and @gl_extension{NV,fragment_shader_barycentric} desktop / ES extensions. + These add only shading language features. @subsubsection changelog-latest-new-platform Platform libraries diff --git a/doc/opengl-mapping.dox b/doc/opengl-mapping.dox index caf8775b0..bc9f3726c 100644 --- a/doc/opengl-mapping.dox +++ b/doc/opengl-mapping.dox @@ -151,6 +151,7 @@ OpenGL function | Matching API --------------------------------------- | ------------ @fn_gl{Enable}, `glDisable()` | @ref GL::Renderer::setFeature() @fn_gl{EnableVertexAttribArray}, \n `glEnableVertexArrayAttrib()`, \n `glDisableVertexAttribArray()`, \n `glDisableVertexArrayAttrib()`, \n `glDisableVertexArrayAttribEXT()` | @ref GL::Mesh::addVertexBuffer() +@fn_gl_extension{EvaluateDepthValues,ARB,sample_locations} | | @subsection opengl-mapping-functions-f F @@ -164,6 +165,7 @@ OpenGL function | Matching API @fn_gl{FlushMappedBufferRange}, \n `glFlushMappedNamedBufferRange()` | @ref GL::Buffer::flushMappedRange() @fn_gl2{FramebufferParameter,FramebufferParameteri}, \n `glNamedFramebufferParameter()` | | @fn_gl{FramebufferRenderbuffer}, \n `glNamedFramebufferRenderbuffer()` | @ref GL::Framebuffer::attachRenderbuffer(), \n @ref GL::Framebuffer::detach() +@fn_gl_extension{FramebufferSampleLocationsfv,ARB,sample_locations}, \n `glNamedFramebufferSampleLocationsfvARB` | | @fn_gl{FramebufferTexture}, \n `glNamedFramebufferTexture()` | @ref GL::Framebuffer::attachLayeredTexture() @fn_gl2{FramebufferTexture1D,FramebufferTexture}, \n `glFramebufferTexture2D()` | @ref GL::Framebuffer::attachTexture(), \n @ref GL::Framebuffer::attachCubeMapTexture() @fn_gl2{FramebufferTexture3D,FramebufferTexture} | not used, @fn_gl{FramebufferTextureLayer} has more complete features diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 346c7869e..94fcdb77b 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -291,6 +291,7 @@ Extension | Status @gl_extension{ARB,sparse_texture} | | @gl_extension{ARB,sparse_buffer} | | @gl_extension{ARB,ES3_2_compatibility} | | +@gl_extension{ARB,sample_locations} | | @gl_extension2{KHR,texture_compression_astc_ldr,KHR_texture_compression_astc_hdr} | done @gl_extension{KHR,robust_buffer_access_behavior} | done (nothing to do) @gl_extension{KHR,blend_equation_advanced} | done @@ -310,6 +311,7 @@ Extension | Status @gl_extension{AMD,transform_feedback3_lines_triangles} | done (nothing to do) @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) @gl_extension{ATI,texture_mirror_once} | done (GL 4.4 subset) @gl_extension{EXT,texture_filter_anisotropic} | done @gl_extension{EXT,texture_compression_s3tc} | done @@ -321,6 +323,7 @@ Extension | Status @gl_extension{EXT,debug_marker} | done @gl_extension{EXT,sRGB_R8} | done @gl_extension{GREMEDY,string_marker} | done +@gl_extension{NV,fragment_shader_barycentric} | done (shading language only) @gl_extension{OVR,multiview} | | @gl_extension{OVR,multiview2} | | diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 0787d4718..897c6b0d1 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -80,6 +80,7 @@ constexpr Extension ExtensionList[]{ _extension(AMD,transform_feedback3_lines_triangles), _extension(AMD,vertex_shader_layer), _extension(AMD,shader_trinary_minmax), + _extension(AMD,shader_explicit_vertex_parameter), _extension(ARB,robustness), _extension(ARB,robustness_isolation), _extension(ARB,robustness_application_isolation), @@ -90,6 +91,7 @@ constexpr Extension ExtensionList[]{ _extension(ARB,sparse_texture), _extension(ARB,sparse_buffer), _extension(ARB,ES3_2_compatibility), + _extension(ARB,sample_locations), _extension(ATI,texture_mirror_once), _extension(EXT,texture_filter_anisotropic), _extension(EXT,texture_compression_s3tc), @@ -106,6 +108,7 @@ constexpr Extension ExtensionList[]{ _extension(KHR,blend_equation_advanced), _extension(KHR,blend_equation_advanced_coherent), _extension(KHR,texture_compression_astc_sliced_3d), + _extension(NV,fragment_shader_barycentric), _extension(OVR,multiview), _extension(OVR,multiview2)}; constexpr Extension ExtensionList300[]{ @@ -343,6 +346,9 @@ constexpr Extension ExtensionList[]{ _extension(NV,shader_noperspective_interpolation), #endif _extension(NV,polygon_mode), + #ifndef MAGNUM_TARGET_GLES2 + _extension(NV,fragment_shader_barycentric), + #endif _extension(OES,depth32), _extension(OES,mapbuffer), _extension(OES,stencil1), diff --git a/src/Magnum/GL/Extensions.h b/src/Magnum/GL/Extensions.h index 4a2a5b670..84adf65e9 100644 --- a/src/Magnum/GL/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -92,6 +92,7 @@ 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 } namespace ARB { _extension( 10,ARB,texture_rectangle, GL210, GL310) // #38 _extension( 11,ARB,color_buffer_float, GL210, GL300) // #39 @@ -211,13 +212,14 @@ namespace AMD { _extension(125,ARB,sparse_buffer, GL210, None) // #172 _extension(126,ARB,transform_feedback_overflow_query, GL300, GL460) // #173 _extension(127,ARB,ES3_2_compatibility, GL450, None) // #177 - _extension(128,ARB,shader_atomic_counter_ops, GL300, GL460) // #182 - _extension(129,ARB,gl_spirv, GL330, GL460) // #190 - _extension(130,ARB,polygon_offset_clamp, GL330, GL460) // #193 - _extension(131,ARB,spirv_extensions, GL330, GL460) // #194 - _extension(132,ARB,texture_filter_anisotropic, GL210, GL460) // #195 + _extension(128,ARB,sample_locations, GL450, None) // #181 + _extension(129,ARB,shader_atomic_counter_ops, GL300, GL460) // #182 + _extension(130,ARB,gl_spirv, GL330, GL460) // #190 + _extension(131,ARB,polygon_offset_clamp, GL330, GL460) // #193 + _extension(132,ARB,spirv_extensions, GL330, GL460) // #194 + _extension(133,ARB,texture_filter_anisotropic, GL210, GL460) // #195 } namespace ATI { - _extension(133,ATI,texture_mirror_once, GL210, None) // #221 + _extension(134,ATI,texture_mirror_once, GL210, None) // #221 } namespace EXT { _extension(139,EXT,texture_filter_anisotropic, GL210, None) // #187 _extension(140,EXT,texture_compression_s3tc, GL210, None) // #198 @@ -257,11 +259,12 @@ 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 } namespace OVR { - _extension(178,OVR,multiview, GL300, None) // #478 - _extension(179,OVR,multiview2, GL300, None) // #479 + _extension(185,OVR,multiview, GL300, None) // #478 + _extension(186,OVR,multiview2, GL300, None) // #479 } namespace MAGNUM { - _extension(180,MAGNUM,shader_vertex_id, GL300, GL300) + _extension(187,MAGNUM,shader_vertex_id, GL300, GL300) } #elif defined(MAGNUM_TARGET_WEBGL) namespace ANGLE { @@ -472,6 +475,9 @@ namespace ANDROID { _extension( 95,NV,shader_noperspective_interpolation, GLES300, None) // #201 #endif _extension( 96,NV,polygon_mode, GLES200, None) // #238 + #ifndef MAGNUM_TARGET_GLES2 + _extension( 97,NV,fragment_shader_barycentric, GLES320, None) // #316 + #endif } namespace OES { #ifdef MAGNUM_TARGET_GLES2 _extension(100,OES,depth24, GLES200, GLES300) // #24 diff --git a/src/MagnumExternal/OpenGL/GL/extensions.txt b/src/MagnumExternal/OpenGL/GL/extensions.txt index c2bfbdd4c..ed5dabb6f 100644 --- a/src/MagnumExternal/OpenGL/GL/extensions.txt +++ b/src/MagnumExternal/OpenGL/GL/extensions.txt @@ -11,6 +11,7 @@ extension EXT_texture_sRGB optional extension AMD_transform_feedback3_lines_triangles optional extension AMD_vertex_shader_layer optional extension AMD_shader_trinary_minmax optional +extension AMD_shader_explicit_vertex_parameter optional extension ARB_robustness optional extension ARB_robustness_isolation optional extension ARB_robustness_application_isolation optional @@ -21,6 +22,7 @@ extension ARB_seamless_cubemap_per_texture optional extension ARB_sparse_texture optional extension ARB_sparse_buffer optional extension ARB_ES3_2_compatibility optional +extension ARB_sample_locations optional extension ATI_texture_mirror_once optional # extension EXT_texture_filter_anisotropic optional extension EXT_texture_compression_s3tc optional @@ -37,6 +39,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_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 ebd21204c..27a46d0af 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGL.cpp @@ -63,6 +63,11 @@ FLEXTGL_EXPORT void(APIENTRY *flextglGetnUniformivARB)(GLuint, GLint, GLsizei, G FLEXTGL_EXPORT void(APIENTRY *flextglGetnUniformuivARB)(GLuint, GLint, GLsizei, GLuint *) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglReadnPixelsARB)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, void *) = nullptr; +/* GL_ARB_sample_locations */ +FLEXTGL_EXPORT void(APIENTRY *flextglEvaluateDepthValuesARB)(void) = nullptr; +FLEXTGL_EXPORT void(APIENTRY *flextglFramebufferSampleLocationsfvARB)(GLenum, GLuint, GLsizei, const GLfloat *) = nullptr; +FLEXTGL_EXPORT void(APIENTRY *flextglNamedFramebufferSampleLocationsfvARB)(GLuint, GLuint, GLsizei, const GLfloat *) = nullptr; + /* GL_ARB_sparse_buffer */ FLEXTGL_EXPORT void(APIENTRY *flextglBufferPageCommitmentARB)(GLenum, GLintptr, GLsizeiptr, GLboolean) = nullptr; FLEXTGL_EXPORT void(APIENTRY *flextglNamedBufferPageCommitmentARB)(GLuint, GLintptr, GLsizeiptr, GLboolean) = nullptr; diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index 02712d611..26972f4b6 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -1666,6 +1666,17 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 #define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 +/* GL_ARB_sample_locations */ + +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 + /* GL_ATI_texture_mirror_once */ #define GL_MIRROR_CLAMP_ATI 0x8742 @@ -1831,6 +1842,15 @@ GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglGetnUniformuivARB)(GLuint, GLint, GLs GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglReadnPixelsARB)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, void *); #define glReadnPixelsARB flextglReadnPixelsARB +/* GL_ARB_sample_locations */ + +GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglEvaluateDepthValuesARB)(void); +#define glEvaluateDepthValuesARB flextglEvaluateDepthValuesARB +GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglFramebufferSampleLocationsfvARB)(GLenum, GLuint, GLsizei, const GLfloat *); +#define glFramebufferSampleLocationsfvARB flextglFramebufferSampleLocationsfvARB +GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglNamedFramebufferSampleLocationsfvARB)(GLuint, GLuint, GLsizei, const GLfloat *); +#define glNamedFramebufferSampleLocationsfvARB flextglNamedFramebufferSampleLocationsfvARB + /* GL_ARB_sparse_buffer */ GLAPI FLEXTGL_EXPORT void(APIENTRY *flextglBufferPageCommitmentARB)(GLenum, GLintptr, GLsizeiptr, GLboolean); diff --git a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp index 2c8b13d97..ded659730 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp @@ -152,6 +152,11 @@ void flextGLInit(Magnum::GL::Context& context) { flextglGetnUniformuivARB = reinterpret_cast(loader.load("glGetnUniformuivARB")); flextglReadnPixelsARB = reinterpret_cast(loader.load("glReadnPixelsARB")); + /* GL_ARB_sample_locations */ + flextglEvaluateDepthValuesARB = reinterpret_cast(loader.load("glEvaluateDepthValuesARB")); + flextglFramebufferSampleLocationsfvARB = reinterpret_cast(loader.load("glFramebufferSampleLocationsfvARB")); + flextglNamedFramebufferSampleLocationsfvARB = reinterpret_cast(loader.load("glNamedFramebufferSampleLocationsfvARB")); + /* GL_ARB_sparse_buffer */ flextglBufferPageCommitmentARB = reinterpret_cast(loader.load("glBufferPageCommitmentARB")); flextglNamedBufferPageCommitmentARB = reinterpret_cast(loader.load("glNamedBufferPageCommitmentARB")); diff --git a/src/MagnumExternal/OpenGL/GLES3/extensions.txt b/src/MagnumExternal/OpenGL/GLES3/extensions.txt index 4ba30130d..1fbecfa48 100644 --- a/src/MagnumExternal/OpenGL/GLES3/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES3/extensions.txt @@ -75,6 +75,7 @@ extension NV_read_depth_stencil optional extension NV_texture_border_clamp optional extension NV_shader_noperspective_interpolation optional extension NV_polygon_mode optional +extension NV_fragment_shader_barycentric optional extension OES_depth32 optional extension OES_mapbuffer optional extension OES_stencil1 optional