WineD3D: PBO support 2/2

Stefan Dösinger stefandoesinger at gmx.at
Tue Sep 11 04:08:00 CDT 2007


Am Dienstag, 11. September 2007 10:25:28 schrieb Roderick Colenbrander:
> Hi,
>
> This patch adds PBO support for dynamicly locked textures. It greatly
> improves performance of games that use render target locking a lot.
It looks good to me, here are some suggestions for further improvements in 
further patches(this patch is good for the start).

The locking flag passed to LockRect could be forwarded to GL. D3DLOCK_DISCARD 
and D3DLOCK_WRITEONLY(ddraw only) would be GL_WRITE_ONLY, D3DLOCK_READONLY 
GL_READ_ONLY. However, we have to take care about the upside down swap for 
render target locking.

D3DLOCK_DISCARD can be implemented(appart of the surface beeing writeonly) by 
calling glBufferData with a NULL pointer. This tells gl that the old data can 
be thrown away. This allows the driver to further optimize the map. e.g. if 
it is a texture that is still used for rendering in some pending calls, it 
can duplicate the buffer and doesn't have to wait for the rendering to 
finish. It will have to be tested if that really helps performance. I tried 
it for vbos, and it made things noticeably worse.

Binding the pbo to 0 after each operation is a good idea for a start, but 
shouldn't be done in the long term in my opinion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070911/8d08da4e/attachment.pgp


More information about the wine-devel mailing list