summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2017-11-14 13:56:41 +0100
committerJesus Fernandez <Jesus.Fernandez@qt.io>2017-11-14 17:15:11 +0000
commit7e6b32f87d054cc0210df066bab6470f458fbf3c (patch)
treeae1358ffe4b0efb8932bbbb2d8bf7cb7ceb26f3e
parentc82c3103f3e875d7d5f79dc3c4b273e9644e4ded (diff)
Fix conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments warning
The hack, to convert two consecutive calls to glFramebufferRenderbuffer with parameters GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, was not working properly. Now the call using GL_DEPTH_ATTACHMENT is ignored and the call using GL_STENCIL_ATTACHMENT is converted into a GL_DEPTH_STENCIL_ATTACHMENT. This fixes the QuickItem ShaderEffect using a ShaderEffectSource as source item. Change-Id: Ic77bedf1837e8fa3a11818e6e5aaf8d990d6b8ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--src/plugins/platforms/webgl/webqt.jsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/platforms/webgl/webqt.jsx b/src/plugins/platforms/webgl/webqt.jsx
index cea2da0..5a5c8a5 100644
--- a/src/plugins/platforms/webgl/webqt.jsx
+++ b/src/plugins/platforms/webgl/webqt.jsx
@@ -498,8 +498,14 @@ window.onload = function () {
// the depth and stencil attachment points. WebGL does not allow this. Instead,
// we need to attach to the DEPTH_STENCIL attachment point.
if (d.renderbufferFormat[d.boundRenderbuffer] === gl.DEPTH_STENCIL) {
- if (attachment === gl.STENCIL_ATTACHMENT)
+ if (attachment === gl.STENCIL_ATTACHMENT) {
attachment = gl.DEPTH_STENCIL_ATTACHMENT;
+ } else {
+ // Ignore this call. Qt Quick will send a new call with STENCIL_ATTACHMENT
+ // parameter, it will be replaced by DEPTH_STENCIL_ATTACHMENT to work-around the
+ // browser limitation.
+ return;
+ }
}
gl._framebufferRenderbuffer(target, attachment, renderbuffertarget,
d.renderbufferMap[renderbuffer]);