From 6d81b9c9722b4c8cf09c24da3ff057284083c927 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 24 Mar 2021 14:24:10 -0400 Subject: [PATCH] gallium: Remove curious st_visual::no_config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gallium context creation API embeds storage for a whole st_visual even if the context is to have no config. no_config was being used to signal this, but we can just as easily check that the color format is non-NONE. Reviewed-by: Marek Olšák Part-of: --- src/gallium/frontends/dri/dri_screen.c | 4 +--- src/gallium/include/frontend/api.h | 2 -- src/mesa/state_tracker/st_manager.c | 9 ++------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index e0326c14b82..c09dfc68a2b 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -354,10 +354,8 @@ dri_fill_st_visual(struct st_visual *stvis, { memset(stvis, 0, sizeof(*stvis)); - if (!mode) { - stvis->no_config = true; + if (!mode) return; - } /* Deduce the color format. */ switch (mode->redMask) { diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 333191fdbf0..936b09227f4 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -194,8 +194,6 @@ struct st_egl_image */ struct st_visual { - bool no_config; - /** * Available buffers. Bitfield of ST_ATTACHMENT_*_MASK bits. */ diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index a37b0fd1a65..c5cc0828617 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -871,8 +871,7 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, struct st_context *shared_ctx = (struct st_context *) shared_stctxi; struct st_context *st; struct pipe_context *pipe; - struct gl_config* mode_ptr; - struct gl_config mode; + struct gl_config mode, *mode_ptr = &mode; gl_api api; bool no_error = false; unsigned ctx_flags = PIPE_CONTEXT_PREFER_THREADED; @@ -936,12 +935,8 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi, } st_visual_to_context_mode(&attribs->visual, &mode); - - if (attribs->visual.no_config) + if (attribs->visual.color_format == PIPE_FORMAT_NONE) mode_ptr = NULL; - else - mode_ptr = &mode; - st = st_create_context(api, pipe, mode_ptr, shared_ctx, &attribs->options, no_error); if (!st) {