diff options
author | Marek Olšák <[email protected]> | 2017-01-27 00:12:37 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-02-14 21:46:16 +0100 |
commit | 55ad59d2b72d6d6e38bd0a54586b713a7a93bb10 (patch) | |
tree | eb46201b7ce87773e0199399a75a469c389f3dc7 /src/gallium/drivers/svga/svga_context.c | |
parent | 998396c32e4e95fef5a1efef6cb1a9efb0868aa6 (diff) |
gallium: set pipe_context uploaders in drivers (v3)
Notes:
- make sure the default size is large enough to handle all state trackers
- pipe wrappers don't receive transfer calls from stream_uploader, because
pipe_context::stream_uploader points directly to the underlying driver's
stream_uploader (to keep it simple for now)
v2: add error handling to nv50, nvc0, noop
v3: set const_uploader
Reviewed-by: Nicolai Hähnle <[email protected]>
Tested-by: Edmondo Tommasina <[email protected]> (v1)
Tested-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index d3f18014135..ec86073ccc9 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -103,6 +103,8 @@ svga_destroy(struct pipe_context *pipe) util_bitmask_destroy(svga->stream_output_id_bm); util_bitmask_destroy(svga->query_id_bm); u_upload_destroy(svga->const0_upload); + u_upload_destroy(svga->pipe.stream_uploader); + u_upload_destroy(svga->pipe.const_uploader); svga_texture_transfer_map_upload_destroy(svga); /* free user's constant buffers */ @@ -132,6 +134,18 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags) svga->pipe.screen = screen; svga->pipe.priv = priv; svga->pipe.destroy = svga_destroy; + svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024, + PIPE_BIND_VERTEX_BUFFER | + PIPE_BIND_INDEX_BUFFER, + PIPE_USAGE_STREAM); + if (!svga->pipe.stream_uploader) + goto cleanup; + + svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024, + PIPE_BIND_CONSTANT_BUFFER, + PIPE_USAGE_STREAM); + if (!svga->pipe.const_uploader) + goto cleanup; svga->swc = svgascreen->sws->context_create(svgascreen->sws); if (!svga->swc) @@ -283,6 +297,10 @@ cleanup: if (svga->const0_upload) u_upload_destroy(svga->const0_upload); + if (svga->pipe.const_uploader) + u_upload_destroy(svga->pipe.const_uploader); + if (svga->pipe.stream_uploader) + u_upload_destroy(svga->pipe.stream_uploader); svga_texture_transfer_map_upload_destroy(svga); if (svga->hwtnl) svga_hwtnl_destroy(svga->hwtnl); |