Mesa (main): mesa/dd/st: move get strings pointer out of dd.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 7 13:47:27 UTC 2021


Module: Mesa
Branch: main
Commit: 0d8610b0994655930e26f6b63f01332e85d964ab
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d8610b0994655930e26f6b63f01332e85d964ab

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Dec  6 14:25:55 2021 +1000

mesa/dd/st: move get strings pointer out of dd.h

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14073>

---

 src/mesa/main/dd.h                     | 7 -------
 src/mesa/main/getstring.c              | 4 ++--
 src/mesa/state_tracker/st_cb_strings.c | 7 +------
 src/mesa/state_tracker/st_cb_strings.h | 9 ++-------
 src/mesa/state_tracker/st_context.c    | 2 --
 5 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index fd1da24a9a9..3e99acc16c6 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -114,13 +114,6 @@ struct pipe_vertex_element;
  * file should be updated too!!!
  */
 struct dd_function_table {
-   /**
-    * Return a string as needed by glGetString().
-    * Only the GL_RENDERER query must be implemented.  Otherwise, NULL can be
-    * returned.
-    */
-   const GLubyte * (*GetString)( struct gl_context *ctx, GLenum name );
-
    /**
     * Notify the driver after Mesa has made some internal state changes.  
     *
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 272482391a6..87af36d469f 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -35,6 +35,7 @@
 #include "version.h"
 #include "spirv_extensions.h"
 
+#include "state_tracker/st_cb_strings.h"
 /**
  * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
  */
@@ -133,10 +134,9 @@ _mesa_GetString( GLenum name )
    }
 
    /* this is a required driver function */
-   assert(ctx->Driver.GetString);
    {
       /* Give the driver the chance to handle this query */
-      const GLubyte *str = ctx->Driver.GetString(ctx, name);
+      const GLubyte *str = st_get_string(ctx, name);
       if (str)
          return str;
    }
diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
index 5c21f493284..9b14d43942d 100644
--- a/src/mesa/state_tracker/st_cb_strings.c
+++ b/src/mesa/state_tracker/st_cb_strings.c
@@ -39,7 +39,7 @@
 #include "st_context.h"
 #include "st_cb_strings.h"
 
-static const GLubyte *
+const GLubyte *
 st_get_string(struct gl_context * ctx, GLenum name)
 {
    struct st_context *st = st_context(ctx);
@@ -58,8 +58,3 @@ st_get_string(struct gl_context * ctx, GLenum name)
    }
 }
 
-
-void st_init_string_functions(struct dd_function_table *functions)
-{
-   functions->GetString = st_get_string;
-}
diff --git a/src/mesa/state_tracker/st_cb_strings.h b/src/mesa/state_tracker/st_cb_strings.h
index 64d7ed1033f..2457adefd65 100644
--- a/src/mesa/state_tracker/st_cb_strings.h
+++ b/src/mesa/state_tracker/st_cb_strings.h
@@ -29,12 +29,7 @@
 #ifndef ST_CB_STRINGS_H
 #define ST_CB_STRINGS_H
 
+const GLubyte *st_get_string(struct gl_context * ctx, GLenum name);
 
-struct dd_function_table;
-
-extern void
-st_init_string_functions(struct dd_function_table *functions);
-
-
-#endif /* ST_CB_CLEAR_H */
+#endif /* ST_CB_STRINGS_H */
 
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index d662de659e8..de76577b3a0 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -67,7 +67,6 @@
 #include "st_cb_xformfb.h"
 #include "st_cb_flush.h"
 #include "st_cb_syncobj.h"
-#include "st_cb_strings.h"
 #include "st_cb_texturebarrier.h"
 #include "st_cb_viewport.h"
 #include "st_atom.h"
@@ -969,7 +968,6 @@ st_init_driver_functions(struct pipe_screen *screen,
    st_init_texture_functions(functions);
    st_init_texture_barrier_functions(functions);
    st_init_flush_functions(screen, functions);
-   st_init_string_functions(functions);
    st_init_viewport_functions(functions);
    st_init_compute_functions(functions);
 



More information about the mesa-commit mailing list