[Mesa-dev] [PATCH 09/30] i965/fs: Reverse inclusion dependency between brw_fs_live_variables.h and brw_fs.h.

Francisco Jerez currojerez at riseup.net
Mon Mar 14 03:47:13 UTC 2016


brw_fs.h (in particular fs_visitor) is logically a user of the live
variables analysis pass, not the other way around.
brw_fs_live_variables.h requires the definition of some FS IR data
structures to compile, but those can be obtained directly from
brw_ir_fs.h without including brw_fs.h.  The dependency of
fs_live_variables on fs_visitor is rather accidental and will be
removed in a future commit, a forward declaration is enough for the
moment.
---
 src/mesa/drivers/dri/i965/brw_fs.h                  | 2 +-
 src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp | 2 +-
 src/mesa/drivers/dri/i965/brw_fs_live_variables.h   | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index d4acc87..3448275 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -30,6 +30,7 @@
 #include "brw_shader.h"
 #include "brw_ir_fs.h"
 #include "brw_fs_builder.h"
+#include "brw_fs_live_variables.h"
 #include "compiler/glsl/ir.h"
 #include "compiler/nir/nir.h"
 
@@ -39,7 +40,6 @@ namespace {
 }
 
 namespace brw {
-   class fs_live_variables;
 }
 
 struct brw_gs_compile;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
index 66b70a9..4ebefe4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp
@@ -25,7 +25,7 @@
  *
  */
 
-#include "brw_cfg.h"
+#include "brw_fs.h"
 #include "brw_fs_live_variables.h"
 
 using namespace brw;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
index a5c1764..6b49cfc 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.h
@@ -28,10 +28,11 @@
 #ifndef BRW_FS_LIVE_VARIABLES_H
 #define BRW_FS_LIVE_VARIABLES_H
 
-#include "brw_fs.h"
+#include "brw_ir_fs.h"
 #include "util/bitset.h"
 
 struct cfg_t;
+class fs_visitor;
 
 namespace brw {
 
-- 
2.7.0



More information about the mesa-dev mailing list