diff options
author | Fredrik Orderud <fredrik.orderud@ge.com> | 2019-11-27 20:27:19 +0100 |
---|---|---|
committer | Fredrik Orderud <fredrik.orderud@ge.com> | 2019-11-28 15:21:41 +0100 |
commit | 5b1a4578f545d5181265d9120b48bc92753b63b9 (patch) | |
tree | db44dd6cc85a5718ae349fef10e220bf0e066fe8 | |
parent | 9fd217e7467fa5f82340c30b1b6bb28557057919 (diff) |
wasm: Disable TextureSwizzle
The WebGL 2.0 specification explicitly does not support texture swizzles. Therefore,
disabling it when targeting WASM. This fixes "WebGL: INVALID_ENUM: texParameter:
invalid parameter name" when running in Chrome or Firefox.
Change-Id: Ic7e22e0f623095245274924095cb63fd0ff7e8c2
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.19
Fixes: QTBUG-80287
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/gui/opengl/qopenglfunctions.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 8ec814296a..bc3a4f7c1d 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")) |