[Mesa-dev] [PATCH 04/65] i965: Move brw_query_samples_for_format() to brw_queryformat.c

Eduardo Lima Mitev elima at igalia.com
Wed Feb 3 15:44:49 UTC 2016


Now that there is a dedicated source file for internal format queries, this
function belongs there.
---
 src/mesa/drivers/dri/i965/brw_context.c     | 38 ----------------------------
 src/mesa/drivers/dri/i965/brw_context.h     |  2 ++
 src/mesa/drivers/dri/i965/brw_formatquery.c | 39 +++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 38 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 5f25707..0f79e25 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -75,44 +75,6 @@
  * Mesa's Driver Functions
  ***************************************/
 
-static size_t
-brw_query_samples_for_format(struct gl_context *ctx, GLenum target,
-                             GLenum internalFormat, int samples[16])
-{
-   struct brw_context *brw = brw_context(ctx);
-
-   (void) target;
-
-   switch (brw->gen) {
-   case 9:
-      samples[0] = 16;
-      samples[1] = 8;
-      samples[2] = 4;
-      samples[3] = 2;
-      return 4;
-
-   case 8:
-      samples[0] = 8;
-      samples[1] = 4;
-      samples[2] = 2;
-      return 3;
-
-   case 7:
-      samples[0] = 8;
-      samples[1] = 4;
-      return 2;
-
-   case 6:
-      samples[0] = 4;
-      return 1;
-
-   default:
-      assert(brw->gen < 6);
-      samples[0] = 1;
-      return 1;
-   }
-}
-
 const char *const brw_vendor_string = "Intel Open Source Technology Center";
 
 const char *
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 3df6ed0..8ab63ca 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1875,6 +1875,8 @@ void gen7_emit_vs_workaround_flush(struct brw_context *brw);
 void gen7_emit_cs_stall_flush(struct brw_context *brw);
 
 /* brw_queryformat.c */
+size_t brw_query_samples_for_format(struct gl_context *ctx, GLenum target,
+                                    GLenum internalFormat, int samples[16]);
 void brw_query_internal_format(struct gl_context *ctx, GLenum target,
                                GLenum internalFormat, GLenum pname,
                                GLint *params);
diff --git a/src/mesa/drivers/dri/i965/brw_formatquery.c b/src/mesa/drivers/dri/i965/brw_formatquery.c
index ad59f03..5ee1d69 100644
--- a/src/mesa/drivers/dri/i965/brw_formatquery.c
+++ b/src/mesa/drivers/dri/i965/brw_formatquery.c
@@ -24,6 +24,45 @@
 #include "brw_context.h"
 #include "main/formatquery.h"
 
+size_t
+brw_query_samples_for_format(struct gl_context *ctx, GLenum target,
+                             GLenum internalFormat, int samples[16])
+{
+   struct brw_context *brw = brw_context(ctx);
+
+   (void) target;
+   (void) internalFormat;
+
+   switch (brw->gen) {
+   case 9:
+      samples[0] = 16;
+      samples[1] = 8;
+      samples[2] = 4;
+      samples[3] = 2;
+      return 4;
+
+   case 8:
+      samples[0] = 8;
+      samples[1] = 4;
+      samples[2] = 2;
+      return 3;
+
+   case 7:
+      samples[0] = 8;
+      samples[1] = 4;
+      return 2;
+
+   case 6:
+      samples[0] = 4;
+      return 1;
+
+   default:
+      assert(brw->gen < 6);
+      samples[0] = 1;
+      return 1;
+   }
+}
+
 void
 brw_query_internal_format(struct gl_context *ctx, GLenum target,
                           GLenum internalFormat, GLenum pname, GLint *params)
-- 
2.5.3



More information about the mesa-dev mailing list