[Mesa-dev] [PATCH] Add missing map range bits to the state tracker.

Jose Fonseca jfonseca at vmware.com
Mon Nov 29 02:26:25 PST 2010


GL_MAP_INVALIDATE_BUFFER_BIT corresponds to recreating the buffer if it's busy. The right implementation in gallium would be:
- try mapping the whole buffer using PIPE_TRANSFER_DONTBLOCK
- if it fails destroy the buffer and create a new one and map that one instead

As an optimization the state tracker could keep a small ring of buffers, and rotate among them, to avoid buffer repeated creation/destruction.

D3D also has a flag similar to GL_MAP_INVALIDATE_BUFFER_BIT, but I didn't add such flag to gallium because this logic is the same for every driver therefore can be handled by the state tracker.

Jose

________________________________________
From: mesa-dev-bounces+jfonseca=vmware.com at lists.freedesktop.org [mesa-dev-bounces+jfonseca=vmware.com at lists.freedesktop.org] On Behalf Of Mathias Fröhlich [Mathias.Froehlich at gmx.net]
Sent: Saturday, November 27, 2010 6:38
To: Brian Paul
Cc: mesa-dev at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] Add missing map range bits to the state tracker.

Hi,

On Friday, November 26, 2010 22:06:47 Brian Paul wrote:
> We don't have a gallium flag that directly corresponds to
> GL_MAP_INVALIDATE_BUFFER_BIT but using PIPE_TRANSFER_DISCARD is
> acceptable.  I'll commit the patch.  Thanks!
That's what it looked to me too.

Thanks!

Mathias
_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list