summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-11-25 08:03:24 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-26 21:04:51 -0800
commitd963daa3803db266c88ef8e0643f75a5e600ba19 (patch)
treeca69928d43cd9d611f4f7fc651441a88d4e03ad6
parentbab6f40b29e77d00bf3dbc898c3547470fe3a4fe (diff)
i965/gs: Properly skip GS binding table upload when no GS active.
Previously, in brw_gs_upload_binding_table(), we checked whether brw->gs.prog_data was NULL in order to determine whether a geometry shader was active. This didn't work: brw->gs.prog_data starts off as NULL, but it is set to non-NULL when a geometry shader program is built, and then never set to NULL again. As a result, if we called brw_gs_upload_binding_table() while there was no geometry shader active, but a geometry shader had previously been active, it would refer to a stale (and possibly freed) prog_data structure. This patch fixes the problem by modifying brw_gs_upload_binding_table() to use the proper technique to determine whether a geometry shader is active: by checking whether brw->geometry_program is NULL. This fixes the crash reported in comment 2 of bug 71870 (the incorrect rendering remains, however). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71870 Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit 2714ca81b9bad3dec3894fac97f34502c80b1697)
-rw-r--r--src/mesa/drivers/dri/i965/brw_binding_tables.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_binding_tables.c b/src/mesa/drivers/dri/i965/brw_binding_tables.c
index 0a322dc3cd4..b39bd10bedf 100644
--- a/src/mesa/drivers/dri/i965/brw_binding_tables.c
+++ b/src/mesa/drivers/dri/i965/brw_binding_tables.c
@@ -128,7 +128,7 @@ static void
brw_gs_upload_binding_table(struct brw_context *brw)
{
/* If there's no GS, skip changing anything. */
- if (!brw->gs.prog_data)
+ if (brw->geometry_program == NULL)
return;
brw_upload_binding_table(brw, BRW_NEW_GS_BINDING_TABLE, &brw->gs.base);