glInvalidateFramebuffer added to GLExtensions

This commit is contained in:
valid-ptr 2019-12-12 18:41:23 +03:00 committed by konstantin.matveyev
parent fefabb6c2b
commit 51fee80224
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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);