[Mesa-dev] [PATCH 09/10] mesa: move gl_external_samplers() to program.[ch]

Brian Paul brianp at vmware.com
Wed Jan 17 05:17:13 UTC 2018


The function is only called from a couple places.  It doesn't make
sense to have it in mtypes.h
---
 src/mesa/main/mtypes.h     | 17 -----------------
 src/mesa/program/program.c | 17 +++++++++++++++++
 src/mesa/program/program.h |  5 +++++
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 226eb94..1f1792e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -46,7 +46,6 @@
 #include "compiler/shader_info.h"
 #include "main/formats.h"       /* MESA_FORMAT_COUNT */
 #include "compiler/glsl/list.h"
-#include "util/bitscan.h"
 #include "util/simple_mtx.h"
 #include "util/u_dynarray.h"
 
@@ -2548,22 +2547,6 @@ struct gl_linked_shader
 };
 
 
-static inline GLbitfield
-gl_external_samplers(const struct gl_program *prog)
-{
-   GLbitfield external_samplers = 0;
-   GLbitfield mask = prog->SamplersUsed;
-
-   while (mask) {
-      int idx = u_bit_scan(&mask);
-      if (prog->sh.SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
-         external_samplers |= (1 << idx);
-   }
-
-   return external_samplers;
-}
-
-
 /**
  * Compile status enum. compile_skipped is used to indicate the compile
  * was skipped due to the shader matching one that's been seen before by
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index faf5b7f..220efc3 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -39,6 +39,7 @@
 #include "prog_cache.h"
 #include "prog_parameter.h"
 #include "prog_instruction.h"
+#include "util/bitscan.h"
 #include "util/ralloc.h"
 #include "util/u_atomic.h"
 
@@ -547,3 +548,19 @@ _mesa_get_min_invocations_per_fragment(struct gl_context *ctx,
    }
    return 1;
 }
+
+
+GLbitfield
+gl_external_samplers(const struct gl_program *prog)
+{
+   GLbitfield external_samplers = 0;
+   GLbitfield mask = prog->SamplersUsed;
+
+   while (mask) {
+      int idx = u_bit_scan(&mask);
+      if (prog->sh.SamplerTargets[idx] == TEXTURE_EXTERNAL_INDEX)
+         external_samplers |= (1 << idx);
+   }
+
+   return external_samplers;
+}
diff --git a/src/mesa/program/program.h b/src/mesa/program/program.h
index 0e105c3..376da7b 100644
--- a/src/mesa/program/program.h
+++ b/src/mesa/program/program.h
@@ -158,6 +158,11 @@ _mesa_shader_stage_to_program(unsigned stage)
    return GL_VERTEX_PROGRAM_ARB;
 }
 
+
+GLbitfield
+gl_external_samplers(const struct gl_program *prog);
+
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
-- 
2.7.4



More information about the mesa-dev mailing list