From 4fd17e53f35f07a63a165b86069f09cb517e16ea Mon Sep 17 00:00:00 2001 From: Vishnu Vardan Date: Sat, 25 Apr 2026 20:49:48 -0400 Subject: [PATCH] mesa/st: remove redundant has_stencil_export from st_context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cap is a direct alias of screen->caps.shader_stencil_export. Replace all st_context usages with the screen cap directly. Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_cb_drawpixels.c | 6 +++--- src/mesa/state_tracker/st_context.c | 2 -- src/mesa/state_tracker/st_context.h | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 587080864d3..7e3bf1895f9 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1305,7 +1305,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, write_depth = GL_TRUE; if (write_stencil && - !st->has_stencil_export) { + !st->screen->caps.shader_stencil_export) { /* software fallback */ draw_stencil_pixels(ctx, x, y, width, height, format, type, unpack, pixels); @@ -1692,7 +1692,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* fallback if the driver can't do stencil exports */ if (type == GL_DEPTH_STENCIL && - !st->has_stencil_export) { + !st->screen->caps.shader_stencil_export) { st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_STENCIL); st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_DEPTH); return; @@ -1700,7 +1700,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* fallback if the driver can't do stencil exports */ if (type == GL_STENCIL && - !st->has_stencil_export) { + !st->screen->caps.shader_stencil_export) { copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty); return; } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 1fdc815e0d8..49b83de6372 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -532,8 +532,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, ctx->Const.QueryCounterBits.Timestamp = screen->caps.query_timestamp_bits; - st->has_stencil_export = - screen->caps.shader_stencil_export; st->has_etc1 = screen->is_format_supported(screen, PIPE_FORMAT_ETC1_RGB8, PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index c9d57a35c2a..14b70cf28ac 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -144,7 +144,6 @@ struct st_context GLboolean clamp_frag_color_in_shader; GLboolean clamp_vert_color_in_shader; bool thread_scheduler_disabled; - bool has_stencil_export; /**< can do shader stencil export? */ bool has_time_elapsed; bool has_etc1; bool has_etc2;