Module: Mesa Branch: master Commit: c601e730b298c5bdd34bc4335f203d46c5cdf9b3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c601e730b298c5bdd34bc4335f203d46c5cdf9b3
Author: Alyssa Rosenzweig <[email protected]> Date: Mon Aug 31 07:09:30 2020 -0400 mesa/st: Don't set alpha if ALPHA_TEST is lowered When PIPE_CAP_ALPHA_TEST is zero, the driver does not support alpha testing, so alpha shouldn't be set. In particular, alpha.enable should be zero, since logically alpha testing is not used in the ZSA CSO when it's lowered in the fragment shader key. Fixes failing asserts in kicad, rvgl, etc with Panfrost since 6afd4ad. (We could remove the assert in panfrost instead, but logically setting alpha.enabled on top of lowering the shader seems wrong?) As Erik pointed out, this should improve CSO cache behaviour. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Icecream95 <[email protected]> Tested-by: Urja Rannikko <[email protected]> Tested-by: Robin Murphy <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> Fixes: 6afd4addefa ("panfrost: Simplify depth/stencil/alpha") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6523> --- src/mesa/state_tracker/st_atom_depth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 9e12361f881..c6995812e4e 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -149,7 +149,7 @@ st_update_depth_stencil_alpha(struct st_context *st) } } - if (ctx->Color.AlphaEnabled && + if (ctx->Color.AlphaEnabled && !st->lower_alpha_test && !(ctx->DrawBuffer->_IntegerBuffers & 0x1)) { dsa->alpha.enabled = 1; dsa->alpha.func = st_compare_func_to_pipe(ctx->Color.AlphaFunc); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
