On 28 February 2012 12:19, Stefan Dösinger stefan@codeweavers.com wrote:
This is for bug 30019.
Out ddraw.dll forwards DDLOCK_DISCARDCONTENTS and DDLOCK_NOOVERWRITE to wined3d, but wined3d ignores those flags because we never set WINED3DUSAGE_DYNAMIC. D3d7 docs refer to D3DVBCAPS_WRITEONLY as the flag to set when creating a buffer, so translate it to DYNAMIC | WRITEONLY.
An argument could be made that we should set the DYNAMIC flag on all d3d7 buffers, but until I see a game that needs it I prefer to keep non-D3DVBCAPS_WRITEONLY buffers regular buffers.
I don't see why WRITEONLY should imply DYNAMIC. Setting it for all ddraw buffers may make sense, but even then I'd like to hear a somewhat more convincing argument that now is the right time to change this.
Am Dienstag, 28. Februar 2012, 13:05:16 schrieb Henri Verbeet:
I don't see why WRITEONLY should imply DYNAMIC.
For one, the documents from nvidia tell you to set D3DVBCAPS_WRITEONLY when you want to stream data[1]. Microsoft doesn't really document how dynamic buffers work in d3d7.
The other consideration is that DYNAMIC buffers that are not WRITEONLY are a bad idea in d3d8/9. Yes, we don't handle WINED3DUSAGE_WRITEONLY at the moment, but the consideration makes sense for d3d7 too.
Setting it for all ddraw buffers may make sense, but even then I'd like to hear a somewhat more convincing argument that now is the right time to change this.
To fix bug 30019. That's the one argument I have. I'm happy to defer this change until after Wine 1.4.
It's fairly obvious that we have to set DYNAMIC somewhere if we want DDLOCK_DISCARDCONTENTS and DDLOCK_NOOVERWRITE to work, but I think that's not your point of concern.
1: http://developer.download.nvidia.com/assets/gamedev/docs/top5perfkill.pdf
On 28 February 2012 14:17, Stefan Dösinger stefan@codeweavers.com wrote:
Am Dienstag, 28. Februar 2012, 13:05:16 schrieb Henri Verbeet:
I don't see why WRITEONLY should imply DYNAMIC.
For one, the documents from nvidia tell you to set D3DVBCAPS_WRITEONLY when you want to stream data[1]. Microsoft doesn't really document how dynamic buffers work in d3d7.
The other consideration is that DYNAMIC buffers that are not WRITEONLY are a bad idea in d3d8/9. Yes, we don't handle WINED3DUSAGE_WRITEONLY at the moment, but the consideration makes sense for d3d7 too.
Yes, but that's the other way around. If anything, that pdf suggests that buffers are dynamic by default in ddraw.
Am Dienstag, 28. Februar 2012, 14:51:06 schrieb Henri Verbeet:
Yes, but that's the other way around. If anything, that pdf suggests that buffers are dynamic by default in ddraw.
Making buffers dynamic by default in ddraw will disable rhw vertex and color conversion for ddraw apps.
We could create non-dynamic buffers by default and destroy and recreate the wined3d buffer with the dynamic flag when the app uses DISCARDCONTENTS or NOOVERWRITE the first time.