Bug 29420 - Amnesia / HPL2 RendererFeatTest - not rendering correctly
Amnesia / HPL2 RendererFeatTest - not rendering correctly
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
Other All
: medium normal
Assigned To: mesa-dev
http://frictionalgames.com/forum/thre...
:
: 32045 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-06 08:05 UTC by Sven Arvidsson
Modified: 2010-12-03 09:43 UTC (History)
1 user (show)

See Also:


Attachments
Screenshot of test 4 (125.35 KB, image/png)
2010-08-06 08:05 UTC, Sven Arvidsson
Details
Backtrace from the crash (7.75 KB, text/plain)
2010-08-06 08:05 UTC, Sven Arvidsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Arvidsson 2010-08-06 08:05:07 UTC
Created attachment 37638 [details]
Screenshot of test 4

The developers of the upcoming game Amnesia have released an application to test graphics compatibility, this does not render correctly in Mesa. 

Test 4 and onwards have problems, the app also segfaults shortly before it's finished, which might or might not be driver-related. This behaviour is the same on r300g, and on softpipe.

The test app, and comparison screenshots can be found here:
http://frictionalgames.com/forum/thread-3604-page-1.html 

I'm using git master, commit d38afcd2f286e924e0f9b7f484712ac19e3f98fc
Comment 1 Sven Arvidsson 2010-08-06 08:05:39 UTC
Created attachment 37639 [details]
Backtrace from the crash
Comment 2 Sven Arvidsson 2010-08-06 08:20:46 UTC
A lot of GLSL errors:

ERROR: Could not create texture 'LinearDepth'
ERROR: Frame buffer 'LinearDepth' is not complete! Incomplete draw buffer!
ERROR: Failed to compile GLSL shader '/home/sa/Downloads/RendererFeatTest/core/shaders/deferred_ssao_blur_frag.glsl'!
ERROR: Couldn't create program 'deferred_ssao_blur_frag.glsl'
ERROR: Failed to compile GLSL shader '/home/sa/Downloads/RendererFeatTest/core/shaders/deferred_ssao_blur_frag.glsl'!
ERROR: Couldn't create program 'deferred_ssao_blur_frag.glsl'
ERROR: Could not create texture 'EdgeSmoothLinearDepth'
ERROR: Frame buffer 'EdgeSmoothLinearDepth' is not complete! Incomplete draw buffer!
ERROR: Failed to compile GLSL shader '/home/sa/Downloads/RendererFeatTest/core/shaders/posteffect_bloom_blur_frag.glsl'!
ERROR: Couldn't create program 'posteffect_bloom_blur_frag.glsl'
ERROR: Failed to compile GLSL shader '/home/sa/Downloads/RendererFeatTest/core/shaders/posteffect_bloom_blur_frag.glsl'!
ERROR: Couldn't create program 'posteffect_bloom_blur_frag.glsl'
ERROR: Failed to compile GLSL shader '/home/sa/Downloads/RendererFeatTest/core/shaders/posteffect_radial_blur_frag.glsl'!
ERROR: Couldn't create program 'posteffect_radial_blur_frag.glsl'
Comment 3 Sven Arvidsson 2010-08-06 09:59:11 UTC
According to the game devs, the segfault is because of the shader failure.
Comment 4 Sven Arvidsson 2010-08-17 10:28:09 UTC
The GLSL errors are gone now, it's still not rendering correctly though, probably because of these remaining errors:

ERROR: Could not create texture 'LinearDepth'
ERROR: Frame buffer 'LinearDepth' is not complete! Incomplete draw buffer!
ERROR: Could not create texture 'EdgeSmoothLinearDepth'
ERROR: Frame buffer 'EdgeSmoothLinearDepth' is not complete! Incomplete draw buffer!
Comment 5 Sven Arvidsson 2010-09-03 14:33:00 UTC
There's a proper demo of the game out now:
http://www.AmnesiaGame.com/#main

The rendertest app has been removed, but it might still be useful to figure out what's wrong, so I have mirrored it here (let's hope the devs won't mind):
http://www.filefactory.com/file/b3330a9/n/RendererFeatTest-Linux32.zip

