[Mesa-dev] [PATCH 2/2] st/mesa: simplify returning GL_VENDOR

Nicolai Hähnle nhaehnle at gmail.com
Mon Jun 19 11:15:39 UTC 2017


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 07.06.2017 22:09, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> ---
>   src/mesa/state_tracker/st_cb_strings.c | 4 +---
>   src/mesa/state_tracker/st_context.h    | 2 --
>   2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
> index 99d93a7..85fe5a7 100644
> --- a/src/mesa/state_tracker/st_cb_strings.c
> +++ b/src/mesa/state_tracker/st_cb_strings.c
> @@ -40,23 +40,21 @@
>   #include "st_cb_strings.h"
>   
>   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;
> +      return (GLubyte *) screen->get_vendor(screen);
>      }
>   
>      case GL_RENDERER:
>         return (GLubyte *) screen->get_name(screen);
>   
>      default:
>         return NULL;
>      }
>   }
>   
> diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
> index 1756e57..6ca7ddb 100644
> --- a/src/mesa/state_tracker/st_context.h
> +++ b/src/mesa/state_tracker/st_context.h
> @@ -150,22 +150,20 @@ struct st_context
>            boolean include;
>            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];
> -
>      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;
>      bool compute_shader_may_be_dirty;
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list