Bug 47169 - Amnesia lighting is missing GM45
Summary: Amnesia lighting is missing GM45
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 9.0
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-09 16:13 UTC by Md Imam Hossain
Modified: 2013-03-14 18:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Md Imam Hossain 2012-03-09 16:13:13 UTC
The games Amnesia http://www.desura.com/games/amnesia-the-dark-descent
has broken graphics and crashes after loading a level.

The game used to run on older Mesa 7.10 series.

Tested on:

Ubuntu 11.10 both 32 Bit and 64 Bit
Linux 3.2.0-030200-generic
X.Org X Server 1.11.2.902 (1.11.3 RC 2)
xf86-video-intel 2.18.0 
Mesa 7.11.1, and 8.1-devel (git)
Intel GMA 4500 MHD
Comment 1 Md Imam Hossain 2012-03-09 16:21:59 UTC
(In reply to comment #0)
> The games Amnesia http://www.desura.com/games/amnesia-the-dark-descent
> has broken graphics and crashes after loading a level.
> 
> The game used to run on older Mesa 7.10 series.
> 
> Tested on:
> 
> Ubuntu 11.10 both 32 Bit and 64 Bit
> Linux 3.2.0-030200-generic
> X.Org X Server 1.11.2.902 (1.11.3 RC 2)
> xf86-video-intel 2.18.0 
> Mesa 7.11.1, and 8.1-devel (git)
> Intel GMA 4500 MHD

My mistake, The game used to run okay on older Mesas 7.10, 7.11 series 

Tested on:

Ubuntu 11.10 both 32 Bit and 64 Bit
Linux 3.2.0-030200-generic
X.Org X Server 1.11.2.902 (1.11.3 RC 2)
xf86-video-intel 2.18.0 
Mesa 8.0.1, and 8.1-devel (git)
Intel GMA 4500 MHD

Thank you
Comment 2 Md Imam Hossain 2012-04-16 05:27:20 UTC
still present in the git and stable Mesa 8 series
Comment 3 Md Imam Hossain 2012-04-29 07:12:55 UTC
link to the trace file from apitrace
http://ubuntuone.com/2M1sPWB74iJSkWbFQm5YSd

The has graphical glitch as well as crashes sometimes in the menu and sometimes after loading a level.

Tested on:

Ubuntu 12.04 both 64 and 32 bit
Linux 3.2.0-24-generic
Mesa 8.0-8.0.2 as well as Mesa git 8.1-devel
xf86-video-intel 2.17.0
Comment 4 Md Imam Hossain 2012-05-06 02:09:41 UTC
After tracing the game with Mesa 7.11.2 I found something different which is may be causing the game not to run with Mesa 8 and above.

With qApitrace under Frame1 with Mesa 7.11 the the game creates 

glCreateShader(type = GL_FRAGMENT_SHADER) = 1
glCreateShader(type = GL_VERTEX_SHADER) = 2

but with Mesa 8 the game creates

glCreateShader(type = GL_FRAGMENT_SHADER) = 4
glCreateShader(type = GL_VERTEX_SHADER) = 5

the trace file from Mesa 7.11

http://ubuntuone.com/458eb7FZFF0Huexou7iEsV
Comment 5 Md Imam Hossain 2012-05-18 22:24:19 UTC
still not fixed by Mesa 8.0.3
Comment 6 Md Imam Hossain 2012-07-11 10:39:18 UTC
still present in Mesa 8.0.4
Comment 7 Md Imam Hossain 2012-10-21 13:13:06 UTC
Present in Mesa version 8 and 9.
Comment 8 Md Imam Hossain 2012-11-01 08:34:02 UTC
just hangs on Mesa git aka 9.1-devel
Comment 9 Md Imam Hossain 2013-02-06 19:23:58 UTC
lighting is back like Mesa 7.11 on mesa master. But to make the game not hang I had to turn off SSAO in game graphics, still not sure which commit fixed this
Comment 10 Md Imam Hossain 2013-02-07 18:41:43 UTC
finally found the commit!

http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdfafb06cf3ae468ceb3e504365016347f54bee

fixes the regression in the master. Also tried patching it to stable Mesa 9.0.2, which also works. But not sure wheather is it correct or not.

will this commit be merged to stable Mesa.

Cheers
Comment 11 Eric Anholt 2013-03-07 01:42:44 UTC
commit 3d80d54bc948a8ef278fff04110e2b018afaa6da
Author: Eric Anholt <eric@anholt.net>
Date:   Wed Nov 21 13:23:36 2012 -0800

    i965: Add texrect scale parameters before pointers to ParameterValues.
    
    If adding scale parameters during program compile caused a realloc of
    ParameterValues, then the driver uniform storage set up by
    _mesa_associate_uniform_storage() would point to potentially freed
    memory.
    
    Note that this uses TexturesUsed, which may change at runtime for GLSL
    when sampler uniforms change.  This is a flaw in our handling of texrect
    in general, and not one I'm fixing currently.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    (cherry picked from commit ffdfafb06cf3ae468ceb3e504365016347f54bee)
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47169
Comment 12 Md Imam Hossain 2013-03-07 04:14:06 UTC
Just a side note, like I said before when I patch Mesa 9 with 

http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdfafb06cf3ae468ceb3e504365016347f54bee

the game works like it does with Mesa 9.2-devel (master) but it hangs somewhere in game. Not happens with Mesa 9.1-devel (master).

I guess it is because we need patch subsequent commit followed by commit 

http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdfafb06cf3ae468ceb3e504365016347f54bee

as well to Mesa 9 to make it work perfectly. I tried patching commit after 

http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffdfafb06cf3ae468ceb3e504365016347f54bee

but it did not patch well with Mesa 9.

I think, it is better we move on to Mesa 9.1 and fix the remaining bug in there since this bug is not present in Mesa 9.1.

One significant bug I found on my GMA 4500 with Mesa 9.1 is The lighting is missing in the game Trine 1. it does not happen with Mesa 9.0, 8, 7 series
Comment 13 Eric Anholt 2013-03-07 07:57:42 UTC
You had the bug open for mesa 9.0, and said that the commit fixes the original problem in 9.0, but you've reopened it after I cherry-picked the commit back.  Is the original problem actually not fixed in mesa 9.0 now?
Comment 14 Md Imam Hossain 2013-03-07 08:52:12 UTC
yes the original bug is fixed in 9.0 but the game hangs only this commit applied. From mesa 9.1 branch I can see the following commits must be related to each other as well as other commits

link http://cgit.freedesktop.org/mesa/mesa/log/?h=9.1&ofs=800

2012-12-28  i965: Stop making a copy of non-builtin uniforms in ParameterValues[].
2012-12-28  i965: Consistently use nr_pull_params instead of NumParameters.
2012-12-28  i965/vs: Reference the core GL uniform storage for non-builtin uniforms.
2012-12-28  i965/fs: Reference the core GL uniform storage for non-builtin uniforms.
2012-12-28  glsl: Add a note about a surprising feature of gl_uniform_storage->type.
2012-12-28  i965/fs: Remove the param_index/param_offset indirection.
2012-12-28  i965: Add asserts to check that we don't realloc ParameterValues.
2012-12-28  i965: Add texrect scale parameters before pointers to ParameterValues.

which also should be merged with mesa 9.0, so that the game runs properly. But I am not completely sure.
Comment 15 Eric Anholt 2013-03-07 16:29:14 UTC
I'm familiar with those commits, having written them.  However, they shouldn't have any efffect on a GPU hang.  Have you verified that backporting them actually makes a difference, or are you just speculating?
Comment 16 Md Imam Hossain 2013-03-14 09:29:16 UTC
I did try patching those commits, some of them can not be patched with mesa 9. GPU does not hang just the game crashes in a level showing glibc error in the terminal. Since this bug is fixed in mesa 9.1 and later, we can happily close this bug


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.