On 25 August 2013 23:46, Kenneth Graunke <kenn...@whitecape.org> wrote:

> Previously, we allocated space in brw_vs_prog_data's params and
> pull_params arrays for MAX_CLIP_PLANES vec4s---even when it wasn't
> necessary.
>
> On a 64-bit architecture, this used 0.5 kB of space (8 clip planes *
> 4 floats per plane * 8 bytes per float pointer * 2 arrays of pointers =
> 512 bytes).  Since this cost is per-vertex shader, it added up.
>
> Conveniently, we already store the number of clip plane constants in the
> program key.  By using that, we can allocate the exact amount of space
> needed.  For the common case where user clipping is disabled, this means
> 0 bytes.
>
> While we're here, mention exactly what code requires this extra space,
> since it wasn't obvious.
>
> Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
>

Reviewed-by: Paul Berry <stereotype...@gmail.com>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to