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

Dave Airlie airlied at gmail.com
Thu Mar 15 00:29:27 UTC 2018


On 15 March 2018 at 10:25, Robert Tarasov <tutankhamen at chromium.org> wrote:
> 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

Seems correct, but I think you want to reset it later like we do for
DepthMask and ColorMask.

Dave.

> ---
>  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