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>
This commit is contained in:
Fredrik Orderud 2019-11-27 20:27:19 +01:00
parent 9fd217e746
commit 5b1a4578f5

View File

@ -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"))