mesa/st: remove lower_alpha_test from st_context

lower_alpha_test is the negation of screen->caps.alpha_test.
Replace all call sites with !screen->caps.alpha_test directly.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41184>
This commit is contained in:
Vishnu Vardan 2026-04-26 00:14:42 -04:00 committed by Marge Bot
parent 797ebce3e1
commit 7c84af940a
4 changed files with 4 additions and 7 deletions

View file

@ -128,7 +128,7 @@ st_update_depth_stencil_alpha(struct st_context *st)
}
}
if (ctx->Color.AlphaEnabled && !st->lower_alpha_test &&
if (ctx->Color.AlphaEnabled && st->screen->caps.alpha_test &&
!(ctx->DrawBuffer->_IntegerDrawBuffers & 0x1)) {
dsa->alpha_enabled = 1;
dsa->alpha_func = func_to_gallium(ctx->Color.AlphaFunc);

View file

@ -140,7 +140,7 @@ st_update_fp( struct st_context *st )
/* _NEW_COLOR */
key.lower_alpha_func = COMPARE_FUNC_ALWAYS;
if (st->lower_alpha_test && _mesa_is_alpha_test_enabled(st->ctx))
if (!st->screen->caps.alpha_test && _mesa_is_alpha_test_enabled(st->ctx))
key.lower_alpha_func = st->ctx->Color.AlphaFunc;
/* _NEW_LIGHT_STATE | _NEW_PROGRAM */

View file

@ -389,7 +389,7 @@ st_init_driver_flags(struct st_context *st)
ST_SET_STATE(f->NewShaderConstants[MESA_SHADER_FRAGMENT], ST_NEW_FS_CONSTANTS);
ST_SET_STATE(f->NewShaderConstants[MESA_SHADER_COMPUTE], ST_NEW_CS_CONSTANTS);
if (st->lower_alpha_test)
if (!st->screen->caps.alpha_test)
ST_SET_STATE2(f->NewAlphaTest, ST_NEW_FS_STATE, ST_NEW_FS_CONSTANTS);
else
ST_SET_STATE(f->NewAlphaTest, ST_NEW_DSA);
@ -583,8 +583,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_ALPHA_NOT_W);
ctx->Const.GLSLHasHalfFloatPacking =
screen->caps.shader_pack_half_float;
st->lower_alpha_test =
!screen->caps.alpha_test;
switch (screen->caps.point_size_fixed) {
case PIPE_POINT_SIZE_LOWER_ALWAYS:
st->lower_point_size = true;
@ -682,7 +680,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
st->shader_has_one_variant[MESA_SHADER_FRAGMENT] =
st->screen->caps.shareable_shaders &&
st->screen->caps.flatshade &&
(is_gles2 || !st->lower_alpha_test) &&
(is_gles2 || st->screen->caps.alpha_test) &&
!st->clamp_frag_color_in_shader &&
!st->force_persample_in_shader &&
(is_gles2 || !st->lower_two_sided_color);

View file

@ -160,7 +160,6 @@ struct st_context
bool force_specialized_compute_transfer;
bool force_persample_in_shader;
bool can_bind_const_buffer_as_vertex;
bool lower_alpha_test;
bool lower_point_size;
bool add_point_size;
bool lower_two_sided_color;