Mesa (10.0): i965/gs: Set GS prog_data to NULL if there is no GS program.

Ian Romanick idr at kemper.freedesktop.org
Wed Nov 27 06:16:23 UTC 2013


Module: Mesa
Branch: 10.0
Commit: 756b4f9a8c657c4ba93a0a082bd77a9c3390c11e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=756b4f9a8c657c4ba93a0a082bd77a9c3390c11e

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Mon Nov 25 07:49:15 2013 -0800

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 at lists.freedesktop.org

Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 37bdde1087584f4c1839e14db75c157b83246ebd)

---

 src/mesa/drivers/dri/i965/brw_vec4_gs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
index b52d646..018b0b6 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;
    }
 




More information about the mesa-commit mailing list