i965/fs: Pass the brw_context pointer into fs_visitor explicitly.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 20 Nov 2012 22:46:56 +0000 (14:46 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Nov 2012 03:52:33 +0000 (19:52 -0800)
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@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 638fbed33dcf1879a140a7ac317e1a3fe2eab98a..6b19d1b908e3e08c83866556b0c2ba8262a9e95b 100644 (file)
@@ -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 "
index 850782547488f70952da2f86d6ccc13460fdd197..8225e66eaa83b8ad561a50cb337409048cab7a31 100644 (file)
@@ -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);
index 6408bc8b4454419108d93d7f4a1680e46b02089b..aa1a441a4e479544404f2c8f088685396da979ab 100644 (file)
@@ -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;