[Mesa-dev] [PATCH] r600g: Various patches

Mathias Fröhlich Mathias.Froehlich at gmx.net
Sun Jun 12 11:15:22 PDT 2011


On Sunday, June 12, 2011 16:53:08 Marek Olšák wrote:
> 2011/6/12 Mathias Fröhlich <Mathias.Froehlich at gmx.net>:
> > 0005-r600g-Make-use-of-PIPE_TRANSFER_DISCARD_WHOLE_RESOUR.patch:
> > This makes use of the DISCARD_WHOLE_RESOURCE flag for memory mappings.
> 
> That won't work. The old buffer may still be set as a vertex
> buffer/texture. If you replace the whole buffer like that, all the
> states in all existing pipe contexts where the old buffer is set in
> must be re-emitted as well (e.g. by marking them as dirty), which is unfun.
Hmm, I see. This 'find all context' stuff is really bad ...
So, forget about this last one.

Ok, then I wonder if it would work when this is just implemented at the 
state_stracker level in st_cb_bufferobjects.c:

There is the implementation of glBufferData which detaches itself from the 
underlying pipe_resource by unreferencing the old one and creating a new one.
So, given this works well in all cases (does it?), it should just work to 
detach in the same way in the glMapBufferRange state stracker implementation?
... I remember Jose pointing me to that variant some time ago. But in between 
we gained the DISCARD_WHOLE_RESOURCE flag and I thought this driver level 
handling should be the way to go?!

Thanks for pointing this out!

Mathias


More information about the mesa-dev mailing list