summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-08-31 01:00:15 -0700
committerIan Romanick <ian.d.romanick@intel.com>2012-10-24 11:41:06 -0700
commit6fc0ebb44ac7b2119f028608123e29f2ea8285a9 (patch)
tree1d21054ff51530a625ef4bfd2bfe17eba3de2fdc
parent81627c7d45df1618413ac5c5149587dd7840526d (diff)
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 9.0 and 8.0 branches. 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)
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp2
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 6a876cc7f36..acb870c926e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -718,7 +718,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++;
}