summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-04 01:00:23 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-04 01:00:23 +0100
commit0c29ebe374caad7e29c6a3d35c72c4eddaacc6af (patch)
treec6b228302ab37375a82f7bfb535e5bb39d36e624 /src/gui/opengl
parente5438e8ded27eb6f7f0e85704d6843069296c698 (diff)
parent2ed59f0d42d2817a5855be167f5e3ccf23563e39 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp6
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index 5d30891565..bb0dbdc9bd 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -658,13 +658,11 @@ void QOpenGLFramebufferObjectPrivate::initDepthStencilAttachments(QOpenGLContext
funcs.glBindRenderbuffer(GL_RENDERBUFFER, depth_buffer);
Q_ASSERT(funcs.glIsRenderbuffer(depth_buffer));
- GLenum storageFormat = GL_DEPTH_STENCIL;
-
if (samples != 0 ) {
funcs.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
- storageFormat, dsSize.width(), dsSize.height());
+ GL_DEPTH24_STENCIL8, dsSize.width(), dsSize.height());
} else {
- funcs.glRenderbufferStorage(GL_RENDERBUFFER, storageFormat,
+ funcs.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_STENCIL,
dsSize.width(), dsSize.height());
}
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index 42186ace23..3e9eb3dd0a 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -388,8 +388,12 @@ static int qt_gl_resolve_extensions()
| QOpenGLExtensions::MapBufferRange
| QOpenGLExtensions::FramebufferBlit
| QOpenGLExtensions::FramebufferMultisample
- | QOpenGLExtensions::Sized8Formats
- | QOpenGLExtensions::TextureSwizzle;
+ | QOpenGLExtensions::Sized8Formats;
+#ifndef Q_OS_WASM
+ // WebGL 2.0 specification explicitly does not support texture swizzles
+ // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.19
+ extensions |= QOpenGLExtensions::TextureSwizzle;
+#endif
} else {
// Recognize features by extension name.
if (extensionMatcher.match("GL_OES_packed_depth_stencil"))