From 8a60244da8f34aaa4ba0f71ada5b87aee33e0715 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Sun, 24 Nov 2019 21:45:46 +0100 Subject: Fix renderbufferStorageMultisample: invalid internalformat Chrome 78 is outputting "INVALID_ENUM: renderbufferStorageMultisample: invalid internalformat" when running a Qt application after building it for WebAssembly (WASM) against the Qt 5.13 branch using the Emscripten 1.39.3 (upstream) compiler. The problem appear to be caused by glRenderbufferStorageMultisample not supporting GL_DEPTH_STENCIL directly. Instead, GL_DEPTH24_STENCIL8 or GL_DEPTH32F_STENCIL8 should be passed. Keeping the glRenderbufferStorage call as-is. Change-Id: I777dbc26b1d989950525a434a25ed344389f5059 Reference: https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glRenderbufferStorageMultisample.xhtml Fixes: QTBUG-80286 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglframebufferobject.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gui') 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()); } -- cgit v1.2.3 From ee3e0ed751e8acdd5f1cefb430b0981c21f71f8e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 25 Nov 2019 11:15:22 +0100 Subject: rhi: gl: Fix ms renderbuffer on WASM with WebGL2 Unlike renderbufferStorage, renderbufferStorageMultisample is not guaranteed to accept the unsized GL_DEPTH_STENCIL internalformat. For the former, WebGL 2 guarantees it for compatibility for WebGL 1, but the multisample version does not exist in WebGL 1, so from the specs it is not given at all that the unsized format would be accepted. So use the ES 3.0 sized format instead, like we would on a "real" ES 3.0 implementation. Fixes: QTBUG-80296 Change-Id: I822ae382097085c0a3279c16bb69a173dbf15093 Reviewed-by: Andy Nichols --- src/gui/rhi/qrhigles2.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index abee843a74..b394354787 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -3147,8 +3147,7 @@ bool QGles2RenderBuffer::build() switch (m_type) { case QRhiRenderBuffer::DepthStencil: if (rhiD->caps.msaaRenderBuffer && samples > 1) { - const GLenum storage = rhiD->caps.needsDepthStencilCombinedAttach ? GL_DEPTH_STENCIL : GL_DEPTH24_STENCIL8; - rhiD->f->glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storage, + rhiD->f->glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, GL_DEPTH24_STENCIL8, size.width(), size.height()); stencilRenderbuffer = 0; } else if (rhiD->caps.packedDepthStencil || rhiD->caps.needsDepthStencilCombinedAttach) { -- cgit v1.2.3 From 9fd217e7467fa5f82340c30b1b6bb28557057919 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 27 Nov 2019 12:46:28 +0100 Subject: Silence intel compiler warning about float comparison Add the equivalent intel warning macro in public header where there was already the macro for -Wfloat-equal Change-Id: I8f20400f0b95c8f3857fa7a0a33464c8c34d5c0e Reviewed-by: Thiago Macieira --- src/gui/math3d/qmatrix4x4.h | 1 + src/gui/math3d/qquaternion.h | 1 + src/gui/math3d/qvector2d.h | 1 + src/gui/math3d/qvector3d.h | 1 + src/gui/math3d/qvector4d.h | 1 + src/gui/painting/qtransform.h | 1 + 6 files changed, 6 insertions(+) (limited to 'src/gui') diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index 69c3510659..1439bfac59 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -215,6 +215,7 @@ private: QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) Q_DECLARE_TYPEINFO(QMatrix4x4, Q_MOVABLE_TYPE); inline QMatrix4x4::QMatrix4x4 diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index cd0d746e55..f01fab679e 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -171,6 +171,7 @@ inline QQuaternion::QQuaternion(float aScalar, float xpos, float ypos, float zpo QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) inline bool QQuaternion::isNull() const { return wp == 0.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f; diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index 88d8bc199e..cbce94c199 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -207,6 +207,7 @@ inline QVector2D &QVector2D::operator/=(const QVector2D &vector) QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) Q_DECL_CONSTEXPR inline bool operator==(const QVector2D &v1, const QVector2D &v2) { return v1.v[0] == v2.v[0] && v1.v[1] == v2.v[1]; diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 1b49f3e7b9..d7ffb0bcc4 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -232,6 +232,7 @@ inline QVector3D &QVector3D::operator/=(const QVector3D &vector) QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) Q_DECL_CONSTEXPR inline bool operator==(const QVector3D &v1, const QVector3D &v2) { return v1.v[0] == v2.v[0] && v1.v[1] == v2.v[1] && v1.v[2] == v2.v[2]; diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index 08cb423484..afcc71fa88 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -232,6 +232,7 @@ inline QVector4D &QVector4D::operator/=(const QVector4D &vector) QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) Q_DECL_CONSTEXPR inline bool operator==(const QVector4D &v1, const QVector4D &v2) { return v1.v[0] == v2.v[0] && v1.v[1] == v2.v[1] && v1.v[2] == v2.v[2] && v1.v[3] == v2.v[3]; diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index b220770144..b2a634dd2a 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -303,6 +303,7 @@ inline qreal QTransform::dy() const QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wfloat-equal") QT_WARNING_DISABLE_GCC("-Wfloat-equal") +QT_WARNING_DISABLE_INTEL(1572) inline QTransform &QTransform::operator*=(qreal num) { -- cgit v1.2.3 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 From 0f812db558df072a411ade3305b796d54bccd996 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 29 Nov 2019 10:43:20 +0100 Subject: rhi: vulkan: Remove unused include QVulkanWindow support has long been removed from the Vulkan backend. The include is a leftover from those times. Change-Id: Ie68ac3611b24310f2b6111a72dd0679adafdc74d Reviewed-by: Johan Helsing --- src/gui/rhi/qrhivulkan.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 103fea627a..444a395ebc 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -48,7 +48,6 @@ #include #include -#include QT_BEGIN_NAMESPACE -- cgit v1.2.3 From b63141fb1496e528e0e155513a5d4e954b0a1565 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 2 Dec 2019 09:14:19 +0100 Subject: RHI/Vulkan: Fix build Add missing include, fixing: rhi\qrhivulkan.cpp(6273): error C2027: use of undefined type 'QWindow' Amends 0f812db558df072a411ade3305b796d54bccd996. Change-Id: Ide61b713e958877f18a45a89b36a4e1330f75821 Reviewed-by: Laszlo Agocs --- src/gui/rhi/qrhivulkan.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui') diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 444a395ebc..a200a6e271 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -48,6 +48,7 @@ #include #include +#include QT_BEGIN_NAMESPACE -- cgit v1.2.3