Created attachment 31221 [details]
Error ouput from Civ4/Wine using Mesa 7.6
I just upgraded to Mesa-7.6 and since the upgrade, whenever I play the game Civilization 4 (running on top of Wine) all of the terrain in the game is black. The previous version of Mesa I was using was 7.5.1, and I did not have this problem. I should note that I also upgraded libdrm from 2.4.13 to 2.4.15 at the same time I did the Mesa upgrade. I have attached the debug output from Civ4/Wine after recompiling Mesa with -DDEBUG, my glxinfo, and a screenshot from Civ4 showing the black terrain. Here is the current hardware/software I have on my system:
Graphics Card: ATI Technologies Inc RC410 [Radeon Xpress 200M] (prog-if 00 [VGA controller])
xorg-server: X.Org X Server 184.108.40.2061 (1.6.4 RC 1)
xorg radeon driver: 6.12.4
Created attachment 31222 [details]
glxinfo for Mesa 7.6
Created attachment 31223 [details]
Screenshot of Civ4/Wine showing black terrain.
I tried to run git bisect to find the cause of this bug, but I couldn't find the exact commit because some of the commits caused Wine to crash. However, I still think I have some useful information. Here are my results:
Civilization 4 running on top of Wine works as expected until this commit:
d1a0ece9077b3de49c293a04c220b995424cef28 is first bad commit
Author: Pauli Nieminen <firstname.lastname@example.org>
Date: Wed Aug 12 20:28:54 2009 +0300
radeon: Port flush preventation code from r200 to r100.
- emit prediction
- fixes to emit_sizes for data
- clean up of excesive use of radeonEnsureCmdBufferSpace
Signed-off-by: Pauli Nieminen <email@example.com>
:040000 040000 f5047ec4056835fd217922cabb4907bf59dd5e31 d4c7e96406e9a9529073e104b18e2af16ef9b01a M src
Starting with this commit, Wine crashes right after starting Civilization 4. This behavior continues until this commit:
4916a5a2e72b05c176809dd0db5066a966a45b80 is first bad commit
Author: Maciej Cencora <firstname.lastname@example.org>
Date: Sun Sep 20 13:54:59 2009 +0200
radeon: update buffer map/unmap code for changes introduced in 92033a9516942d7272ce4bf36ecd422009bbaf60 and 822c7964819ca1fcc270880d4ca8b3de8a4276d0
:040000 040000 7f8f99ed6e80c9554b1d4a34030a3720beb7f174 a2673b431fd186ffe0224c0c5783abef43f76e5d M src
Starting with this commit, I experience the problem I originally described. Civilization 4 starts correctly, but during game play all the terrain is black. The cause of this bug is somewhere between these two commits.
Can you check if the bug is still reproducible on current master, mesa_7_7_branch and mesa_7_6_branch branches?
I am now using:
xorg-server: 1.7.4 RC 1
kernel: 2.6.32 with KMS disabled.
and the most recent git versions of libdrm and ddx.
I can reproduce this bug on the master, mesa_7_7_branch, and mesa_7_6_branch branches.
This bug was the result of a shader that was failing to compile because it had too many TEX blocks. This was caused by the pair scheduler breaking up a large TEX block into several smaller ones. I have attached a patch that fixes this bug.
Created attachment 35975 [details] [review]
(In reply to comment #7)
> Created an attachment (id=35975) [details]
> Proposed fix
This patch fixes civ4, but it could potentially break other programs.
Created attachment 36026 [details]
Compiler output for the miscompiled shader
Created attachment 36754 [details] [review]
Fixed in git master commit: 3724a2e65f5b3aa6e123889342a3e9c4d05903f5
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.