[Mesa-dev] [PATCH 02/14] st/mesa: add a simple path to BufferData if it only discards buffer contents

Marek Olšák maraeo at gmail.com
Fri Apr 19 05:08:34 PDT 2013


That's not true. PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE does not copy
data in radeon drivers. It really does what st/mesa does - it creates
a new buffer and throws away the old one, which doesn't take any GPU
bandwidth. Doing that at a lower level should be faster in theory (+
drivers have multiple options how to implement the discarding).

Only PIPE_TRANSFER_DISCARD_RANGE copies data in radeon drivers, which
is not used here.

Marek

On Wed, Apr 17, 2013 at 8:15 PM, Eric Anholt <eric at anholt.net> wrote:
> Marek Olšák <maraeo at gmail.com> writes:
>
>> The next patch makes sure _NEW_BUFFER_OBJECT is not needlessly set
>> for this code.
>
> This seems like a pretty dubious optimization -- on UMA systems you're
> increasing the memory bandwidth usage in the "&& data" case, and only
> trying to eliminate update_array_object_max_element, which also happens
> with _NEW_PROGRAM (I bet it's true every time that a _NEW_BUFFER_OBJECT
> was flagged, anyway).
>
> In short, for the Mesa core change, I'd like to see some actual
> performance justification on this one.


More information about the mesa-dev mailing list