[virglrenderer-devel] [PATCH 1/1] Fixes stencil cleaning issue in OpenGL ES3

Robert Tarasov tutankhamen at chromium.org
Thu Mar 15 00:25:21 UTC 2018


Resets stencil buffer write mask to ~0u before glClear().
Fixes many tests which use stencil buffer with increment, decrement or
invert operations. For example:
dEQP-GLES3.functional.fragment_ops.random.18
dEQP-GLES3.functional.fragment_ops.random.25
dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.2
---
 src/vrend_renderer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 70fbdca..3b6a840 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -2470,8 +2470,10 @@ void vrend_clear(struct vrend_context *ctx,
       }
    }
 
-   if (buffers & PIPE_CLEAR_STENCIL)
+   if (buffers & PIPE_CLEAR_STENCIL) {
+      glStencilMask(~0u);
       glClearStencil(stencil);
+   }
 
    if (buffers & PIPE_CLEAR_COLOR) {
       uint32_t mask = 0;
-- 
2.16.2.804.g6dcf76e118-goog



More information about the virglrenderer-devel mailing list