[Mesa-dev] [PATCH 08/16] freedreno: a2xx: enable early-Z testing

Eric Anholt eric at anholt.net
Wed Dec 19 18:05:33 UTC 2018


Jonathan Marek <jonathan at marek.ca> writes:

> Enable earlyZ when alpha test is disabled.
>
> Signed-off-by: Jonathan Marek <jonathan at marek.ca>
> ---
>  src/gallium/drivers/freedreno/a2xx/fd2_zsa.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_zsa.c b/src/gallium/drivers/freedreno/a2xx/fd2_zsa.c
> index 64b31b677b..d3c19b4450 100644
> --- a/src/gallium/drivers/freedreno/a2xx/fd2_zsa.c
> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_zsa.c
> @@ -49,7 +49,8 @@ fd2_zsa_state_create(struct pipe_context *pctx,
>  		A2XX_RB_DEPTHCONTROL_ZFUNC(cso->depth.func); /* maps 1:1 */
>  
>  	if (cso->depth.enabled)
> -		so->rb_depthcontrol |= A2XX_RB_DEPTHCONTROL_Z_ENABLE;
> +		so->rb_depthcontrol |= A2XX_RB_DEPTHCONTROL_Z_ENABLE |
> +			COND(!cso->alpha.enabled, A2XX_RB_DEPTHCONTROL_EARLY_Z_ENABLE);

Why when alpha test is disabled?  Should you also be checking if the
shader does discards?  How about if the shader writes Z, is anything
preventing early Z then?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181219/0d3fd9de/attachment.sig>


More information about the mesa-dev mailing list