anv: allocate slice_hash for descriptor buffer

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22151>
This commit is contained in:
Lionel Landwerlin 2023-10-25 16:35:43 +03:00 committed by Marge Bot
parent 859f087c0b
commit 271f0b8b9c
3 changed files with 14 additions and 0 deletions

View file

@ -3918,6 +3918,8 @@ void anv_DestroyDevice(
anv_state_pool_free(&device->dynamic_state_pool, device->slice_hash);
anv_state_pool_free(&device->dynamic_state_pool, device->cps_states);
anv_state_pool_free(&device->dynamic_state_pool, device->breakpoint);
if (device->vk.enabled_extensions.EXT_descriptor_buffer)
anv_state_pool_free(&device->dynamic_state_db_pool, device->slice_hash_db);
#endif
for (unsigned i = 0; i < ARRAY_SIZE(device->rt_scratch_bos); i++) {

View file

@ -1776,6 +1776,7 @@ struct anv_device {
struct anv_state border_colors;
struct anv_state slice_hash;
struct anv_state slice_hash_db;
/** An array of CPS_STATE structures grouped by MAX_VIEWPORTS elements
*

View file

@ -818,6 +818,17 @@ genX(init_device_state)(struct anv_device *device)
return res;
}
if (device->vk.enabled_extensions.EXT_descriptor_buffer &&
device->slice_hash.alloc_size) {
device->slice_hash_db =
anv_state_pool_alloc(&device->dynamic_state_db_pool,
device->slice_hash.alloc_size, 64);
memcpy(device->slice_hash_db.map,
device->slice_hash.map,
device->slice_hash.alloc_size);
}
return res;
}