From: Paul Berry Date: Mon, 25 Nov 2013 15:49:15 +0000 (-0800) Subject: i965/gs: Set GS prog_data to NULL if there is no GS program. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37bdde1087584f4c1839e14db75c157b83246ebd;p=mesa.git i965/gs: Set GS prog_data to NULL if there is no GS program. The previous commit fixes a bug wherein we would incorrectly refer to stale geometry shader prog_data when no geometry shader was active. This patch reduces the likelihood of that sort of bug occurring in the future by setting prog_data to NULL whenever there is no GS program. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Eric Anholt Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c index b52d646aa00..018b0b67461 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c @@ -259,6 +259,13 @@ brw_upload_gs_prog(struct brw_context *brw) brw->vue_map_geom_out = brw->vue_map_vs; brw->state.dirty.brw |= BRW_NEW_VUE_MAP_GEOM_OUT; } + + /* Other state atoms had better not try to access prog_data, since + * there's no GS program. + */ + brw->gs.prog_data = NULL; + brw->gs.base.prog_data = NULL; + return; }