http://bugs.winehq.org/show_bug.cgi?id=27885
Summary: Starcraft 2 + Mesa 7.12-devel Gallium 4 on AMD REDWOOD: No Textures in Game Product: Wine Version: 1.3.24 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: chewi@schmodder.org
Running Starcraft 2 with current git wine and current git mesa on Ubuntu 11.04 works except for textures. They are not drawn.
It looks like a problem in the association of DXT5 formal surfaces. For some reason wine does not set the "internal formal", "gl format" and "gl type" to correct values, but leaves them as 0.
Here are the relevant log traces of mesa vs fglrx: mesa: trace:d3d_surface:surface_allocate_surface (0x20c18880) : Creating surface (target 0xde1) level 0, d3d format WINED3DFMT_DXT5, internal format 0, width 1024, height 1024, gl format 0, gl type=0 Mesa: User error: GL_INVALID_VALUE in glTexImage2D(internalFormat=GL_FALSE) err:d3d_surface:surface_allocate_surface >>>>>>>>>>>>>>>>> GL_INVALID_VALUE (0x501) from glTexImage2D @ surface.c / 2338 fglrx: trace:d3d_surface:surface_allocate_surface (0x20490550) : Creating surface (target 0xde1) level 0, d3d format WINED3DFMT_DXT5, internal format 0x83f3, width 1024, height 1024, gl format 0x1908, gl type=0x1401 trace:d3d_surface:surface_allocate_surface glTexImage2D call ok surface.c / 2311
I guess, the mesa-gallium detection does not cover the DXT5-Textures, as the fglrx detection of wine initialization does.
I'll try to do some debugging myself, but if there are hints or solution ideas of experienced wine-devs, that would be great.
http://bugs.winehq.org/show_bug.cgi?id=27885
--- Comment #1 from Henri Verbeet hverbeet@gmail.com 2011-07-24 11:50:34 CDT --- You need (32-bit) libtxc_dxtn for s3tc support with r600g.
http://bugs.winehq.org/show_bug.cgi?id=27885
--- Comment #2 from Chewi chewi@schmodder.org 2011-07-24 12:17:50 CDT --- (In reply to comment #1)
You need (32-bit) libtxc_dxtn for s3tc support with r600g.
Thanks a lot for the hint, but I have it installed for sure. Otherwise I'd get the "Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable" as I'm running with MESA_DEBUG=1
Any further ideas ? You know where the internal- and gl-format are associated for the surface ? Or is it the result of some conversion function ?
http://bugs.winehq.org/show_bug.cgi?id=27885
--- Comment #3 from Henri Verbeet hverbeet@gmail.com 2011-07-24 12:30:47 CDT --- The other part that's important for s3tc with r600g is the kernel. You need a fairly recent version, IIRC at least 2.6.39 (but you might as well go straight for 3.0). The GL format setup is done based on the table at http://source.winehq.org/git/wine.git/blob/04d541c26d4f50af2bf306dc11943bd12... Getting 0 for internal format pretty much means the required extension wasn't found, in this case that would be GL_EXT_texture_compression_s3tc. If you run with WINEDEBUG=+d3d_caps you'll probably see that it's not in the list of detected extensions in wined3d_adapter_init_gl_caps(). If this is due to the kernel being too old, it's probably not in your glxinfo output either.
http://bugs.winehq.org/show_bug.cgi?id=27885
Chewi chewi@schmodder.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #4 from Chewi chewi@schmodder.org 2011-07-24 12:40:54 CDT --- (In reply to comment #3)
The other part that's important for s3tc with r600g is the kernel. You need a fairly recent version, IIRC at least 2.6.39 (but you might as well go straight for 3.0). The GL format setup is done based on the table at http://source.winehq.org/git/wine.git/blob/04d541c26d4f50af2bf306dc11943bd12... Getting 0 for internal format pretty much means the required extension wasn't found, in this case that would be GL_EXT_texture_compression_s3tc. If you run with WINEDEBUG=+d3d_caps you'll probably see that it's not in the list of detected extensions in wined3d_adapter_init_gl_caps(). If this is due to the kernel being too old, it's probably not in your glxinfo output either.
Thanks a lot for the help... It actually was the case that s3tc was not shown in glxinfo, which took me to this article http://www.phoronix.com/scan.php?page=news_item&px=OTEwNg ...
Adding a export R600_ENABLE_S3TC=1 made it work... :-)
Running SC2 on Gallium now... :-)
Performance is still low and it crashed after first game, but it's somewhat running... :-)
Thanks Henri...
http://bugs.winehq.org/show_bug.cgi?id=27885
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |INVALID
--- Comment #5 from Henri Verbeet hverbeet@gmail.com 2011-07-24 12:47:13 CDT --- FIXED is only for bug that were actually fixed in Wine. And yeah, R600_ENABLE_S3TC=1 can work in some cases. IIRC there went some related fixes into .39 as well though, so getting the newer kernel is still the preferred way to make it work.
http://bugs.winehq.org/show_bug.cgi?id=27885
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Austin English austinenglish@gmail.com 2011-08-02 11:02:26 CDT --- Closing.