summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglextensions_p.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-07-21 13:48:35 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-07-25 23:05:50 +0200
commit8cc8bbb466fb871585bfa1d5c56fc8bc6d6c8a96 (patch)
tree53bcdf2fc7b1e125fb87f1abdcce0fbc3766725f /src/gui/opengl/qopenglextensions_p.h
parentabe7c77d6d095c684f2e725f02638f062aea029c (diff)
QOpenGLWidget: use (and prefer) InvalidateFramebuffer
Desktop GL does not have the GL_EXT_discard_framebuffer extension at all. Instead, it may have GL_ARB_invalidate_subdata. Furthermore, GLES >= 3.0 and GL >= 4.3 both support FBO invalidation through glInvalidateFramebuffer. Extend the semantics of OpenGLExtension::DiscardFramebuffer to mean that *any* possibility above is supported, and wrap it in a helper function that calls whatever support is present. (This is all private API anyhow.) Technically speaking glInvalidateFramebuffer supports a superset of what glDiscardFramebufferEXT supports, but we never use such superset, and the two APIs are otherwise identical. Then, make QOpenGLWidget call that wrapper. Change-Id: I64e042daf51493d3834c3ba1b53ae6e224bbc4ed Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/opengl/qopenglextensions_p.h')
-rw-r--r--src/gui/opengl/qopenglextensions_p.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index 58231545c6..a6c4a68c6c 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -70,9 +70,9 @@ public:
GLvoid *glMapBuffer(GLenum target, GLenum access);
void glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data);
- void glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
void flushShared();
+ void discardFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments);
QOpenGLExtensionsPrivate *d() const;
@@ -117,14 +117,6 @@ inline void QOpenGLExtensions::glGetBufferSubData(GLenum target, qopengl_GLintpt
Q_OPENGL_FUNCTIONS_DEBUG
}
-
-inline void QOpenGLExtensions::glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments)
-{
- Q_D(QOpenGLExtensions);
- Q_ASSERT(QOpenGLExtensions::isInitialized(d));
- d->DiscardFramebuffer(target,numAttachments, attachments);
- Q_OPENGL_FUNCTIONS_DEBUG
-}
QT_END_NAMESPACE
#endif // QOPENGL_EXTENSIONS_P_H