diff options
author | Marek Olšák <[email protected]> | 2020-02-05 14:10:48 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-02-26 20:35:50 +0000 |
commit | a01a875081bd52bc1c3c142a60af678171ce6c33 (patch) | |
tree | 395290b39796f09ee465fda4fbbb07354c57cb26 /src/gallium/drivers/v3d | |
parent | 56f31328f207f310ee9b53f3294a23b25b2687e0 (diff) |
gallium/hash_table: consolidate hash tables with pointer keys
Reviewed-by: Kristian H. Kristensen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3722>
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r-- | src/gallium/drivers/v3d/v3d_screen.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c index a449e458035..8031ea727e0 100644 --- a/src/gallium/drivers/v3d/v3d_screen.c +++ b/src/gallium/drivers/v3d/v3d_screen.c @@ -612,18 +612,6 @@ v3d_screen_is_format_supported(struct pipe_screen *pscreen, return true; } -#define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x))) - -static unsigned handle_hash(void *key) -{ - return PTR_TO_UINT(key); -} - -static int handle_compare(void *key1, void *key2) -{ - return PTR_TO_UINT(key1) != PTR_TO_UINT(key2); -} - static const void * v3d_screen_get_compiler_options(struct pipe_screen *pscreen, enum pipe_shader_ir ir, unsigned shader) @@ -686,7 +674,7 @@ v3d_screen_create(int fd, const struct pipe_screen_config *config, } list_inithead(&screen->bo_cache.time_list); (void)mtx_init(&screen->bo_handles_mutex, mtx_plain); - screen->bo_handles = util_hash_table_create(handle_hash, handle_compare); + screen->bo_handles = util_hash_table_create_ptr_keys(); #if defined(USE_V3D_SIMULATOR) v3d_simulator_init(screen); |