From b38e4d313fc27a225a36c42f84b2bee9933e62e6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 7 Dec 2018 12:18:34 -0800 Subject: v3d: Create a state uploader for packing our shaders together. Shaders are usually quite short, and are private to the context. We can save memory and reduce the work the kernel needs to do at exec time by packing them together in a stream uploader for long-lived state. --- src/gallium/drivers/v3d/v3d_context.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gallium/drivers/v3d/v3d_context.c') diff --git a/src/gallium/drivers/v3d/v3d_context.c b/src/gallium/drivers/v3d/v3d_context.c index 12741b578e3..36c8f497824 100644 --- a/src/gallium/drivers/v3d/v3d_context.c +++ b/src/gallium/drivers/v3d/v3d_context.c @@ -98,6 +98,8 @@ v3d_context_destroy(struct pipe_context *pctx) if (v3d->uploader) u_upload_destroy(v3d->uploader); + if (v3d->state_uploader) + u_upload_destroy(v3d->state_uploader); slab_destroy_child(&v3d->transfer_pool); @@ -159,6 +161,10 @@ v3d_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) v3d->uploader = u_upload_create_default(&v3d->base); v3d->base.stream_uploader = v3d->uploader; v3d->base.const_uploader = v3d->uploader; + v3d->state_uploader = u_upload_create(&v3d->base, + 4096, + PIPE_BIND_CONSTANT_BUFFER, + PIPE_USAGE_STREAM, 0); v3d->blitter = util_blitter_create(pctx); if (!v3d->blitter) -- cgit v1.2.3