[Bug 27534] Call of Duty 4 MW: Graphical glitches when shooting

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Aug 4 12:35:43 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=27534

--- Comment #30 from Stefan Dösinger <stefandoesinger at gmx.at> 2011-08-04 12:35:41 CDT ---
I isolated one of the buffers involved in this bug and I have a theory what may
be happening: The buffer in question is a 512k vertex buffer. The game always
maps the entire buffer from thread A with D3DLOCK_DISCARD and uses the buffer
from thread B to dispatch a number of draw calls without changing the buffer in
between. Nothing wrong with that. The buffer isn't assigned to a stream source
while it is mapped, and it is assigned after unmap, so thread B should properly
notice the changes to the buffer.

I suspect that the driver checks if the buffer is in use somewhere when
GL_MAP_INVALIDATE_BUFFER_BIT(the GL equivalent of D3DLOCK_DISACRD) is used. If
it is, a new buffer is allocated(or recycled) to avoid waiting for those
scheduled commands to finish. If it isn't, the flag is ignored since allocating
a new buffer isn't free. My guess now is that when the driver checks if the
buffer is busy it only checks the current context. Thus it reuses the existing
buffer and the game overwrites data that is required for old, not yet executed
draw commands.

If this theory is correct a glFinish() before a INVALIDATE_BUFFER_BIT map
combined with strict draw ordering should do it. I'll attach a patch for that.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list