diff options
author | Kenneth Graunke <[email protected]> | 2012-11-26 22:14:27 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-11-28 18:15:50 -0800 |
commit | 403bb1d306c5bc23ad9e2c26fd39071e6e41f665 (patch) | |
tree | 88a80ec00823edfd9e314595985836bd929520ec | |
parent | dd50c88386c8220f4631115b68a10930378ead6c (diff) |
i965/vs: Pass the brw_context pointer into vec4_visitor and do_vs_prog.
We used to steal it out of the brw_compile struct...but vec4_visitor
isn't going to have one of those in the future.
Reviewed-by: Eric Anholt <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.cpp | 9 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vs.h | 4 |
5 files changed, 14 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index 227accae45f..d203ca90765 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -1128,10 +1128,11 @@ vec4_visitor::run() extern "C" { bool -brw_vs_emit(struct gl_shader_program *prog, struct brw_vs_compile *c) +brw_vs_emit(struct brw_context *brw, + struct gl_shader_program *prog, + struct brw_vs_compile *c) { - struct brw_context *brw = c->func.brw; - struct intel_context *intel = &c->func.brw->intel; + struct intel_context *intel = &brw->intel; bool start_busy = false; float start_time = 0; @@ -1168,7 +1169,7 @@ brw_vs_emit(struct gl_shader_program *prog, struct brw_vs_compile *c) shader->compiled_once = true; } - vec4_visitor v(c, prog, shader); + vec4_visitor v(brw, c, prog, shader); if (!v.run()) { prog->LinkStatus = false; ralloc_strcat(&prog->InfoLog, v.fail_msg); diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h index 908d7d8825d..f474b0f7621 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.h +++ b/src/mesa/drivers/dri/i965/brw_vec4.h @@ -198,7 +198,8 @@ public: class vec4_visitor : public backend_visitor { public: - vec4_visitor(struct brw_vs_compile *c, + vec4_visitor(struct brw_context *brw, + struct brw_vs_compile *c, struct gl_shader_program *prog, struct brw_shader *shader); ~vec4_visitor(); diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index edb66ea7d8e..982b74c19ec 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2806,13 +2806,14 @@ vec4_visitor::resolve_ud_negate(src_reg *reg) *reg = temp; } -vec4_visitor::vec4_visitor(struct brw_vs_compile *c, +vec4_visitor::vec4_visitor(struct brw_context *brw, + struct brw_vs_compile *c, struct gl_shader_program *prog, struct brw_shader *shader) { this->c = c; this->p = &c->func; - this->brw = p->brw; + this->brw = brw; this->intel = &brw->intel; this->ctx = &intel->ctx; this->prog = prog; diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index 232600aece7..8cced4be733 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -280,7 +280,7 @@ do_vs_prog(struct brw_context *brw, /* Emit GEN4 code. */ - if (!brw_vs_emit(prog, &c)) { + if (!brw_vs_emit(brw, prog, &c)) { ralloc_free(mem_ctx); return false; } diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h index 279c18fab0b..2c085474733 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.h +++ b/src/mesa/drivers/dri/i965/brw_vs.h @@ -103,7 +103,9 @@ struct brw_vs_compile { GLuint last_scratch; /**< measured in 32-byte (register size) units */ }; -bool brw_vs_emit(struct gl_shader_program *prog, struct brw_vs_compile *c); +bool brw_vs_emit(struct brw_context *brw, + struct gl_shader_program *prog, + struct brw_vs_compile *c); bool brw_vs_precompile(struct gl_context *ctx, struct gl_shader_program *prog); void brw_vs_debug_recompile(struct brw_context *brw, struct gl_shader_program *prog, |