summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2018-03-21 19:12:02 +1000
committerLorn Potter <lorn.potter@gmail.com>2018-04-10 09:27:27 +0000
commite9b9694a3af30785e135ca653bf44422fe8eb09e (patch)
tree64dc7fd62a3644a18e1695cf38ac5c722a42d86a /src/widgets
parent2b5d08c4f826df9191a0d2b6439574fc2014d4ec (diff)
webassembly: fix depth and stencil opengl framebuffers
webgl has different specifics Task-number: QTBUG-66944 Change-Id: Ie1ad61715ba13e0865ae2d2bfd80c88d1ae9c18f Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index c96b6812c4..c1bf3cd4af 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -906,9 +906,17 @@ void QOpenGLWidgetPrivate::invalidateFbo()
const int gl_color_attachment0 = 0x8CE0; // GL_COLOR_ATTACHMENT0
const int gl_depth_attachment = 0x8D00; // GL_DEPTH_ATTACHMENT
const int gl_stencil_attachment = 0x8D20; // GL_STENCIL_ATTACHMENT
+#ifdef Q_OS_HTML5
+ const int gl_depth_stencil_attachment = 0x821A; // GL_DEPTH_STENCIL_ATTACHMENT
+
+ const GLenum attachments[] = {
+ gl_color_attachment0, gl_depth_attachment, gl_stencil_attachment, gl_depth_stencil_attachment
+ };
+#else
const GLenum attachments[] = {
gl_color_attachment0, gl_depth_attachment, gl_stencil_attachment
};
+#endif
f->glDiscardFramebufferEXT(GL_FRAMEBUFFER, sizeof attachments / sizeof *attachments, attachments);
} else {
f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);