[Mesa-dev] [PATCH] r600g: Various patches
maraeo at gmail.com
Sun Jun 12 11:46:48 PDT 2011
2011/6/12 Mathias Fröhlich <Mathias.Froehlich at gmx.net>:
> 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?),
No, it doesn't work either. Thanks for point out a serious bug in
st/mesa. I have added a new piglit test for this: vbo-bufferdata
We shouldn't just grab a new buffer without updating all the places
it's bound in no matter if it's a driver or mesa core.
Not sure what the correct fix would be. We must still reallocate the
buffer if the old and new buffer sizes don't match.
More information about the mesa-dev