diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2014-08-29 12:50:46 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2014-09-06 11:17:53 -0700 |
commit | dc0bd799cabdd974b05bd217304944392169fb50 (patch) | |
tree | 5b0a4ce465a11c38196eaac32451579f80d39d65 /src/mesa | |
parent | 0feb977bbfb0d6bb2c8d3178246acb035a739f37 (diff) |
i965/fs: Remove direct fs_visitor gl_fragment_program dependence
Instead we cast backend_visitor::prog for fragment shader specific code paths.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_iz.cpp | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 502e6c74187..d40a2e38f82 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -469,7 +469,6 @@ public: void visit_atomic_counter_intrinsic(ir_call *ir); - struct gl_fragment_program *fp; const struct brw_wm_prog_key *const key; struct brw_wm_prog_data *prog_data; unsigned int sanity_param_count; diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp index 4db3f1697e7..526c8171ff0 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp @@ -602,8 +602,12 @@ fs_visitor::setup_fp_regs() switch (i) { case VARYING_SLOT_POS: - ir->data.pixel_center_integer = fp->PixelCenterInteger; - ir->data.origin_upper_left = fp->OriginUpperLeft; + { + assert(stage == MESA_SHADER_FRAGMENT); + gl_fragment_program *fp = (gl_fragment_program*) prog; + ir->data.pixel_center_integer = fp->PixelCenterInteger; + ir->data.origin_upper_left = fp->OriginUpperLeft; + } fp_input_regs[i] = *emit_fragcoord_interpolation(ir); break; case VARYING_SLOT_FACE: diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 7ec8fd8aaa3..2a097f6588a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -3267,7 +3267,6 @@ fs_visitor::fs_visitor(struct brw_context *brw, key(key), prog_data(prog_data), dispatch_width(dispatch_width) { - this->fp = fp; this->mem_ctx = mem_ctx; init(); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.cpp b/src/mesa/drivers/dri/i965/brw_wm_iz.cpp index 0a639f176e1..47823a764de 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_iz.cpp +++ b/src/mesa/drivers/dri/i965/brw_wm_iz.cpp @@ -125,6 +125,8 @@ void fs_visitor::setup_payload_gen4() GLuint reg = 2; bool kill_stats_promoted_workaround = false; int lookup = key->iz_lookup; + assert(stage == MESA_SHADER_FRAGMENT); + gl_fragment_program *fp = (gl_fragment_program*) prog; bool uses_depth = (fp->Base.InputsRead & (1 << VARYING_SLOT_POS)) != 0; |