diff options
author | Tapani Pälli <[email protected]> | 2020-01-03 07:56:23 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-07 10:48:41 +0000 |
commit | dd09f1d806bab62e2399d2fc7a5d0922c594eab3 (patch) | |
tree | 7958b8eec9f359fefc6b31e4deb1f7a6539fe2b8 /src/mesa/main/shaderobj.c | |
parent | 5f0ff004ca8f0e59270f0ea4dc8f13c74ce88e2b (diff) |
mesa/st/i965: add a ProgramResourceHash for quicker resource lookup
Many resource APIs require searching by name, add a hash table to make
this faster. Currently we traverse the whole resource list for name
based queries, this change makes all these cases use the hash.
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2203
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3254>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3254>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r-- | src/mesa/main/shaderobj.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index 834e2a92ec4..a2478d96975 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -344,6 +344,11 @@ _mesa_clear_shader_program_data(struct gl_context *ctx, shProg->UniformHash = NULL; } + if (shProg->data && shProg->data->ProgramResourceHash) { + _mesa_hash_table_u64_destroy(shProg->data->ProgramResourceHash, NULL); + shProg->data->ProgramResourceHash = NULL; + } + _mesa_reference_shader_program_data(ctx, &shProg->data, NULL); } |