[Mesa-dev] [PATCH] virgl: clear render state before submitting clear command
Gert Wollny
gert.wollny at collabora.com
Tue May 8 07:36:36 UTC 2018
Am Montag, den 07.05.2018, 18:25 -0700 schrieb Gurchetan Singh:
> In vrend_clear, we already save and restore colormasks and stencils:
>
> https://cgit.freedesktop.org/virglrenderer/commit/?id=b75e0a1dabdfbda
> 44c310a69026a9dbd7d980294
> https://cgit.freedesktop.org/virglrenderer/commit/?id=252b00d77c30ce3
> 9608c1a9de18523cbdcaca623
>
> It would be nice if we can put everything on the host side. Wouldn't
> the following code also solve the RASTERIZER_DISCARD problem?
>
> if (ctx->sub->hw_rs_state.rasterizer_discard)
> glDisable(GL_RASTERIZER_DISCARD)
>
> ...
>
> glClear(..)
>
> ...
>
> if (ctx->sub->hw_rs_state.rasterizer_discard)
> glEnable(GL_RASTERIZER_DISCARD)
Thinking of it, re-enabling this should not be needed, because if
gallium clear is called from the guest this state should be disabled
anyway, the state just didn't get transmitted to the host.
For now I'll add it but leave a comment.
More information about the mesa-dev
mailing list