[Mesa-dev] [RFC PATCH] mesa: add support for multiple buffer mappings

Eric Anholt eric at anholt.net
Thu Feb 6 14:08:31 PST 2014


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.

Only thing I'd definitely do here is
s/gl_map_buffer_context/gl_buffer_mapping/ or something -- context
sounds weird to describe that set of state.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140206/6901febc/attachment.pgp>


More information about the mesa-dev mailing list