mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 10:30:08 +01:00
llvmpipe: Only evict cache entries if a fence is available
Makes sure that no chaders are running when accessing sample_functions.
Fixes: 7ebf7f4 ("llvmpipe: Compile sample functioins on demand")
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29699>
This commit is contained in:
parent
5941bee017
commit
255f4bb290
1 changed files with 7 additions and 6 deletions
|
|
@ -1021,13 +1021,14 @@ llvmpipe_clear_sample_functions_cache(struct llvmpipe_context *ctx, struct pipe_
|
|||
|
||||
simple_mtx_unlock(&matrix->lock);
|
||||
|
||||
if (fence)
|
||||
if (fence) {
|
||||
ctx->pipe.screen->fence_finish(ctx->pipe.screen, NULL, *fence, OS_TIMEOUT_INFINITE);
|
||||
|
||||
/* All work is finished, it's safe to move cache entries into the table. */
|
||||
hash_table_foreach_remove(matrix->cache, entry) {
|
||||
struct sample_function_cache_key *key = (void *)entry->key;
|
||||
key->texture_functions->sample_functions[key->sampler_index][key->sample_key] = entry->data;
|
||||
free(key);
|
||||
/* All work is finished, it's safe to move cache entries into the table. */
|
||||
hash_table_foreach_remove(matrix->cache, entry) {
|
||||
struct sample_function_cache_key *key = (void *)entry->key;
|
||||
key->texture_functions->sample_functions[key->sampler_index][key->sample_key] = entry->data;
|
||||
free(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue