Mesa (master): i965/fs: Pass the brw_context pointer into fs_visitor explicitly.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Nov 27 04:48:54 UTC 2012


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Nov 20 14:46:56 2012 -0800

i965/fs: Pass the brw_context pointer into fs_visitor explicitly.

We used to steal it out of the brw_compile struct...but fs_visitor
isn't going to have one of those in the future.

Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp         |    4 ++--
 src/mesa/drivers/dri/i965/brw_fs.h           |    3 ++-
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    5 +++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 638fbed..6b19d1b 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2178,7 +2178,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
 
    /* Now the main event: Visit the shader IR and generate our FS IR for it.
     */
-   fs_visitor v(c, prog, fp, 8);
+   fs_visitor v(brw, c, prog, fp, 8);
    if (!v.run()) {
       prog->LinkStatus = false;
       ralloc_strcat(&prog->InfoLog, v.fail_msg);
@@ -2190,7 +2190,7 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c,
    }
 
    if (intel->gen >= 5 && c->prog_data.nr_pull_params == 0) {
-      fs_visitor v2(c, prog, fp, 16);
+      fs_visitor v2(brw, c, prog, fp, 16);
       v2.import_uniforms(&v);
       if (!v2.run()) {
          perf_debug("16-wide shader failed to compile, falling back to "
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 8507825..8225e66 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -184,7 +184,8 @@ class fs_visitor : public backend_visitor
 {
 public:
 
-   fs_visitor(struct brw_wm_compile *c,
+   fs_visitor(struct brw_context *brw,
+              struct brw_wm_compile *c,
               struct gl_shader_program *prog,
               struct gl_fragment_program *fp,
               unsigned dispatch_width);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 6408bc8..aa1a441 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -2174,7 +2174,8 @@ fs_visitor::resolve_bool_comparison(ir_rvalue *rvalue, fs_reg *reg)
    *reg = temp;
 }
 
-fs_visitor::fs_visitor(struct brw_wm_compile *c,
+fs_visitor::fs_visitor(struct brw_context *brw,
+                       struct brw_wm_compile *c,
                        struct gl_shader_program *prog,
                        struct gl_fragment_program *fp,
                        unsigned dispatch_width)
@@ -2182,7 +2183,7 @@ fs_visitor::fs_visitor(struct brw_wm_compile *c,
 {
    this->c = c;
    this->p = &c->func;
-   this->brw = p->brw;
+   this->brw = brw;
    this->fp = fp;
    this->prog = prog;
    this->intel = &brw->intel;




More information about the mesa-commit mailing list