From 5b1a4578f545d5181265d9120b48bc92753b63b9 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Wed, 27 Nov 2019 20:27:19 +0100 Subject: 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 --- src/gui/opengl/qopenglfunctions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gui') 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")) -- cgit v1.2.3