diff options
author | Eric Anholt <[email protected]> | 2018-12-07 12:18:34 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-12-07 16:48:23 -0800 |
commit | b38e4d313fc27a225a36c42f84b2bee9933e62e6 (patch) | |
tree | c4cb203d7e79ebc7ace5b7c79772ea9b3efc5247 /src/gallium/drivers/v3d/v3d_context.c | |
parent | 191188876098801edeaaa231f95fed545fbcc08a (diff) |
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.
Diffstat (limited to 'src/gallium/drivers/v3d/v3d_context.c')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_context.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) |