From f46aa24800fa48a2953e262147bcb556911786b1 Mon Sep 17 00:00:00 2001 From: Vishnu Vardan Date: Sun, 26 Apr 2026 00:57:13 -0400 Subject: [PATCH] mesa/st: remove can_null_texture from st_context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can_null_texture is a direct copy of screen->caps.null_textures. Read the cap from the screen directly. Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/texobj.c | 4 ++-- src/mesa/state_tracker/st_context.c | 3 --- src/mesa/state_tracker/st_context.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index a3d20e34464..6ee8d3f5b9e 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1107,7 +1107,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex, bool is internalFormat, texFormat); } _mesa_update_texture_object_swizzle(ctx, texObj); - if (ctx->st->can_null_texture && is_depth) { + if (ctx->st->screen->caps.null_textures && is_depth) { texObj->NullTexture = GL_TRUE; } else { if (is_depth) @@ -1129,7 +1129,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex, bool is /* Complete the driver's operation in case another context will also * use the same fallback texture. */ - if (!ctx->st->can_null_texture || !is_depth) + if (!ctx->st->screen->caps.null_textures || !is_depth) st_glFinish(ctx); } return ctx->Shared->FallbackTex[tex][is_depth]; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 3a7e9623203..68804f8c7da 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -594,9 +594,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, st->has_hw_atomics = screen->shader_caps[MESA_SHADER_FRAGMENT].max_hw_atomic_counters ? true : false; - st->can_null_texture = - screen->caps.null_textures - ? true : false; util_throttle_init(&st->throttle, screen->caps.max_texture_upload_memory_budget); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 236ce9ee4f1..abcc8dee9df 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -176,7 +176,6 @@ struct st_context bool draw_needs_minmax_index; bool has_hw_atomics; - bool can_null_texture; bool is_threaded_context; /* driver supports scissored clears */