The most obvious problem in the demo is that everything seems to be upside down.
Comment 6 Sven Arvidsson 2010-09-03 14:48:36 UTC
FWIW, the errors from rendertest and the demo being upside down is the same with both r300g and softpipe and with i965 on classic Mesa.
Comment 7 Edward Rudd 2010-12-02 06:33:23 UTC
*** Bug 32045 has been marked as a duplicate of this bug. ***
Comment 8 Edward Rudd 2010-12-02 06:34:38 UTC
Here is some updated info On what me and Hicham (of bug # 32045) have found.

What's happening now with the demo and release game is quite odd.  On Hicham's r300 based card his scenes are upside down, where as decals are rightside up.

(Hicham's screenshots)
http://img21.imageshack.us/i/amnesiascreenshot000.jpg/
http://img168.imageshack.us/i/amnesiascreenshot002.jpg/

Now from my (as the linux/mac developer for Frictionalgames) experience on testing under F14 on an ATI HD 3000 (embedded card) is that some of the GLSL refused to compile, where as Hicham did not have this issue. Because of that I could not get anywhere to the point of recreating his "upside down scenes".

What is interesting though is that I installed an nvidia GTS 450 card later that day and first ran it in pure mesa mode (albeit all software as nuvoue doesn't support that card yet).  And all of the GLSL compiled perfectly AND everything rendered perfectly.  Now it was at a snails pace at around 500ms to 1900ms per frame but it rendered:).
Comment 9 Sven Arvidsson 2010-12-02 10:32:55 UTC
Interesting. With a recent snapshot (git master from today) I get the same problem (scenes upside down, decals okay) with r300g, softpipe, and llvmpipe.

If swrast is used (which is different from softpipe) the game does render fine. Which confirms what you described. 

I guess this is a bug in Gallium3D, but it's curious that Intel (which isn't using Gallium) have (or at least had, I haven't rechecked since filing the bug) a very similar problem.  

The HD 3000 seems to be an r600 card, and that driver is TTBOMK not as complete as r300g, which could be why it failed to run. You should be able to get software rendering working with either softpipe or llvmpipe, see http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/llvmpipe/README 

Also, I just wanted to say that it's much appreciated to see one of the game devs taking an interest in getting Amnesia running on free drivers! :-)
Comment 10 Marek Olšák 2010-12-02 10:58:45 UTC
I know why all Gallium drivers fail. I am working on the fix.
Comment 11 Hicham HAOUARI 2010-12-02 11:19:24 UTC
with software rasterizer the test renders ok, except for ssao
Comment 12 Marek Olšák 2010-12-02 21:06:16 UTC
Please test mesa/master, most tests should render ok now.
Comment 13 Sven Arvidsson 2010-12-03 03:49:37 UTC
(In reply to comment #12)
> Please test mesa/master, most tests should render ok now.

The game renders the right way up now, awesome work as always! :)
Comment 14 Hicham HAOUARI 2010-12-03 06:36:08 UTC
(In reply to comment #12)
> Please test mesa/master, most tests should render ok now.

The game works like a charm now, thanks a lot Marek

One more question : are these commits candidate for 7.9 ?
Comment 15 Marek Olšák 2010-12-03 07:23:14 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > Please test mesa/master, most tests should render ok now.
> 
> The game works like a charm now, thanks a lot Marek
> 
> One more question : are these commits candidate for 7.9 ?

The commit that fixed the misrendering is d531f9c2f5c78468d913fc509b223760ac1c1124 and yes, it'll be committed to 7.9 too.

If you don't mind, I'll close this bug. There are still some tests in RendererFeatTest32, which fail, like SSAO, but I have currently no idea how to fix them. Feel free to file separate bugs for each of them.
Comment 16 Hicham HAOUARI 2010-12-03 08:16:32 UTC
(In reply to comment #15)
> (In reply to comment #14)
> > (In reply to comment #12)
> > > Please test mesa/master, most tests should render ok now.
> > 
> > The game works like a charm now, thanks a lot Marek
> > 
> > One more question : are these commits candidate for 7.9 ?
> 
> The commit that fixed the misrendering is
> d531f9c2f5c78468d913fc509b223760ac1c1124 and yes, it'll be committed to 7.9
> too.
> 
> If you don't mind, I'll close this bug. There are still some tests in
> RendererFeatTest32, which fail, like SSAO, but I have currently no idea how to
> fix them. Feel free to file separate bugs for each of them.

Thanks, feel free to close this bug.