for mesa: Fill the padding between entrys in the sampler key
PATCH 1/1 for mesa: Fill the padding between entrys in the sampler key
I thought i'd send this here first, in case someone has something to say about it. Found by valgrind.
Regards,
Pierre
commit 079d2ff410664a1c2c6dc4bf9982d84314734735
Author: Pierre Willenbrock <[email protected]> Date: Sun Apr 25 21:55:48 2010 +0200
Fill the padding between entrys in the sampler key
This struct is used to generate a hash, ignoring the entry boundaries.
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +5 -1
@@ -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;
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Missed a few bits in the last one. Why is it that one finds these things seconds after hitting the send button?
Quoted 5 lines · Pierre Willenbrock
I thought i'd send this here first, in case someone has something to say about it. Found by valgrind.
Regards,
Pierre
commit cb00b1c589933451414977fb7da974a6af8236a7
Author: Pierre Willenbrock <[email protected]> Date: Sun Apr 25 22:00:06 2010 +0200
Fill the padding between entrys in the sampler key
This struct is used to generate a hash, ignoring the entry boundaries.
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +7 -1
@@ -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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx