summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2011-12-08 12:15:59 -0800
committerKenneth Graunke <[email protected]>2011-12-19 16:33:10 -0800
commit387a3d43d11cbd3eb1bd8ce787a2c693d575300c (patch)
tree727b255414d7dfce12edda1937872063b48633cc /src/mesa/drivers/dri/i965
parent1b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72 (diff)
i965/fs: Only set brw_wm_prog_key data for samplers used by the WM.
This should avoid state-dependent FS recompiles when samplers that are only used by the VS change. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index f23edfa798b..cad0af8c1ac 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -412,6 +412,7 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* BRW_NEW_FRAGMENT_PROGRAM */
const struct brw_fragment_program *fp =
(struct brw_fragment_program *)brw->fragment_program;
+ const struct gl_program *prog = (struct gl_program *) brw->fragment_program;
GLuint lookup = 0;
GLuint line_aa;
GLuint i;
@@ -487,7 +488,8 @@ static void brw_wm_populate_key( struct brw_context *brw,
/* _NEW_TEXTURE */
for (i = 0; i < BRW_MAX_TEX_UNIT; i++) {
- brw_populate_sampler_prog_key_data(ctx, &key->tex, i);
+ if (prog->TexturesUsed[i])
+ brw_populate_sampler_prog_key_data(ctx, &key->tex, i);
}
/* _NEW_BUFFERS */