diff options
author | Eric Anholt <[email protected]> | 2015-04-14 22:42:02 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-05-27 17:29:11 -0700 |
commit | 10aacf5ae8f3e90e2f0967fbdcf96df93e346e20 (patch) | |
tree | 70a8dd0af238e8dc128f369e5b4d1cdd6a702eb4 /src/gallium/drivers/vc4/vc4_context.c | |
parent | f8de6277bfa1a7db9a8c0f0baaa441276264a982 (diff) |
vc4: Just stream out fallback IB contents.
The idea I had when I wrote the original shadow code was that you'd see a
set_index_buffer to the IB, then a bunch of draws out of it. What's
actually happening in openarena is that set_index_buffer occurs at every
draw, so we end up making a new shadow BO every time, and converting more
of the BO than is actually used in the draw.
While I could maybe come up with a better caching scheme, for now just
do the simple thing that doesn't result in a new shadow IB allocation
per draw.
Improves performance of isosurf in drawelements mode by 58.7967% +/-
3.86152% (n=8).
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c index b394c186efb..a2b1cac952d 100644 --- a/src/gallium/drivers/vc4/vc4_context.c +++ b/src/gallium/drivers/vc4/vc4_context.c @@ -29,6 +29,7 @@ #include "util/u_inlines.h" #include "util/u_memory.h" #include "util/u_blitter.h" +#include "util/u_upload_mgr.h" #include "indices/u_primconvert.h" #include "pipe/p_screen.h" @@ -410,6 +411,9 @@ vc4_context_destroy(struct pipe_context *pctx) if (vc4->primconvert) util_primconvert_destroy(vc4->primconvert); + if (vc4->uploader) + u_upload_destroy(vc4->uploader); + util_slab_destroy(&vc4->transfer_pool); pipe_surface_reference(&vc4->framebuffer.cbufs[0], NULL); @@ -466,6 +470,9 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv) if (!vc4->primconvert) goto fail; + vc4->uploader = u_upload_create(pctx, 16 * 1024, 4, + PIPE_BIND_INDEX_BUFFER); + vc4_debug |= saved_shaderdb_flag; return &vc4->base; |