summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-04-27 21:50:20 -0700
committerEric Anholt <[email protected]>2011-05-31 12:07:28 -0700
commit3412069e23b7fa5656262f3dd1aa86f66980594d (patch)
tree9b85e44b7c48f0f46f164e336a77610865b15709 /src/mesa
parentbcbb1a536f7b6f00bbb164bd14d9f63102b9a8af (diff)
i965: Don't compute brw->wm.input_size_masks when it's unused.
It's only used in the old fragment program path, to avoid projection when w is always 1. We do want to do this in the new path pre-gen6 too, but we'll probably do it through the ir. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_constval.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c
index 47cc0a7da7a..9fdfebe9f76 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_constval.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c
@@ -194,11 +194,19 @@ static void calc_wm_input_sizes( struct brw_context *brw )
/* BRW_NEW_VERTEX_PROGRAM */
const struct brw_vertex_program *vp =
brw_vertex_program_const(brw->vertex_program);
+ /* BRW_NEW_FRAGMENT_PROGRAM */
+ struct gl_shader_program *prog = ctx->Shader.CurrentFragmentProgram;
/* BRW_NEW_INPUT_DIMENSIONS */
struct tracker t;
GLuint insn;
GLuint i;
+ /* If we're going to go through brw_fs.cpp, we don't end up using
+ * brw->wm.input_size_masks.
+ */
+ if (prog && prog->_LinkedShaders[MESA_SHADER_FRAGMENT])
+ return;
+
memset(&t, 0, sizeof(t));
/* _NEW_LIGHT */
@@ -238,7 +246,9 @@ static void calc_wm_input_sizes( struct brw_context *brw )
const struct brw_tracked_state brw_wm_input_sizes = {
.dirty = {
.mesa = _NEW_LIGHT,
- .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_INPUT_DIMENSIONS,
+ .brw = (BRW_NEW_FRAGMENT_PROGRAM |
+ BRW_NEW_VERTEX_PROGRAM |
+ BRW_NEW_INPUT_DIMENSIONS),
.cache = 0
},
.prepare = calc_wm_input_sizes