summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorPierre Willenbrock <[email protected]>2010-04-27 23:16:47 +0200
committerEric Anholt <[email protected]>2010-04-27 17:12:39 -0700
commitda498ef41e88e98e3710d7de5e2488f359196621 (patch)
treee09619f134cac0324ae29d375fb5d8d96f6da9fe /src/mesa/drivers/dri
parentd20fce057ee94fc3441c01a9e54cb5e19f7ddfd3 (diff)
Fill the padding between entrys in the sampler key
This struct is used to generate a hash, ignoring the entry boundaries. Signed-off-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index d7650af3d9d..1582ff1ab65 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -228,6 +228,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
{
GLcontext *ctx = &brw->intel.ctx;
int unit;
+ char *last_entry_end = ((char*)&key->sampler_count) +
+ sizeof(key->sampler_count);
key->sampler_count = 0;
@@ -240,7 +242,9 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
struct gl_texture_image *firstImage =
texObj->Image[0][intelObj->firstLevel];
- memset(entry, 0, sizeof(*entry));
+ memset(last_entry_end, 0,
+ (char*)entry - last_entry_end + sizeof(*entry));
+ last_entry_end = ((char*)entry) + sizeof(*entry);
entry->tex_target = texObj->Target;
@@ -280,6 +284,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw,
key->sampler_count = unit + 1;
}
}
+ struct wm_sampler_entry *entry = &key->sampler[key->sampler_count];
+ memset(last_entry_end, 0, (char*)entry - last_entry_end);
}
/* All samplers must be uploaded in a single contiguous array, which