Mesa (master): radeonsi: clean up lucky #include dependencies

Marek Olšák mareko at kemper.freedesktop.org
Tue Oct 4 14:13:48 UTC 2016


Module: Mesa
Branch: master
Commit: 3388f27d8439e75a0f4e64fd12f0433ccb2b3698
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3388f27d8439e75a0f4e64fd12f0433ccb2b3698

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Oct  2 17:40:49 2016 +0200

radeonsi: clean up lucky #include dependencies

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

---

 src/gallium/drivers/radeonsi/si_pipe.h   | 37 ++++++++++++++++++++++++++++----
 src/gallium/drivers/radeonsi/si_shader.h | 34 ++---------------------------
 2 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 55e4ca7..558e185 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -26,10 +26,7 @@
 #ifndef SI_PIPE_H
 #define SI_PIPE_H
 
-#include "si_state.h"
-#include "util/u_queue.h"
-
-#include <llvm-c/TargetMachine.h>
+#include "si_shader.h"
 
 #ifdef PIPE_ARCH_BIG_ENDIAN
 #define SI_BIG_ENDIAN 1
@@ -444,4 +441,36 @@ si_mark_atom_dirty(struct si_context *sctx,
 	si_set_atom_dirty(sctx, atom, true);
 }
 
+static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx)
+{
+	if (sctx->gs_shader.cso)
+		return &sctx->gs_shader.cso->info;
+	else if (sctx->tes_shader.cso)
+		return &sctx->tes_shader.cso->info;
+	else if (sctx->vs_shader.cso)
+		return &sctx->vs_shader.cso->info;
+	else
+		return NULL;
+}
+
+static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
+{
+	if (sctx->gs_shader.current)
+		return sctx->gs_shader.current->gs_copy_shader;
+	else if (sctx->tes_shader.current)
+		return sctx->tes_shader.current;
+	else
+		return sctx->vs_shader.current;
+}
+
+static inline bool si_vs_exports_prim_id(struct si_shader *shader)
+{
+	if (shader->selector->type == PIPE_SHADER_VERTEX)
+		return shader->key.vs.epilog.export_prim_id;
+	else if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
+		return shader->key.tes.epilog.export_prim_id;
+	else
+		return false;
+}
+
 #endif
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index de4705d..67cb67d2 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -69,7 +69,9 @@
 #define SI_SHADER_H
 
 #include <llvm-c/Core.h> /* LLVMModuleRef */
+#include <llvm-c/TargetMachine.h>
 #include "tgsi/tgsi_scan.h"
+#include "util/u_queue.h"
 #include "si_state.h"
 
 struct radeon_shader_binary;
@@ -456,38 +458,6 @@ struct si_shader_part {
 	struct si_shader_config config;
 };
 
-static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx)
-{
-	if (sctx->gs_shader.cso)
-		return &sctx->gs_shader.cso->info;
-	else if (sctx->tes_shader.cso)
-		return &sctx->tes_shader.cso->info;
-	else if (sctx->vs_shader.cso)
-		return &sctx->vs_shader.cso->info;
-	else
-		return NULL;
-}
-
-static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
-{
-	if (sctx->gs_shader.current)
-		return sctx->gs_shader.current->gs_copy_shader;
-	else if (sctx->tes_shader.current)
-		return sctx->tes_shader.current;
-	else
-		return sctx->vs_shader.current;
-}
-
-static inline bool si_vs_exports_prim_id(struct si_shader *shader)
-{
-	if (shader->selector->type == PIPE_SHADER_VERTEX)
-		return shader->key.vs.epilog.export_prim_id;
-	else if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
-		return shader->key.tes.epilog.export_prim_id;
-	else
-		return false;
-}
-
 /* si_shader.c */
 int si_compile_tgsi_shader(struct si_screen *sscreen,
 			   LLVMTargetMachineRef tm,




More information about the mesa-commit mailing list