OSDN Git Service

gallium/u_vbuf: use signed vertex buffers offsets for optimal uploads
authorMarek Olšák <marek.olsak@amd.com>
Thu, 26 Oct 2017 01:17:29 +0000 (03:17 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 6 Nov 2017 18:09:12 +0000 (19:09 +0100)
commit71f5fe36b7f4f092398d27a130ef18b7e0913889
treef9ab4e6ee98b5fd277e5d775108376c26aae373a
parent3f58988b81965fc70fe8770b4d8912cf12f0a6f1
gallium/u_vbuf: use signed vertex buffers offsets for optimal uploads

Uploaded data must start at (stride * start), because we can't modify
start in all cases. If it's the first allocation, it's also the amount
of memory wasted. If the starting offset is larger than the size of
the upload buffer, the buffer is re-created, used for 1 upload, and then
thrown away. If the upload is small, most of the buffer space is unused
and wasted. Keep doing that and the OOM killer comes. It's actually
pretty quick.

With signed VB offsets, we can set min_out_offset = 0
in u_upload_alloc/u_upload_data.

This fixes OOM situations with SPECviewperf.
src/gallium/auxiliary/util/u_vbuf.c