On Mon, 2011-03-21 at 19:28 +0100, Tilman Sauerbeck wrote:
> Signed-off-by: Tilman Sauerbeck <til...@code-monkey.de>
> ---
> 
> update_samplers() showed up in a profile of Heroes of Newerth;
> this patch pushes it down the profile by ~3%.
> 
> Does this seem plausible?
> 
>  src/mesa/state_tracker/st_atom_sampler.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_atom_sampler.c 
> b/src/mesa/state_tracker/st_atom_sampler.c
> index 474cbd5..4374ac1 100644
> --- a/src/mesa/state_tracker/st_atom_sampler.c
> +++ b/src/mesa/state_tracker/st_atom_sampler.c
> @@ -129,12 +129,13 @@ update_samplers(struct st_context *st)
>  
>     st->state.num_samplers = 0;
>  
> +   memset(st->state.samplers, 0, st->ctx->Const.MaxTextureImageUnits *
> +          sizeof(struct pipe_sampler_state));
> +

At a glance, could the memset be moved up another couple of lines and
changed to:

 memset(st->state.samplers, 0, st->state.num_samplers * sizeof(struct 
pipe_sampler_state));


Keith


_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to