Created attachment 55392 [details] Screenshot of broken video Intro videos in the game Call of Duty 4 (running with Wine) no longer renders correctly, bisecting leads to this: e8139ebf583acf37150a8b341bcbef6b924a7792 is the first bad commit commit e8139ebf583acf37150a8b341bcbef6b924a7792 Author: Mathias Fröhlich <Mathias.Froehlich@gmx.net> Date: Tue Jul 26 07:05:10 2011 +0200 r600g: Replace needless flush in texture upload. Replace pipe->flush() with pipe->texture_barrier() in the texture upload path for the staging texture. This should be enough to get data out of the gpu caches ready to be read for texture fetch. :040000 040000 b3f16d1a114f54d753ba7845b697888307f6246e faab26149053fdb2fb65d81bb2a777a77e130de2 M src Adding the flush back fixes the problem.
Still a problem with Wine 1.7.3 and Mesa 9.2.1.
Still a problem with Wine 1.7.17 and Mesa 10.1
Also a problem on radeonsi. Apitrace of the problem: https://www.dropbox.com/s/ibt9iu15x4mxw9q/cod4.trace?dl=0 I'm getting a lot of errors when replaying the trace, so I guess it's possible the game or Wine is doing something wrong: 100824: message: major api error 1: GL_INVALID_OPERATION in glTexImage3D(bad target for depth texture) 100824 @0 glTexImage3D(target = GL_TEXTURE_3D, level = 0, internalformat = GL_DEPTH32F_STENCIL8, width = 16, height = 16, depth = 16, border = 0, format = GL_DEPTH_STENCIL, type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV, pixels = NULL) 100824: warning: glGetError(glTexImage3D) = GL_INVALID_OPERATION 100830: message: api issue 2: FBO incomplete: color attachment incomplete [0] 100865: message: api issue 2: FBO incomplete: color attachment incomplete [0]
Setting StrictDrawOrdering in Wine to enabled gets working videos again, but at a severe performance cost.
Hi Sven, thanks for the apitrace. I can confirm that there is garbage in some of the first frames of the apitrace, e.g. Frame 11 @77450. I'm going to look in more detail, though the many error messages do hint at an application bug.
I just tried Wine Staging with the CSMT (Command stream multithreading) patches, and the videos play fine there, so I think it really is a problem with Wine.
This is an application bug (though I don't know whether the fault lies with Wine or with CoD4): there is insufficient synchronization between different contexts. If you look e.g. at Frame 5, there is a sequence of glTexSubImage2D calls for textures 64 to 66 running in context 3. The command sequence switches to context 2 in call 75827, and the textures are used in call 76024, still on context 2 and without any flush or fence command in between to ensure that the TexSubImage commands are actually executed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.