Mesa (9.0): i965/fs: Don't use brw->fragment_program in calculate_urb_setup ().

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Sep 1 06:01:46 UTC 2012


Module: Mesa
Branch: 9.0
Commit: 6886da783ac2fc549b4ffc1f42a47985044757f0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6886da783ac2fc549b4ffc1f42a47985044757f0

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Aug 31 01:00:15 2012 -0700

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 at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
(cherry picked from commit 4d9abd96cc177cade79b64544096eb45bf8313a2)

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index a8d55ff..167ea08 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -979,7 +979,7 @@ fs_visitor::calculate_urb_setup()
        *
        * See compile_sf_prog() for more info.
        */
-      if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC))
+      if (fp->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC))
          urb_setup[FRAG_ATTRIB_PNTC] = urb_next++;
    }
 




More information about the mesa-commit mailing list