summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-04-13 21:20:18 +0200
committerMarek Olšák <[email protected]>2012-04-18 16:19:39 +0200
commitbdb0ad77c20653d01570a4ce44f4200a97fb5f11 (patch)
tree1cd9869785891bf63563037235c925f9383c2a8a
parent462dcf617303a507a1b000f52abbfa3fe695bb95 (diff)
gallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always mapped as unsynchronized.
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c17
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.h6
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c4
3 files changed, 4 insertions, 23 deletions
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index a28d4182549..82474cd7bad 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -1361,8 +1361,10 @@ get_next_slot(struct gen_mipmap_state *ctx)
{
const unsigned max_slots = 4096 / sizeof ctx->vertices;
- if (ctx->vbuf_slot >= max_slots)
- util_gen_mipmap_flush( ctx );
+ if (ctx->vbuf_slot >= max_slots) {
+ pipe_resource_reference(&ctx->vbuf, NULL);
+ ctx->vbuf_slot = 0;
+ }
if (!ctx->vbuf) {
ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
@@ -1475,17 +1477,6 @@ util_destroy_gen_mipmap(struct gen_mipmap_state *ctx)
}
-
-/* Release vertex buffer at end of frame to avoid synchronous
- * rendering.
- */
-void util_gen_mipmap_flush( struct gen_mipmap_state *ctx )
-{
- pipe_resource_reference(&ctx->vbuf, NULL);
- ctx->vbuf_slot = 0;
-}
-
-
/**
* Generate mipmap images. It's assumed all needed texture memory is
* already allocated.
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.h b/src/gallium/auxiliary/util/u_gen_mipmap.h
index a10b6a4aba9..1bcc50f5116 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.h
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.h
@@ -50,12 +50,6 @@ util_create_gen_mipmap(struct pipe_context *pipe, struct cso_context *cso);
extern void
util_destroy_gen_mipmap(struct gen_mipmap_state *ctx);
-/* Release vertex buffer at end of frame to avoid synchronous
- * rendering.
- */
-extern void
-util_gen_mipmap_flush( struct gen_mipmap_state *ctx );
-
extern void
util_gen_mipmap(struct gen_mipmap_state *ctx,
diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 4cde84a8e5b..4e40a93f5e6 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -81,11 +81,7 @@ void st_flush( struct st_context *st,
{
FLUSH_CURRENT(st->ctx, 0);
- /* Release any vertex buffers that might potentially be accessed in
- * successive frames:
- */
st_flush_bitmap(st);
- util_gen_mipmap_flush(st->gen_mipmap);
st->pipe->flush( st->pipe, fence );
}