mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 02:20:11 +01:00
radv: Add more checking of cache sizes.
Hopefully prevents things. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13789>
This commit is contained in:
parent
9494c566c2
commit
6e3266709a
1 changed files with 5 additions and 0 deletions
|
|
@ -369,8 +369,12 @@ radv_create_shaders_from_pipeline_cache(
|
|||
*stack_sizes = malloc(entry->num_stack_sizes * sizeof(**stack_sizes));
|
||||
memcpy(*stack_sizes, p, entry->num_stack_sizes * sizeof(**stack_sizes));
|
||||
}
|
||||
} else {
|
||||
assert(!entry->num_stack_sizes);
|
||||
}
|
||||
|
||||
p += entry->num_stack_sizes * sizeof(**stack_sizes);
|
||||
|
||||
if (device->instance->debug_flags & RADV_DEBUG_NO_MEMORY_CACHE && cache == device->mem_cache)
|
||||
vk_free(&cache->alloc, entry);
|
||||
else {
|
||||
|
|
@ -379,6 +383,7 @@ radv_create_shaders_from_pipeline_cache(
|
|||
p_atomic_inc(&entry->shaders[i]->ref_count);
|
||||
}
|
||||
|
||||
assert((uintptr_t)p <= (uintptr_t)entry + entry_size(entry));
|
||||
radv_pipeline_cache_unlock(cache);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue