Bug 62830 - [i965 bisected] Wrong Lightning on Freespace 2 SCP (patch attached)
Summary: [i965 bisected] Wrong Lightning on Freespace 2 SCP (patch attached)
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 9.1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact:
Keywords: regression
Depends on:
Reported: 2013-03-27 17:50 UTC by Joaquín Ignacio Aramendía
Modified: 2013-03-31 19:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

bisect log of the issue (4.45 KB, text/plain)
2013-03-28 19:16 UTC, Joaquín Ignacio Aramendía
Proposed patch to fix the issue. (1.27 KB, patch)
2013-03-29 06:09 UTC, Joaquín Ignacio Aramendía
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joaquín Ignacio Aramendía 2013-03-27 17:50:19 UTC
Playing Freespace 2 SCP in Archlinux I've noticed all objects with strange lightning issues. They glow and flash between the normal light and total white.

Hera are 4 pictures (http://imgur.com/6FRzz5T,aIrDuFo,oUUqIia,s01MP7Y#0). The first three were taken rendering with the integrated Intel chip. Notice the "sun-sided" part of the ship. The fourth was taken rendering the exact same game with the dedicated Nvidia GPU (through bumblebee with nvidia proprietary driver).

I couldn't test it with nouveau driver because the game crashes X with a segfault on libnouveau_drv (probably due to s3tc texture, I'm not sure).

This rendering issue is also present in other applications (gtkglext one, made by me), I can provide it if it's necessary.

Chipset: Integrated Graphics Chipset: Intel(R) Arrandale
architecture: x86_64
xf86-video-intel: 2.21.5-1
xorg-server: 1.14.0-2
mesa: 9.1.1-1
libdrm: 2.4.42-1
kernel: 3.8.4-1-ARCH

Steps to reproduce: enter a the game, enter a mission, just look around for any ship.
Comment 1 Joaquín Ignacio Aramendía 2013-03-27 17:54:08 UTC
The trace file is 111Mb in size. How could I upload the relevant bits?
Comment 2 Joaquín Ignacio Aramendía 2013-03-27 19:51:31 UTC
Ok. Uploaded to Dropbox. As I have no idea how to trim it properly. http://dl.dropbox.com/u/101701104/fs2_open.trace
Comment 3 Joaquín Ignacio Aramendía 2013-03-27 20:53:54 UTC
It's a regression. Works fine with mesa 8.0.4. Will try to bisect it.
Comment 4 Joaquín Ignacio Aramendía 2013-03-28 00:07:29 UTC
Bisecting between 9.2-devel (current master) and mesa-8.0.4 tag gave me this. Hope is helpful

The merge base 6fe42b603d0ec9e13a8b7d6c46c6d89da3a6a614 is bad.
This means the bug has been fixed between 6fe42b603d0ec9e13a8b7d6c46c6d89da3a6a614 and [6fe42b603d0ec9e13a8b7d6c46c6d89da3a6a614 c1f4867c89adb1a6b19d66ec8ad146115909f0a7].
Comment 5 Joaquín Ignacio Aramendía 2013-03-28 19:16:21 UTC
Created attachment 77170 [details]
bisect log of the issue

Well I hit the first bad commit by a bisection (I'm attaching the bisect log):

7426d9d7699452f15f3288e781e1791d8d00a64a is the first bad commit
commit 7426d9d7699452f15f3288e781e1791d8d00a64a
Author: Olivier Galibert <galibert@pobox.com>
Date:   Thu Jul 19 22:00:16 2012 +0200

    i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.
    If there was an edge flag or a two-side-color pair present, we'd end up
    mismatched and read values from earlier in the VUE for later FS inputs.
    v2: Fix regression in gles2conform shaders generating point size. (change by
    Signed-off-by: Olivier Galibert <galibert@pobox.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    NOTE: This is a candidate for the 8.0 branch.

:040000 040000 b590ab710e004c4a760b0b7268bd1ad98bc99fdd d0cfb9acec2290d01c6f2e4d1902c66035547aaf M	src
Comment 6 Joaquín Ignacio Aramendía 2013-03-29 06:09:08 UTC
Created attachment 77185 [details] [review]
Proposed patch to fix the issue.

The patch attached fixed the issue for me. Apply on top of master (ee624ced364bfd2f896809874ef3a808a11c5ecf).

Hope it helps.
Comment 7 Eric Anholt 2013-03-31 19:49:37 UTC
commit 0967c362bf378b7415c30ca6d9523d3b2a3a7f5d
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Mar 29 00:26:07 2013 -0700

    i965: Fix an inconsistency inb the VUE map with gl_ClipVertex on gen4/5.

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.