From 51fee802245e1b4f3c4b4b603db096d02cf6dfff Mon Sep 17 00:00:00 2001 From: valid-ptr Date: Thu, 12 Dec 2019 18:41:23 +0300 Subject: [PATCH] glInvalidateFramebuffer added to GLExtensions --- include/osg/GLExtensions | 2 ++ src/osg/GLExtensions.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/osg/GLExtensions b/include/osg/GLExtensions index 0b7864515..aa868e9cf 100644 --- a/include/osg/GLExtensions +++ b/include/osg/GLExtensions @@ -657,6 +657,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced bool isFrameBufferObjectSupported; bool isPackedDepthStencilSupported; bool isMultisampledRenderToTextureSupported; + bool isInvalidateFramebufferSupported; bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; } bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; } @@ -683,6 +684,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced void (GL_APIENTRY * glGenerateMipmap) (GLenum); void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); + void (GL_APIENTRY * glInvalidateFramebuffer) (GLenum, GLsizei, const GLenum*); // GL_ARB_invalidate_subdata or GL 4.3 or GLES 3 void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*); //ARB_framebuffer_no_attachments diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index 1c3bfe1a9..07078769a 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -1077,6 +1077,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID): // FrameBufferObject + isMultisampledRenderToTextureSupported = validContext && isGLExtensionSupported(contextID, "GL_EXT_multisampled_render_to_texture"); + isInvalidateFramebufferSupported = validContext && (isGLExtensionSupported(contextID, "GL_ARB_invalidate_subdata") || (OSG_GLES2_FEATURES && glVersion >= 3.0) || (OSG_GL2_FEATURES && glVersion >= 4.3)); + setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES", validContext); setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES", validContext); setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES", validContext); @@ -1106,6 +1109,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID): setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES", validContext); setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES", validContext); + setGLExtensionFuncPtr(glInvalidateFramebuffer, "glInvalidateFramebuffer", "glInvalidateFramebufferEXT", validContext); setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES", validContext); @@ -1130,8 +1134,6 @@ GLExtensions::GLExtensions(unsigned int in_contextID): (isGLExtensionSupported(contextID, "GL_EXT_packed_depth_stencil")) || (isGLExtensionSupported(contextID, "GL_OES_packed_depth_stencil"))); - isMultisampledRenderToTextureSupported = validContext && isGLExtensionSupported(contextID, "GL_EXT_multisampled_render_to_texture"); - //subroutine osg::setGLExtensionFuncPtr(glGetSubroutineUniformLocation, "glGetSubroutineUniformLocation", validContext); osg::setGLExtensionFuncPtr(glGetActiveSubroutineUniformName, "glGetActiveSubroutineUniformName", validContext);