[Mesa-dev] [RFC PATCH] mesa: add support for multiple buffer mappings
Marek Olšák
maraeo at gmail.com
Thu Feb 6 17:17:25 PST 2014
On Thu, Feb 6, 2014 at 11:08 PM, Eric Anholt <eric at anholt.net> wrote:
> Marek Olšák <maraeo at gmail.com> writes:
>
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> OpenGL allows a buffer to be mapped only once, but we also map buffers
>> internally, e.g. in the software primitive restart fallback, for PBOs,
>> vbo_get_minmax_index, etc. This has always been a problem, but it will
>> be a bigger problem with persistent buffer mappings, which will prevent
>> all Mesa functions from mapping buffers for internal purposes.
>>
>> This adds a driver inteface to core Mesa which supports multiple buffer
>> mappings and allows 2 mappings: one for the GL user and one for Mesa.
>>
>> Note that Gallium supports an unlimited number of buffer and texture
>> mappings, so it's not really an issue for Gallium.
>>
>> This is just the interface change. Please review. If you don't like it,
>> feel free to propose how you would do it. Thank you.
>
> Having an index makes sense to me -- you have to either have that in the
> caller, or have the MBR hook return a pointer to private storage that
> gets passed in to Unmap, which sucks more.
>
> My only question is whether we want to make Offset/Length/Pointer be
> GL-only properties that are managed by glMapBuffer() and
> glMapBufferRange() for us, then have drivers like intel store whatever
> the need in their own private area.
Offset/Length/Pointer are used by the vbo module and other code. It's
not easy to get rid of them.
Marek
More information about the mesa-dev
mailing list