diff options
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 031e4731bf0..14fe9dd6a36 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -94,6 +94,9 @@ static void si_destroy_context(struct pipe_context *context) r600_resource_reference(&sctx->last_trace_buf, NULL); radeon_clear_saved_cs(&sctx->last_gfx); + pb_slabs_deinit(&sctx->bindless_descriptor_slabs); + util_dynarray_fini(&sctx->bindless_descriptors); + FREE(sctx); } @@ -316,6 +319,15 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, sctx->tm = si_create_llvm_target_machine(sscreen); + /* Create a slab allocator for all bindless descriptors. */ + if (!pb_slabs_init(&sctx->bindless_descriptor_slabs, 6, 6, 1, sctx, + si_bindless_descriptor_can_reclaim_slab, + si_bindless_descriptor_slab_alloc, + si_bindless_descriptor_slab_free)) + goto fail; + + util_dynarray_init(&sctx->bindless_descriptors, NULL); + return &sctx->b.b; fail: fprintf(stderr, "radeonsi: Failed to create a context.\n"); |