Mesa (master): vc4: Skip storing the Z/S contents when it's invalidated.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jan 7 01:25:18 UTC 2015
Module: Mesa
Branch: master
Commit: b29540397199f05a3f6ca98be75764d8d32015a7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b29540397199f05a3f6ca98be75764d8d32015a7
Author: Eric Anholt <eric at anholt.net>
Date: Fri Jan 2 22:55:37 2015 -0800
vc4: Skip storing the Z/S contents when it's invalidated.
Improves framerate of 5 seconds of es2gears by 1.57473% +/- 0.669409%
(n=67).
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
---
src/gallium/drivers/vc4/vc4_context.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 62f77b3..4c84bd3 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -467,6 +467,16 @@ vc4_cl_references_bo(struct pipe_context *pctx, struct vc4_bo *bo)
}
static void
+vc4_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
+{
+ struct vc4_context *vc4 = vc4_context(pctx);
+ struct pipe_surface *zsurf = vc4->framebuffer.zsbuf;
+
+ if (zsurf && zsurf->texture == prsc)
+ vc4->resolve &= ~(PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL);
+}
+
+static void
vc4_context_destroy(struct pipe_context *pctx)
{
struct vc4_context *vc4 = vc4_context(pctx);
@@ -510,6 +520,7 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv)
pctx->priv = priv;
pctx->destroy = vc4_context_destroy;
pctx->flush = vc4_pipe_flush;
+ pctx->invalidate_resource = vc4_invalidate_resource;
vc4_draw_init(pctx);
vc4_state_init(pctx);
More information about the mesa-commit
mailing list