[Mesa-dev] [RFC PATCH] gallium: add a common uploader to pipe_context

Brian Paul brianp at vmware.com
Fri Feb 3 20:45:11 UTC 2017

On 02/01/2017 02:23 PM, Brian Paul wrote:
> On 01/27/2017 04:00 AM, Marek Olšák wrote:
>> On Fri, Jan 27, 2017 at 10:05 AM, Nicolai Hähnle <nhaehnle at gmail.com>
>> wrote:
>>> On 27.01.2017 00:51, Marek Olšák wrote:
>>>> From: Marek Olšák <marek.olsak at amd.com>
>>>> For lower memory usage and more efficient updates of the buffer
>>>> residency
>>>> list. (e.g. if drivers keep seeing the same buffer for many consecutive
>>>> "add" calls, the calls can be turned into no-ops trivially)
>>> This makes sense to me, but how are you planning to deal with the bind
>>> flags? They are currently set differently for different upload mgrs. We
>>> should probably do away with them entirely anyway.
>> Drivers can set the bind flags they need. Some drivers will set all 3
>> bind flags. Other drivers don't have to set any.
> I need to look into this part more closely.  I think we may have trouble
> mixing constants with index/vertex data in our VMware driver...


Your patch series, as-is, did indeed cause trouble with our VMware 
driver.  We need to keep constants in a separate buffer.

The good news is I don't think this is a huge problem and I've updated 
(a subset of) your patches to accommodate both your needs and ours.

The basic idea is to add a pipe_context::get_stream_uploader() hook that 
allows drivers to use just one or separate uploaders for 
vertex/index/constant data.  Plus, I added a 
pipe_context::unmap_stream_uploaders() helper, but this isn't strictly 

WIP patch attached (only lightly tested).  Let me know what you think.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: uploader.patch
Type: text/x-patch
Size: 22030 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170203/1f977c76/attachment-0001.bin>

More information about the mesa-dev mailing list