[Mesa-dev] [PATCH 1/2] st/mesa: remove the "Gallium 0.4 on" prefix from GL_RENDERER

Marek Olšák maraeo at gmail.com
Wed Jun 7 20:09:29 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

If you want to keep it for your driver, please raise your hand.
The prefix will probably have to be added into the driver instead of here.

I cringe when I look at my long renderer string:
  Gallium 0.4 on AMD Radeon R9 Fury Series (DRM 3.17.0 / 4.11.0-staging-01277-gab25a9e, LLVM 5.0.0)

I'm sincerely sorry for all apps that detect Mesa by expecting "Gallium"
in the string.
---
 src/mesa/state_tracker/st_cb_strings.c | 8 +-------
 src/mesa/state_tracker/st_context.h    | 1 -
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
index fc48fd0..99d93a7 100644
--- a/src/mesa/state_tracker/st_cb_strings.c
+++ b/src/mesa/state_tracker/st_cb_strings.c
@@ -32,41 +32,35 @@
   */
 
 #include "main/glheader.h"
 #include "main/macros.h"
 #include "pipe/p_context.h"
 #include "pipe/p_screen.h"
 #include "util/u_string.h"
 #include "st_context.h"
 #include "st_cb_strings.h"
 
-#define ST_VERSION_STRING "0.4"
-
 static const GLubyte *
 st_get_string(struct gl_context * ctx, GLenum name)
 {
    struct st_context *st = st_context(ctx);
    struct pipe_screen *screen = st->pipe->screen;
 
    switch (name) {
    case GL_VENDOR: {
       const char *vendor = screen->get_vendor( screen );
       util_snprintf(st->vendor, sizeof(st->vendor), "%s", vendor);
       return (GLubyte *) st->vendor;
    }
 
    case GL_RENDERER:
-      util_snprintf(st->renderer, sizeof(st->renderer), "Gallium %s on %s", 
-               ST_VERSION_STRING,
-	       screen->get_name( screen ));
-
-      return (GLubyte *) st->renderer;
+      return (GLubyte *) screen->get_name(screen);
 
    default:
       return NULL;
    }
 }
 
 
 void st_init_string_functions(struct dd_function_table *functions)
 {
    functions->GetString = st_get_string;
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 631c3ae..1756e57 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -151,21 +151,20 @@ struct st_context
          struct pipe_scissor_state rects[PIPE_MAX_WINDOW_RECTANGLES];
       } window_rects;
       unsigned sample_mask;
 
       GLuint poly_stipple[32];  /**< In OpenGL's bottom-to-top order */
 
       GLuint fb_orientation;
    } state;
 
    char vendor[100];
-   char renderer[100];
 
    uint64_t dirty; /**< dirty states */
 
    /** This masks out unused shader resources. Only valid in draw calls. */
    uint64_t active_states;
 
    /* If true, further analysis of states is required to know if something
     * has changed. Used mainly for shaders.
     */
    bool gfx_shaders_may_be_dirty;
-- 
2.7.4



More information about the mesa-dev mailing list