Mesa (master): gallium/cso_cache: remove one call to pipe_sampler_view_reference

Marek Olšák mareko at kemper.freedesktop.org
Fri Nov 4 20:57:32 UTC 2011


Module: Mesa
Branch: master
Commit: c5e48025ed8dd44de63144ee3621c6aa4b5add81
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c5e48025ed8dd44de63144ee3621c6aa4b5add81

Author: Marek Olšák <maraeo at gmail.com>
Date:   Fri Nov  4 18:05:19 2011 +0100

gallium/cso_cache: remove one call to pipe_sampler_view_reference

---

 src/gallium/auxiliary/cso_cache/cso_context.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index fdd40fc..b91fe1a 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1265,8 +1265,10 @@ restore_sampler_views(struct cso_context *ctx,
    uint i;
 
    for (i = 0; i < info->nr_views_saved; i++) {
-      pipe_sampler_view_reference(&info->views[i], info->views_saved[i]);
-      pipe_sampler_view_reference(&info->views_saved[i], NULL);
+      pipe_sampler_view_reference(&info->views[i], NULL);
+      /* move the reference from one pointer to another */
+      info->views[i] = info->views_saved[i];
+      info->views_saved[i] = NULL;
    }
    for (; i < info->nr_views; i++) {
       pipe_sampler_view_reference(&info->views[i], NULL);




More information about the mesa-commit mailing list