[4/5] WineD3D: Implement manual fencing with GL_APPLE_flush_buffer_range

Stefan Dösinger stefandoesinger at gmx.at
Tue Jan 5 09:30:36 CST 2010


After the discussion on IRC I wasn't quite sure what you intended with wined3d_event_query_wait(), but maybe it was something like this:

I've based the sync code on IWineD3DQuery event queries now rather than using the GL APIs. This way the buffer code is insulated from the thread switch issues, the different fence extensions etc.

Issues:
* D3D doesn't have a glFinishFence equivalent, just something like glTestFence, which needs to be polled. I guess that's where wined3d_event_query_wait comes into play

* Patch 4 changes the query behavior for apps. If the app just wonders if it can do some more work before sending more D3D commands then this is going to hurt. If the app implements some synchronization around D3DLOCK_NOOVERWRITE then we need this anyway. A separate function would help there as well, although the two functions would then have inconsistent behavior.

* Refcounting. The query holds a ref to the device, the buffer holds a ref to the query, and the device holds a ref to the buffer(if the buffer is set as stream source). However, it should still work because the d3d9 counts are unaffected, and when the app destroys the d3d9 device the stateblock refs are freed which breaks the circle. I could of course add a non-COM structure for event queries and use that, but that shouldn't be needed.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0004-WineD3D-Call-glFinish-if-an-event-query-is-read-from-t.txt
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100105/165587bd/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0005-WineD3D-Implement-manual-fencing-with-GL_APPLE_flush_b.txt
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100105/165587bd/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0006-WineD3D-Implement-D3DLOCK_DISCARD-asynchronity.txt
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20100105/165587bd/attachment-0002.txt>


More information about the wine-devel mailing list