Bug 91998

Summary: Object rendered completely black in The Book of Unwritten Tales: The Critter Chronicles
Product: Mesa Reporter: Daniel Scharrer <daniel>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED DUPLICATE QA Contact: Default DRI bug account <dri-devel>
Severity: minor    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: incorrect rendering with radeonsi
correct rendering with LIBGL_ALWAYS_SOFTWARE=1

Description Daniel Scharrer 2015-09-14 06:22:57 UTC
apitrace: http://constexpr.org/tmp/BOUT-CC-radeonsi.1.trace.xz (95 MiB)

The pipe behind the character is rendered completely black. The object is rendered without any shader but with fixed-function lighting enabled.

Relevant draw call: 2336877 (in frame 1699)

Disabling GL_LIGHTING, GL_LIGHT3 or setting the GL_DIFFUSE material to [0, 0, 0, 0] (including alpha) causes the pipe to be rendered correctly. Disabling the other lights has no effect.

The GL_EMISSION material is set to [1, 1, 1, 1] for this draw call so the other lighting parameters should have no effect (unless they result in NaNs or negative values).

GPU; Radeon HD 7950 (TAHITI)
Mesa 11.1.0-devel (git-0337a9b)
LLVM r247497
Linux 4.2.0-gentoo-r1

Everything is rendered correctly with llvmpipe.

So far I have only found one object in the game affected by this.
Comment 1 Daniel Scharrer 2015-09-14 06:23:39 UTC
Created attachment 118256 [details]
incorrect rendering with radeonsi
Comment 2 Daniel Scharrer 2015-09-14 06:24:22 UTC
Created attachment 118257 [details]
correct rendering with LIBGL_ALWAYS_SOFTWARE=1
Comment 3 Ilia Mirkin 2015-09-14 06:43:40 UTC
Interesting, the pipe is all-white on nvc0. I checked if this was an instance of https://bugs.winehq.org/show_bug.cgi?id=38869, but that doesn't seem to be the case.
Comment 4 smoki 2015-09-14 14:31:57 UTC
(In reply to Daniel Scharrer from comment #0)
> 
> The pipe behind the character is rendered completely black. The object is
> rendered without any shader but with fixed-function lighting enabled.

 Description sounds to me like bug 84156. Similar thing happens in 3DMark2001 with GLSL disabled in wine or what happens in that Pedal to the Metal game.
Comment 5 Ilia Mirkin 2015-09-15 03:51:13 UTC
Pretty sure the error happens on nouveau because there's a 0 * infinity (or nan) type of situation. Messing with a flag that I believe controls the outcome of this type of operation resulted in fixing the rendering.
Comment 6 Daniel Scharrer 2015-10-01 12:13:10 UTC
Both this and and the POSTAL 2 issue come from the same root problem - an Inf or NaN returned by POW for vertices 'behind' the spotlight (dot(spot_direction, vertex_direction) < 0):
http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/main/ffvertex_prog.c#n954

*** This bug has been marked as a duplicate of bug 91342 ***

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.