i965: Remove the dependance on brw_context from the generators
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 16 Apr 2015 21:34:04 +0000 (14:34 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 23 Jun 2015 21:28:08 +0000 (14:28 -0700)
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
src/mesa/drivers/dri/i965/brw_cs.cpp
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp

index 9c0413796163345cc4f589b234ee1003d1e54043..789520c73535214f54d903ecf5711e00f57e2691 100644 (file)
@@ -29,7 +29,7 @@
 brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw,
                                            bool debug_flag)
    : mem_ctx(ralloc_context(NULL)),
-     generator(brw->intelScreen->compiler,
+     generator(brw->intelScreen->compiler, brw,
                mem_ctx, (void *) rzalloc(mem_ctx, struct brw_wm_prog_key),
                (struct brw_stage_prog_data *) rzalloc(mem_ctx, struct brw_wm_prog_data),
                NULL, 0, false, "BLORP")
index f93ca2f7e74a74629feee9a97b7d8c8cd813442c..0833404d5e5c9bcb37e14d1066e28a5bb79d2bf8 100644 (file)
@@ -128,7 +128,7 @@ brw_cs_emit(struct brw_context *brw,
       return NULL;
    }
 
-   fs_generator g(brw->intelScreen->compiler,
+   fs_generator g(brw->intelScreen->compiler, brw,
                   mem_ctx, (void*) key, &prog_data->base, &cp->Base,
                   v8.promoted_constants, v8.runtime_check_aads_emit, "CS");
    if (INTEL_DEBUG & DEBUG_CS) {
index d66378abf2bcdccaab45ebd7a191f7f07751d107..6a02ab9e12be112cc9650fd17b634b583f70af6e 100644 (file)
@@ -4081,7 +4081,7 @@ brw_wm_fs_emit(struct brw_context *brw,
       prog_data->no_8 = false;
    }
 
-   fs_generator g(brw->intelScreen->compiler,
+   fs_generator g(brw->intelScreen->compiler, brw,
                   mem_ctx, (void *) key, &prog_data->base,
                   &fp->Base, v.promoted_constants, v.runtime_check_aads_emit, "FS");
 
index 7414b65222dec28a0b37e2c2706595824d9f1d79..1d52ff0d80d83bab53dbec2c014e64148294286e 100644 (file)
@@ -398,7 +398,7 @@ public:
 class fs_generator
 {
 public:
-   fs_generator(const struct brw_compiler *compiler,
+   fs_generator(const struct brw_compiler *compiler, void *log_data,
                 void *mem_ctx,
                 const void *key,
                 struct brw_stage_prog_data *prog_data,
@@ -494,6 +494,8 @@ private:
    bool patch_discard_jumps_to_fb_writes();
 
    const struct brw_compiler *compiler;
+   void *log_data; /* Passed to compiler->*_log functions */
+
    const struct brw_device_info *devinfo;
 
    struct brw_codegen *p;
index d98a40d2fcead9d95d346bbc9056659c02f839dc..2ed0bac6fd9d520d874f9e9e6122e452e44fe218 100644 (file)
@@ -121,7 +121,7 @@ brw_reg_from_fs_reg(fs_reg *reg)
    return brw_reg;
 }
 
-fs_generator::fs_generator(const struct brw_compiler *compiler,
+fs_generator::fs_generator(const struct brw_compiler *compiler, void *log_data,
                            void *mem_ctx,
                            const void *key,
                            struct brw_stage_prog_data *prog_data,
@@ -130,7 +130,8 @@ fs_generator::fs_generator(const struct brw_compiler *compiler,
                            bool runtime_check_aads_emit,
                            const char *stage_abbrev)
 
-   : compiler(compiler), devinfo(compiler->devinfo), key(key),
+   : compiler(compiler), log_data(log_data),
+     devinfo(compiler->devinfo), key(key),
      prog_data(prog_data),
      prog(prog), promoted_constants(promoted_constants),
      runtime_check_aads_emit(runtime_check_aads_emit), debug_flag(false),
index 5e549c46d6b312706ba421d12307e007bdb3471a..572bc174986e95cd12a38dbe222d792e10f0efe0 100644 (file)
@@ -1910,7 +1910,7 @@ brw_vs_emit(struct brw_context *brw,
          return NULL;
       }
 
-      fs_generator g(brw->intelScreen->compiler,
+      fs_generator g(brw->intelScreen->compiler, brw,
                      mem_ctx, (void *) &c->key, &prog_data->base.base,
                      &c->vp->program.Base, v.promoted_constants,
                      v.runtime_check_aads_emit, "VS");
@@ -1948,7 +1948,7 @@ brw_vs_emit(struct brw_context *brw,
          return NULL;
       }
 
-      vec4_generator g(brw->intelScreen->compiler,
+      vec4_generator g(brw->intelScreen->compiler, brw,
                        prog, &c->vp->program.Base, &prog_data->base,
                        mem_ctx, INTEL_DEBUG & DEBUG_VS, "vertex", "VS");
       assembly = g.generate_assembly(v.cfg, final_assembly_size);
index 067de7537fc924d59b8327dcd39b5f08072de581..2228d478d09708ec6b46555904598970eccac75d 100644 (file)
@@ -427,7 +427,7 @@ private:
 class vec4_generator
 {
 public:
-   vec4_generator(const struct brw_compiler *compiler,
+   vec4_generator(const struct brw_compiler *compiler, void *log_data,
                   struct gl_shader_program *shader_prog,
                   struct gl_program *prog,
                   struct brw_vue_prog_data *prog_data,
@@ -510,6 +510,8 @@ private:
    void generate_unpack_flags(struct brw_reg dst);
 
    const struct brw_compiler *compiler;
+   void *log_data; /* Passed to compiler->*_log functions */
+
    const struct brw_device_info *devinfo;
 
    struct brw_codegen *p;
index c633fe0e130f8de8afba563bd7751907adfb6dfc..d2de2f0be25cfa5cbfbcb10974685e2227cc97ea 100644 (file)
@@ -135,6 +135,7 @@ vec4_instruction::get_src(const struct brw_vue_prog_data *prog_data, int i)
 }
 
 vec4_generator::vec4_generator(const struct brw_compiler *compiler,
+                               void *log_data,
                                struct gl_shader_program *shader_prog,
                                struct gl_program *prog,
                                struct brw_vue_prog_data *prog_data,
@@ -142,7 +143,7 @@ vec4_generator::vec4_generator(const struct brw_compiler *compiler,
                                bool debug_flag,
                                const char *stage_name,
                                const char *stage_abbrev)
-   : compiler(compiler), devinfo(compiler->devinfo),
+   : compiler(compiler), log_data(log_data), devinfo(compiler->devinfo),
      shader_prog(shader_prog), prog(prog), prog_data(prog_data),
      mem_ctx(mem_ctx), stage_name(stage_name), stage_abbrev(stage_abbrev),
      debug_flag(debug_flag)
index 82b8e08398b373f6394a57523a2d1f5f21d46c16..b047aa18e0adad6fbf3a7399b68276c1a9886c45 100644 (file)
@@ -629,7 +629,7 @@ generate_assembly(struct brw_context *brw,
                   const cfg_t *cfg,
                   unsigned *final_assembly_size)
 {
-   vec4_generator g(brw->intelScreen->compiler,
+   vec4_generator g(brw->intelScreen->compiler, brw,
                     shader_prog, prog, prog_data, mem_ctx,
                     INTEL_DEBUG & DEBUG_GS, "geometry", "GS");
    return g.generate_assembly(cfg, final_assembly_size);