[PATCH] ddraw: Don't discard buffers that haven't been used in draws
stefan at codeweavers.com
Wed Jan 2 05:53:37 CST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Am 2013-01-02 12:42, schrieb Henri Verbeet:
> On 2 January 2013 12:26, Stefan Dösinger <stefan at codeweavers.com>
>> Fixes bug 32485.
> I'm sure we've had this discussion wrt. commit messages before,
> but this tells me just about nothing about what problem this patch
> is supposed to fix, or why this is the correct solution. Also, do
> you have tests for this?
- From the bug report:
> The game apparently wants the buffer contents to remain intact
> when it locks a buffer with DDLOCK_DISCARDCONTENTS - or at least in
> some cases. I noticed that the game maps and unmaps a buffer
> repeatedly with this flag, without ever drawing from it. In theory
> DISCARDCONTENTS is redundant in all but the first lock after a
> draw, but the driver still discards the buffer contents. Ignoring
> the flag and memsetting the buffer to some random value has the
> same effect as setting the flag.
One thing is unclear in the text: The game does eventually draw from
the buffer, so it's not just using it as a sysmem storage. But there
are about 20 DISCARD maps/unmaps between the draws.
A test sounds like a good idea though.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the wine-devel