aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2012-08-14 11:05:55 -0700
committerKenneth Graunke <[email protected]>2012-08-25 12:01:09 -0700
commit76d1301e8e8e50dc962601a9977bc52148798349 (patch)
tree922c501d8a7288d37c3138ad4b44b91e462f1b62
parentf510dd5d60401ee44512ba7ae4ded3b32b19f12d (diff)
i965: Set SWIZZLE_NOOP for unused texture units in the program keys.
Previously, we left the swizzle key field as zero for unused texture units. The precompile sets all of them to SWIZZLE_NOOP, which meant that we mismatched almost every time. Since either works equally well, change it to SWIZZLE_NOOP to match the precompiles. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 6e5163b4af3..ba6f8740e87 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -437,6 +437,8 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,
struct brw_sampler_prog_key_data *key)
{
for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) {
+ key->swizzles[i] = SWIZZLE_NOOP;
+
if (!prog->TexturesUsed[i])
continue;
@@ -512,9 +514,6 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,
key->gl_clamp_mask[2] |= 1 << i;
}
}
- else {
- key->swizzles[i] = SWIZZLE_NOOP;
- }
}
}