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: [email protected] [[email protected]] On Behalf Of Mathias Fröhlich [[email protected]] Sent: Saturday, November 27, 2010 6:38 To: Brian Paul Cc: [email protected] 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 [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
