[Mesa-dev] [PATCH 11/17] Modified _mesa_buffer_data to use _mesa_align_malloc.

Brian Paul brian.e.paul at gmail.com
Wed Nov 27 06:03:53 PST 2013


On Tue, Nov 26, 2013 at 11:34 AM, Siavash Eliasi <siavashserver at gmail.com>wrote:

> Now I understand why _mesa_realloc is not appropriate to use here. From
> spec:
>
>  glBufferData creates a new data store for the buffer object currently
>> bound to target. Any pre-existing data store is deleted. The new data store
>> is created with the specified size in bytes and usage.
>> If data is NULL, a data store of the specified size is still created, but
>> its contents remain uninitialized and thus undefined.
>>
>
>
> Best regards,
> Siavash Eliasi.
>
>
> On 11/26/2013 09:34 AM, Siavash Eliasi wrote:
>
>> Yes I think you are right, I guess *_mesa_align_realloc* is the correct
>> function which should be used here.
>>
>> What do you think Ian?
>>
>>
>> Best regards,
>> Siavash Eliasi.
>>
>
Realloc was a poor choice in the first place.  It would needlessly copy
data from the old buffer to the new one.

-Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131127/c0e9ef66/attachment-0001.html>


More information about the mesa-dev mailing list