Skip to content

Commit 7e6b32f

Browse files
committed
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 <[email protected]>
1 parent c82c310 commit 7e6b32f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plugins/platforms/webgl/webqt.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,14 @@ window.onload = function () {
498498
// the depth and stencil attachment points. WebGL does not allow this. Instead,
499499
// we need to attach to the DEPTH_STENCIL attachment point.
500500
if (d.renderbufferFormat[d.boundRenderbuffer] === gl.DEPTH_STENCIL) {
501-
if (attachment === gl.STENCIL_ATTACHMENT)
501+
if (attachment === gl.STENCIL_ATTACHMENT) {
502502
attachment = gl.DEPTH_STENCIL_ATTACHMENT;
503+
} else {
504+
// Ignore this call. Qt Quick will send a new call with STENCIL_ATTACHMENT
505+
// parameter, it will be replaced by DEPTH_STENCIL_ATTACHMENT to work-around the
506+
// browser limitation.
507+
return;
508+
}
503509
}
504510
gl._framebufferRenderbuffer(target, attachment, renderbuffertarget,
505511
d.renderbufferMap[renderbuffer]);

0 commit comments

Comments
 (0)