Bug 16615

Summary: Texture corruption in World of Warcraft (moderately recent)
Product: Mesa Reporter: Chris Rankin <rankincj>
Component: Drivers/DRI/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Screenshot from World of Warcraft, showing artifacts with texturing

Description Chris Rankin 2008-07-04 03:19:15 UTC
Created attachment 17527 [details]
Screenshot from World of Warcraft, showing artifacts with texturing

These artifacts appear on some textures, and change as the character moves around. The blue bar at the bottom must just be an error in the "screen capture" process, because it does not appear while playing the game.

I have a Radeon 9550, and am running a 2.6.25.9-SMP kernel with Mesa and DRI from git:
01:00.0 VGA compatible controller: ATI Technologies Inc RV350 AS [Radeon 9550] (prog-if 00 [VGA controller])
	Subsystem: C.P. Technology Co. Ltd Unknown device 2084
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 64 (2000ns min), Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at e0000000 (32-bit, prefetchable) [size=256M]
	Region 1: I/O ports at ec00 [size=256]
	Region 2: Memory at ff8f0000 (32-bit, non-prefetchable) [size=64K]
	Expansion ROM at ff800000 [disabled] [size=128K]
	Capabilities: [58] AGP version 3.0
		Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3+ Rate=x4,x8
		Command: RQ=32 ArqSz=2 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x8
	Capabilities: [50] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: radeon

01:00.1 Display controller: ATI Technologies Inc RV350 AS [Radeon 9550] (Secondary)
	Subsystem: C.P. Technology Co. Ltd Unknown device 2085
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 64 (2000ns min), Cache Line Size: 64 bytes
	Region 0: Memory at d0000000 (32-bit, prefetchable) [size=256M]
	Region 1: Memory at ff8e0000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [50] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Comment 1 Nicolai Hähnle 2008-07-04 03:26:29 UTC
When you say "fairly recent", can you point out a version of the driver that works without artifacts? Even better, can you use git bisect to pinpoint the commit where it turns bad?
Comment 2 Chris Rankin 2008-07-04 03:42:29 UTC
(In reply to comment #1)
> When you say "fairly recent", can you point out a version of the driver that
> works without artifacts? Even better, can you use git bisect to pinpoint the
> commit where it turns bad?

When I say "recent", I mean that it used to work in the not-too-distant past. However, that was still many kernels, builds of wine and one prior release of Fedora ago. WoW also went through an extended period of not running *at all* under Mesa, and crashing immediately on start-up:

$ warcraft
fixme:mixer:ALSA_MixerInit No master control found on USB Device 0x46d:0x8b4, disabling mixer
fixme:mixer:ALSA_MixerInit No master control found on USB Device 0x46d:0x992, disabling mixer
fixme:advapi:SetSecurityInfo stub
archive Data\patch.MPQ opened
archive Data\enGB\patch-enGB.MPQ opened
archive Data\enGB\patch-enGB-2.MPQ opened
archive Data\patch-2.MPQ opened
archive Data\expansion.MPQ opened
archive Data\common.MPQ opened
archive Data\enGB\locale-enGB.MPQ opened
archive Data\enGB\speech-enGB.MPQ opened
archive Data\enGB\expansion-locale-enGB.MPQ opened
archive Data\enGB\expansion-speech-enGB.MPQ opened
fixme:win:EnumDisplayDevicesW ((null),0,0x32eda4,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32ec94,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f2c8,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f42c,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f5a8,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f5a0,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f528,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x32f518,0x00000000), stub!
X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  156 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  585
  Current serial number in output stream:  585

The only reason that I have been able to play again on this machine has been because I have suddenly discovered that running:

# prelink /usr/lib/libGL.so.1.2
# prelink /usr/lib/libGLU.so.1.3.070100

on new Mesa installations seems to do some "magic" of its own that avoids the X_GLXMakeCurrent error.

Having said all that, I do think that Mesa git was working for me when Marcus Amsler was checking WoW/Radeon patches in.
Comment 3 Markus Amsler 2008-07-04 16:35:47 UTC
> X Error of failed request:  GLXBadDrawable
>  Major opcode of failed request:  156 (GLX)
>  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>  Serial number of failed request:  585
>  Current serial number in output stream:  585
I remember this error too, but I' haven't seen it for a long time. I think (not sure) it was a compile/installation issue.

The artifacts look quite similar to the ones I had and fixed with

commit acb47dee69a165f242d88f9eac60fc5646e33410
Author: Markus Amsler <markus.amsler@oribi.org>
Date:   Fri May 2 01:58:18 2008 +0000

    r300: Set correct VAP_CNTL per vertex program.

Does disabling pixelshaders help?
Comment 4 Markus Amsler 2008-07-04 17:10:44 UTC
Just checked it with a RV370, its the multitexture problem with s3tc. you should see a

*********************************WARN_ONCE*********************************
File r300_texstate.c function compute_tex_image_offset line 231
DXT 3/5 suffers from multitexturing problems!
***************************************************************************

warning in the console. Disabling s3tc in driconf should do the trick.
Strange is that disabling pixelshaders removes all terrain related artifacts, I'm not sure why. Also on r500 I see no artifacts at all, although it should suffer from the same multitexture problems.
Comment 5 Chris Rankin 2008-07-07 13:19:57 UTC
(In reply to comment #4)
> Just checked it with a RV370, its the multitexture problem with s3tc. you
> should see a
> 
> *********************************WARN_ONCE*********************************
> File r300_texstate.c function compute_tex_image_offset line 231
> DXT 3/5 suffers from multitexturing problems!
> ***************************************************************************

Aaaggh! I can't currently test anything with WoW/Mesa because the

X Error of failed request:  GLXBadDrawable
  Major opcode of failed request:  156 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  585
  Current serial number in output stream:  585

crash is back, and this time I can't get rid of it by running prelink. And this is not a build error, because I've rebuilt mesa from scratch by running "make realclean; make linux-dri-x86" first.
Comment 6 Chris Rankin 2008-07-07 16:10:29 UTC
OK, I've managed to run WoW again by "applying patience". The X_GLXMakeCurrent error seems to occur randomly, which I suppose suggests a race condition somewhere. (This is a SMP machine with 2 physical hyper-threaded CPUs, providing 4 logical CPUs.) Retry WoW often enough and it runs eventually.

(In reply to comment #4)
> Just checked it with a RV370, its the multitexture problem with s3tc. you
> should see a
> 
> *********************************WARN_ONCE*********************************
> File r300_texstate.c function compute_tex_image_offset line 231
> DXT 3/5 suffers from multitexturing problems!
> ***************************************************************************
> 
> warning in the console. Disabling s3tc in driconf should do the trick.

No, I am no longer seeing this message at all. I used to see it all the time, but it no longer matters if I enable S3TC via driconf or not.

> Strange is that disabling pixelshaders removes all terrain related artifacts,

Yes, adding 'SET pixelShaders "0"' to Config.wtf does indeed remove all the terrain-related artifacts.
Comment 7 Maciej Cencora 2009-04-25 05:35:46 UTC
Can you reproduce the bug with current mesa master?
Comment 8 Adam Jackson 2009-08-24 12:30:31 UTC
Mass version move, cvs -> git
Comment 9 Maciej Cencora 2009-09-19 03:19:27 UTC
Closing due to lack of user input.

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.