Bug 80015 - Transparency glitches in native Civilization 5 (Civ5) port
Summary: Transparency glitches in native Civilization 5 (Civ5) port
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL: http://www.reddit.com/r/linux_gaming/...
Whiteboard:
Keywords:
: 80071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-14 07:53 UTC by mikelnx
Modified: 2014-09-06 23:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
CivV.png (2.14 MB, image/png)
2014-06-15 06:12 UTC, smoki
Details
patch (806 bytes, patch)
2014-06-15 17:13 UTC, Vadim Girlin
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description mikelnx 2014-06-14 07:53:14 UTC
This report has been constructed from details from the reddit thread at

http://www.reddit.com/r/linux_gaming/comments/28199a/steams_opengl_version_info_misleading_for_aspyrs/

-----

Broken transparency in Civ5 (see http://i.imgur.com/z4mFZXE.jpg)

 - around oil resources
 - around the lighthouse beams
 - floodlight shining on active unit
 - smoke rising from pillaged tiles and barbarian camps

-----

lspci -v | grep VGA and glxinfo | grep OpenGL output:

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn XT [Radeon HD 7870 GHz Edition]

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD PITCAIRN
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.0-devel (git-0d89448 trusty-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.3.0-devel (git-0d89448 trusty-oibaf-ppa)
OpenGL shading language version string: 1.30
Comment 1 smoki 2014-06-15 06:12:52 UTC
Created attachment 101079 [details]
CivV.png


 Confirming this, happens on Radeon 8400 too.
Comment 2 Vadim Girlin 2014-06-15 17:13:54 UTC
Created attachment 101111 [details] [review]
patch

It seems the game relies on specific behavior of inversesqrt, which is undefined when x <= 0 according to GLSL spec. The attached patch uses V_RSQ_CLAMP_F32 instead of V_RSQ_LEGACY_F32 for int_AMDGPU_rsq, this fixed the issue for me.
Comment 3 Paulo Dias 2014-06-16 02:33:14 UTC
*** Bug 80071 has been marked as a duplicate of this bug. ***
Comment 4 smoki 2014-06-16 04:01:57 UTC
(In reply to comment #2)
> Created attachment 101111 [details] [review] [review]
> patch
> 
> It seems the game relies on specific behavior of inversesqrt, which is
> undefined when x <= 0 according to GLSL spec. The attached patch uses
> V_RSQ_CLAMP_F32 instead of V_RSQ_LEGACY_F32 for int_AMDGPU_rsq, this fixed
> the issue for me.


 Thanks Vadim, that fixed it for me too :).
Comment 6 Rafael Castillo 2014-06-27 23:26:22 UTC
confirmed fix too when running Civ5 in wine
Comment 7 Tom Stellard 2014-07-02 19:11:13 UTC
Fixed in Mesa:  b9f501bc6bc52c25bef86a24b49fda4e92fcd924
Comment 8 tuxicoman 2014-09-06 22:15:13 UTC
I have the same withe glitch on Civ5 shown on the CivV.png with AMD radeonsi open source driver.
I don't have the problem with Intel open source drivers.
I use Debian Jessie with mesa 10.2.6
Comment 9 smoki 2014-09-06 23:23:47 UTC
(In reply to comment #8)
> I have the same withe glitch on Civ5 shown on the CivV.png with AMD radeonsi
> open source driver.
> I don't have the problem with Intel open source drivers.
> I use Debian Jessie with mesa 10.2.6

 Fix is there for upstream 10.2 but it only aplay if mesa is bulded against llvm 3.5, Debian Jessie version is currently builded against llvm-3.4. 

 So i think you can request that on Debian bugzilla.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.