[Mesa-dev] [PATCH 14/14] i965: Don't store gl_fragment_program in scalar_visitor
Jordan Justen
jordan.l.justen at intel.com
Mon Sep 1 09:44:38 PDT 2014
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 8 ++++++--
src/mesa/drivers/dri/i965/brw_scalar.h | 1 -
src/mesa/drivers/dri/i965/brw_scalar_visitor.cpp | 1 -
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_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 5b684fb..ede7509 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -604,8 +604,12 @@ scalar_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_scalar.h b/src/mesa/drivers/dri/i965/brw_scalar.h
index 13c889b..ff2e27b 100644
--- a/src/mesa/drivers/dri/i965/brw_scalar.h
+++ b/src/mesa/drivers/dri/i965/brw_scalar.h
@@ -481,7 +481,6 @@ public:
void visit_atomic_counter_intrinsic(ir_call *ir);
- struct gl_fragment_program *fp;
const struct brw_scalar_prog_key *const key;
struct brw_scalar_prog_data *prog_data;
unsigned int sanity_param_count;
diff --git a/src/mesa/drivers/dri/i965/brw_scalar_visitor.cpp b/src/mesa/drivers/dri/i965/brw_scalar_visitor.cpp
index 97fcbae..fb272f0 100644
--- a/src/mesa/drivers/dri/i965/brw_scalar_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_scalar_visitor.cpp
@@ -3260,7 +3260,6 @@ scalar_visitor::scalar_visitor(struct brw_context *brw,
key(&key->base), prog_data(&prog_data->base),
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 eed37e4..92b58c2 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 scalar_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;
--
2.1.0
More information about the mesa-dev
mailing list