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/softpipe | |
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/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 323f74ff3bd..05973012504 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -37,6 +37,7 @@ #include "util/u_memory.h" #include "util/u_pstipple.h" #include "util/u_inlines.h" +#include "util/u_upload_mgr.h" #include "tgsi/tgsi_exec.h" #include "sp_buffer.h" #include "sp_clear.h" @@ -86,6 +87,9 @@ softpipe_destroy( struct pipe_context *pipe ) if (softpipe->quad.pstipple) softpipe->quad.pstipple->destroy( softpipe->quad.pstipple ); + if (softpipe->pipe.stream_uploader) + u_upload_destroy(softpipe->pipe.stream_uploader); + for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { sp_destroy_tile_cache(softpipe->cbuf_cache[i]); pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL); @@ -267,6 +271,10 @@ softpipe_create_context(struct pipe_screen *screen, softpipe->quad.blend = sp_quad_blend_stage(softpipe); softpipe->quad.pstipple = sp_quad_polygon_stipple_stage(softpipe); + softpipe->pipe.stream_uploader = u_upload_create_default(&softpipe->pipe); + if (!softpipe->pipe.stream_uploader) + goto fail; + softpipe->pipe.const_uploader = softpipe->pipe.stream_uploader; /* * Create drawing context and plug our rendering stage into it. |