Mesa (mesa_7_7_branch): svga: Remove stale references to delete shader results.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Jan 5 17:57:35 UTC 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: 38d8b180038eef692cbc75731d340c9fcc721784
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=38d8b180038eef692cbc75731d340c9fcc721784

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Jan  5 17:56:26 2010 +0000

svga: Remove stale references to delete shader results.

To ensure that a new result that happens to have the same address
of the old one will be detected as a change.

---

 src/gallium/drivers/svga/svga_pipe_fs.c |    7 +++++++
 src/gallium/drivers/svga/svga_pipe_vs.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_fs.c b/src/gallium/drivers/svga/svga_pipe_fs.c
index a461a86..5f1213e 100644
--- a/src/gallium/drivers/svga/svga_pipe_fs.c
+++ b/src/gallium/drivers/svga/svga_pipe_fs.c
@@ -111,6 +111,13 @@ void svga_delete_fs_state(struct pipe_context *pipe, void *shader)
       util_bitmask_clear( svga->fs_bm, result->id );
 
       svga_destroy_shader_result( result );
+
+      /*
+       * Remove stale references to this result to ensure a new result on the
+       * same address will be detected as a change.
+       */
+      if(result == svga->state.hw_draw.fs)
+         svga->state.hw_draw.fs = NULL;
    }
 
    FREE((void *)fs->base.tokens);
diff --git a/src/gallium/drivers/svga/svga_pipe_vs.c b/src/gallium/drivers/svga/svga_pipe_vs.c
index 02709e1..fd9864c 100644
--- a/src/gallium/drivers/svga/svga_pipe_vs.c
+++ b/src/gallium/drivers/svga/svga_pipe_vs.c
@@ -176,6 +176,13 @@ static void svga_delete_vs_state(struct pipe_context *pipe, void *shader)
       util_bitmask_clear( svga->vs_bm, result->id );
 
       svga_destroy_shader_result( result );
+
+      /*
+       * Remove stale references to this result to ensure a new result on the
+       * same address will be detected as a change.
+       */
+      if(result == svga->state.hw_draw.vs)
+         svga->state.hw_draw.vs = NULL;
    }
 
    FREE((void *)vs->base.tokens);




More information about the mesa-commit mailing list