diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-10-24 16:21:29 +0200 |
---|---|---|
committer | Christian Strømme <christian.stromme@qt.io> | 2022-10-26 12:53:13 +0000 |
commit | 06a5118a4a2b76df2c2c4190ac57fa15857ecf8c (patch) | |
tree | 8caaade5bbe64305c974d04231ceefd55bf53ab3 /src/gui/rhi | |
parent | fbf586db2c587e7ba83cf1bfe8e5b912310d6bdb (diff) |
rhi: gl: Make sure stencil write is enabled when clearing
If the last pipeline had a different stencil (write) mask, that
would affect the clear. That is not ideal.
Exercised by the upcoming stenciloutline manual tests.
Pick-to: 6.4 6.2
Change-Id: I925e85a2b7fb884e5ae9ed327b4b05c9bf36484b
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhigles2.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index e03bdb7d04..4cb37a4cd6 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -3019,8 +3019,10 @@ void QRhiGles2::executeCommandBuffer(QRhiCommandBuffer *cb) f->glDepthMask(GL_TRUE); f->glClearDepthf(cmd.args.clear.d); } - if (cmd.args.clear.mask & GL_STENCIL_BUFFER_BIT) + if (cmd.args.clear.mask & GL_STENCIL_BUFFER_BIT) { + f->glStencilMask(0xFF); f->glClearStencil(GLint(cmd.args.clear.s)); + } f->glClear(cmd.args.clear.mask); cbD->graphicsPassState.reset(); // altered depth/color write, invalidate in order to avoid confusing the state tracking break; |