diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-05-16 10:49:20 +0200 |
---|---|---|
committer | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2017-06-14 10:04:36 +0200 |
commit | 9cc328eef6e58cd16acf9262c49b851f8c3b04db (patch) | |
tree | b16d242352531dfbb60495f40c246d0a2650bfbc /src/gallium/drivers/radeonsi/si_pipe.c | |
parent | 77bbdcdfcd8ad354a6e556b7440ea160fa62db85 (diff) |
radeonsi: implement ARB_bindless_texture
This implements the Gallium interface. Decompression of resident
textures/images will follow in the next patches.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 14fe9dd6a3..37d648459d 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -27,6 +27,7 @@ #include "sid.h" #include "radeon/radeon_uvd.h" +#include "util/hash_table.h" #include "util/u_memory.h" #include "util/u_suballoc.h" #include "util/u_tests.h" @@ -97,6 +98,11 @@ static void si_destroy_context(struct pipe_context *context) pb_slabs_deinit(&sctx->bindless_descriptor_slabs); util_dynarray_fini(&sctx->bindless_descriptors); + _mesa_hash_table_destroy(sctx->tex_handles, NULL); + _mesa_hash_table_destroy(sctx->img_handles, NULL); + + util_dynarray_fini(&sctx->resident_tex_handles); + util_dynarray_fini(&sctx->resident_img_handles); FREE(sctx); } @@ -328,6 +334,15 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, util_dynarray_init(&sctx->bindless_descriptors, NULL); + /* Bindless handles. */ + sctx->tex_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, + _mesa_key_pointer_equal); + sctx->img_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, + _mesa_key_pointer_equal); + + util_dynarray_init(&sctx->resident_tex_handles, NULL); + util_dynarray_init(&sctx->resident_img_handles, NULL); + return &sctx->b.b; fail: fprintf(stderr, "radeonsi: Failed to create a context.\n"); |