mesa/st: move msaa functions to direct call
authorDave Airlie <airlied@redhat.com>
Tue, 7 Dec 2021 02:55:27 +0000 (12:55 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Dec 2021 19:06:48 +0000 (19:06 +0000)
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14100>

src/mesa/main/dd.h
src/mesa/main/get.c
src/mesa/main/multisample.c
src/mesa/state_tracker/st_cb_msaa.c
src/mesa/state_tracker/st_cb_msaa.h
src/mesa/state_tracker/st_context.c

index da52e1b..80e7ad5 100644 (file)
@@ -273,15 +273,6 @@ struct dd_function_table {
    /*@}*/
 
    /**
-    * \name Functions for GL_ARB_sample_locations
-    */
-   void (*GetProgrammableSampleCaps)(struct gl_context *ctx,
-                                     const struct gl_framebuffer *fb,
-                                     GLuint *bits, GLuint *width, GLuint *height);
-
-   /*@}*/
-
-   /**
     * \name GREMEDY debug/marker functions
     */
    /*@{*/
@@ -326,14 +317,6 @@ struct dd_function_table {
    /**@}*/
 
    /**
-    * \name GL_ARB_texture_multisample
-    */
-   void (*GetSamplePosition)(struct gl_context *ctx,
-                             struct gl_framebuffer *fb,
-                             GLuint index,
-                             GLfloat *outValue);
-
-   /**
     * \name NV_vdpau_interop interface
     */
    void (*VDPAUMapSurface)(struct gl_context *ctx, GLenum target,
index 0fb3d2d..8bdd07e 100644 (file)
@@ -44,6 +44,7 @@
 #include "version.h"
 
 #include "state_tracker/st_cb_queryobj.h"
+#include "state_tracker/st_cb_msaa.h"
 #include "state_tracker/st_context.h"
 
 /* This is a table driven implemetation of the glGet*v() functions.
@@ -1314,8 +1315,8 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
             break;
          }
 
-         ctx->Driver.GetProgrammableSampleCaps(ctx, ctx->DrawBuffer,
-                                               &bits, &width, &height);
+         st_GetProgrammableSampleCaps(ctx, ctx->DrawBuffer,
+                                      &bits, &width, &height);
 
          if (d->pname == GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB)
             v->value_uint = width;
index 33731e1..0dbf374 100644 (file)
@@ -33,6 +33,7 @@
 #include "main/state.h"
 
 #include "state_tracker/st_format.h"
+#include "state_tracker/st_cb_msaa.h"
 
 /**
  * Called via glSampleCoverageARB
@@ -95,7 +96,7 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
          return;
       }
 
-      ctx->Driver.GetSamplePosition(ctx, ctx->DrawBuffer, index, val);
+      st_GetSamplePosition(ctx, ctx->DrawBuffer, index, val);
 
       /* FBOs can be upside down (winsys always are)*/
       if (ctx->DrawBuffer->FlipY)
index fef3b7d..b85c9d8 100644 (file)
@@ -37,7 +37,7 @@
 #include "pipe/p_context.h"
 
 
-static void
+void
 st_GetSamplePosition(struct gl_context *ctx,
                      struct gl_framebuffer *fb,
                      GLuint index,
@@ -56,7 +56,7 @@ st_GetSamplePosition(struct gl_context *ctx,
 }
 
 
-static void
+void
 st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer *fb,
                              GLuint *outBits, GLuint *outWidth, GLuint *outHeight)
 {
@@ -81,10 +81,3 @@ st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer
       *outHeight = 1;
    }
 }
-
-void
-st_init_msaa_functions(struct dd_function_table *functions)
-{
-   functions->GetSamplePosition = st_GetSamplePosition;
-   functions->GetProgrammableSampleCaps = st_GetProgrammableSampleCaps;
-}
index ba4c06f..d901a8d 100644 (file)
 
 #include "main/glheader.h"
 
-struct dd_function_table;
-
-extern void
-st_init_msaa_functions(struct dd_function_table *functions);
-
+void st_GetSamplePosition(struct gl_context *ctx,
+                          struct gl_framebuffer *fb,
+                          GLuint index,
+                          GLfloat *outPos);
+void st_GetProgrammableSampleCaps(struct gl_context *ctx, const struct gl_framebuffer *fb,
+                                  GLuint *outBits, GLuint *outWidth, GLuint *outHeight);
 #endif
index 75b8c2c..26bdc0d 100644 (file)
@@ -51,7 +51,6 @@
 #include "st_cb_drawtex.h"
 #include "st_cb_eglimage.h"
 #include "st_cb_feedback.h"
-#include "st_cb_msaa.h"
 #include "st_cb_perfmon.h"
 #include "st_cb_perfquery.h"
 #include "st_cb_program.h"
@@ -924,7 +923,6 @@ st_init_driver_functions(struct pipe_screen *screen,
 
    st_init_eglimage_functions(functions, has_egl_image_validate);
 
-   st_init_msaa_functions(functions);
    st_init_program_functions(functions);
    st_init_flush_functions(screen, functions);
    st_init_compute_functions(functions);