i965: Don't replicate data for zero-stride arrays when copying to VBOs.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Oct 2012 22:48:00 +0000 (15:48 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 1 Nov 2012 02:54:36 +0000 (19:54 -0700)
commit369419e847d4a3aeac9386b13204f09c689900da
treebaad0fb922759751e15922cd31a5e504b47ab598
parent3d2b4291c2e448fd51c14fc1ff52ceaef00788cc
i965: Don't replicate data for zero-stride arrays when copying to VBOs.

When copy_array_to_vbo_array encountered an array with src_stride == 0
and dst_stride != 0, we would replicate out the single element to the
whole size (max - min + 1).  This is unnecessary: we can simply upload
one copy and set the buffer's stride to 0.

Decreases vertex upload overhead in an upcoming Steam for Linux title.
Prior to this patch, copy_array_to_vbo_array appeared very high in the
profile (Eric quoted 20%).  After the patch, it disappeared completely.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_draw_upload.c