[Mesa-dev] [PATCH 08/13] i965: Push down inclusion of brw_program.h.

Matt Turner mattst88 at gmail.com
Mon Nov 23 13:55:37 PST 2015


We were including it in headers, which then caused it to be included in
tons of places it wasn't needed.
---
 src/mesa/drivers/dri/i965/brw_cs.c               | 1 +
 src/mesa/drivers/dri/i965/brw_cs.h               | 2 --
 src/mesa/drivers/dri/i965/brw_fs.cpp             | 1 +
 src/mesa/drivers/dri/i965/brw_fs_generator.cpp   | 1 +
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp         | 1 +
 src/mesa/drivers/dri/i965/brw_gs.c               | 1 +
 src/mesa/drivers/dri/i965/brw_gs.h               | 1 -
 src/mesa/drivers/dri/i965/brw_link.cpp           | 1 +
 src/mesa/drivers/dri/i965/brw_program.c          | 1 +
 src/mesa/drivers/dri/i965/brw_program.h          | 2 ++
 src/mesa/drivers/dri/i965/brw_state_cache.c      | 1 +
 src/mesa/drivers/dri/i965/brw_vec4.h             | 1 -
 src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 1 +
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp       | 1 +
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp   | 1 +
 src/mesa/drivers/dri/i965/brw_vs.c               | 1 +
 src/mesa/drivers/dri/i965/brw_wm.c               | 1 +
 src/mesa/drivers/dri/i965/brw_wm.h               | 1 -
 18 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c
index 263d224..a34c320 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.c
+++ b/src/mesa/drivers/dri/i965/brw_cs.c
@@ -31,6 +31,7 @@
 #include "brw_state.h"
 #include "intel_batchbuffer.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 
 static void
 assign_cs_binding_table_offsets(const struct brw_device_info *devinfo,
diff --git a/src/mesa/drivers/dri/i965/brw_cs.h b/src/mesa/drivers/dri/i965/brw_cs.h
index 899e340..9ce39fb 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.h
+++ b/src/mesa/drivers/dri/i965/brw_cs.h
@@ -25,8 +25,6 @@
 #ifndef BRW_CS_H
 #define BRW_CS_H
 
-#include "brw_program.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 9343dda..4acac7d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -46,6 +46,7 @@
 #include "brw_nir.h"
 #include "brw_vec4_gs_visitor.h"
 #include "brw_cfg.h"
+#include "brw_program.h"
 #include "brw_dead_control_flow.h"
 #include "main/uniforms.h"
 #include "brw_fs_live_variables.h"
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 6493e05..48cb13d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -32,6 +32,7 @@
 #include "brw_eu.h"
 #include "brw_fs.h"
 #include "brw_cfg.h"
+#include "brw_program.h"
 
 static enum brw_reg_file
 brw_file_from_reg(fs_reg *reg)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
index 1e39b39..993367e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp
@@ -30,6 +30,7 @@
 #include "brw_fs_surface_builder.h"
 #include "brw_vec4_gs_visitor.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 
 using namespace brw;
 using namespace brw::surface_access;
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 149b43b..136be68 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -33,6 +33,7 @@
 #include "brw_state.h"
 #include "brw_ff_gs.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 
 static void
 assign_gs_binding_table_offsets(const struct brw_device_info *devinfo,
diff --git a/src/mesa/drivers/dri/i965/brw_gs.h b/src/mesa/drivers/dri/i965/brw_gs.h
index 0c49bb6..13d6be8 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.h
+++ b/src/mesa/drivers/dri/i965/brw_gs.h
@@ -27,7 +27,6 @@
 #include <stdbool.h>
 
 #include "brw_context.h"
-#include "brw_program.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index b3a9747..db0c22e 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -28,6 +28,7 @@
 #include "brw_fs.h"
 #include "brw_cfg.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 #include "glsl/ir_optimization.h"
 #include "glsl/glsl_parser_extras.h"
 #include "main/shaderapi.h"
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index f137c87..0c7692e 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -41,6 +41,7 @@
 #include "util/ralloc.h"
 #include "glsl/ir.h"
 
+#include "brw_program.h"
 #include "brw_context.h"
 #include "brw_shader.h"
 #include "brw_nir.h"
diff --git a/src/mesa/drivers/dri/i965/brw_program.h b/src/mesa/drivers/dri/i965/brw_program.h
index f8cf2b0..339b8e1 100644
--- a/src/mesa/drivers/dri/i965/brw_program.h
+++ b/src/mesa/drivers/dri/i965/brw_program.h
@@ -30,6 +30,8 @@
 extern "C" {
 #endif
 
+struct brw_context;
+
 void brw_setup_tex_for_precompile(struct brw_context *brw,
                                   struct brw_sampler_prog_key_data *tex,
                                   struct gl_program *prog);
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index f7c0a20..cac06fa 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -51,6 +51,7 @@
 #include "brw_wm.h"
 #include "brw_gs.h"
 #include "brw_cs.h"
+#include "brw_program.h"
 
 #define FILE_DEBUG_FLAG DEBUG_STATE
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 3f67432..0754bc7 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -28,7 +28,6 @@
 #include "brw_shader.h"
 #include "main/compiler.h"
 #include "program/hash_table.h"
-#include "brw_program.h"
 
 #ifdef __cplusplus
 #include "brw_ir_vec4.h"
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index c06fb21..eeb7a8a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -23,6 +23,7 @@
 #include "glsl/glsl_parser_extras.h"
 #include "brw_vec4.h"
 #include "brw_cfg.h"
+#include "brw_program.h"
 
 using namespace brw;
 
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index c777acf..05de972 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -25,6 +25,7 @@
 #include "brw_vec4.h"
 #include "brw_vec4_builder.h"
 #include "brw_vec4_surface_builder.h"
+#include "brw_program.h"
 #include "glsl/ir_uniform.h"
 
 using namespace brw;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 04ea177..cb92b4f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -23,6 +23,7 @@
 
 #include "brw_vec4.h"
 #include "brw_cfg.h"
+#include "brw_program.h"
 #include "glsl/ir_uniform.h"
 #include "program/sampler.h"
 
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index 7c783f6..d45347f 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -39,6 +39,7 @@
 #include "program/prog_print.h"
 #include "program/prog_parameter.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 
 #include "util/ralloc.h"
 
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 8d9ed3a..5d0fe82 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -36,6 +36,7 @@
 #include "program/program.h"
 #include "intel_mipmap_tree.h"
 #include "brw_nir.h"
+#include "brw_program.h"
 
 #include "util/ralloc.h"
 
diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h
index 53a642e..35dfa4c 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.h
+++ b/src/mesa/drivers/dri/i965/brw_wm.h
@@ -38,7 +38,6 @@
 #include "program/prog_instruction.h"
 #include "brw_context.h"
 #include "brw_eu.h"
-#include "brw_program.h"
 
 /* A big lookup table is used to figure out which and how many
  * additional regs will inserted before the main payload in the WM
-- 
2.4.9



More information about the mesa-dev mailing list