i965/fs: Don't use brw->fragment_program in calculate_urb_setup().
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 31 Aug 2012 08:00:15 +0000 (01:00 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 1 Sep 2012 06:00:25 +0000 (23:00 -0700)
commit6886da783ac2fc549b4ffc1f42a47985044757f0
tree7368d00726594e868229be54d5dce1975271f3cb
parentb982fa8e8fa422d33b4166feb58f1e797f7987ac
i965/fs: Don't use brw->fragment_program in calculate_urb_setup().

Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled.  Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b914ddfc8e9a162d98ad554c1c217f7
on pre-Sandybridge hardware.  The actual bug was created in commit
7b1fbc688999fd568e65211d79d7678562061594.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 4d9abd96cc177cade79b64544096eb45bf8313a2)
src/mesa/drivers/dri/i965/brw_fs.cpp