Mesa (8.0): gallium/postprocess: Just to be safe, reference all buffers from outside
Alex Deucher
agd5f at kemper.freedesktop.org
Thu Feb 2 22:15:38 UTC 2012
Module: Mesa
Branch: 8.0
Commit: 1c403f4999a12e696b420213be7283e6e6b27ffd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c403f4999a12e696b420213be7283e6e6b27ffd
Author: Lauri Kasanen <cand at gmx.com>
Date: Tue Jan 24 21:37:56 2012 +0200
gallium/postprocess: Just to be safe, reference all buffers from outside
Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.
NOTE: This is a candidate for the 8.0 stable branch.
Signed-off-by: Lauri Kasanen <cand at gmx.com>
(cherry picked from commit 81938d2137a7a65521ca5a3cd7180902d063c5c0)
---
src/gallium/auxiliary/postprocess/pp_run.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/postprocess/pp_run.c b/src/gallium/auxiliary/postprocess/pp_run.c
index be52051..aa1badc 100644
--- a/src/gallium/auxiliary/postprocess/pp_run.c
+++ b/src/gallium/auxiliary/postprocess/pp_run.c
@@ -64,6 +64,12 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
in = ppq->tmp[0];
}
+ // Kept only for this frame.
+ struct pipe_resource *refin = NULL, *refout = NULL;
+ pipe_resource_reference(&ppq->depth, indepth);
+ pipe_resource_reference(&refin, in);
+ pipe_resource_reference(&refout, out);
+
switch (ppq->n_filters) {
case 1: /* No temp buf */
ppq->pp_queue[0] (ppq, in, out, 0);
@@ -93,6 +99,10 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
break;
}
+
+ pipe_resource_reference(&ppq->depth, NULL);
+ pipe_resource_reference(&refin, NULL);
+ pipe_resource_reference(&refout, NULL);
}
More information about the mesa-commit
mailing list