crocus: add unsync transfer pool
Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
This commit is contained in:
@@ -200,6 +200,7 @@ crocus_destroy_context(struct pipe_context *ctx)
|
||||
crocus_bo_unreference(ice->workaround_bo);
|
||||
|
||||
slab_destroy_child(&ice->transfer_pool);
|
||||
slab_destroy_child(&ice->transfer_pool_unsync);
|
||||
|
||||
crocus_batch_free(&ice->batches[CROCUS_BATCH_RENDER]);
|
||||
if (ice->batches[CROCUS_BATCH_COMPUTE].ice)
|
||||
@@ -280,6 +281,7 @@ crocus_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||
crocus_init_program_cache(ice);
|
||||
|
||||
slab_create_child(&ice->transfer_pool, &screen->transfer_pool);
|
||||
slab_create_child(&ice->transfer_pool_unsync, &screen->transfer_pool);
|
||||
|
||||
ice->query_buffer_uploader =
|
||||
u_upload_create(ctx, 4096, PIPE_BIND_CUSTOM, PIPE_USAGE_STAGING,
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_threaded_context.h"
|
||||
#include "intel/blorp/blorp.h"
|
||||
#include "intel/dev/intel_debug.h"
|
||||
#include "intel/compiler/brw_compiler.h"
|
||||
@@ -451,6 +452,9 @@ struct crocus_context {
|
||||
/** Slab allocator for crocus_transfer_map objects. */
|
||||
struct slab_child_pool transfer_pool;
|
||||
|
||||
/** Slab allocator for threaded_context's crocus_transfer_map objects */
|
||||
struct slab_child_pool transfer_pool_unsync;
|
||||
|
||||
struct blorp_context blorp;
|
||||
|
||||
int batch_count;
|
||||
|
@@ -1580,7 +1580,12 @@ crocus_transfer_map(struct pipe_context *ctx,
|
||||
(usage & PIPE_MAP_DIRECTLY))
|
||||
return NULL;
|
||||
|
||||
struct crocus_transfer *map = slab_alloc(&ice->transfer_pool);
|
||||
struct crocus_transfer *map;
|
||||
if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC)
|
||||
map = slab_alloc(&ice->transfer_pool_unsync);
|
||||
else
|
||||
map = slab_alloc(&ice->transfer_pool);
|
||||
|
||||
struct pipe_transfer *xfer = &map->base.b;
|
||||
|
||||
if (!map)
|
||||
|
Reference in New Issue
Block a user