tu,util/driconf: Add option to not reserve descriptor set

A descriptor set is internally reserved for descriptor set dynamic
offset which might not be used by an applications which otherwise
requires an extra descriptor set. This driconf option allows making
that trade-off by dropping support for dynamic offsets in exchange
for an extra descriptor set which means 5 usable descriptor sets on
A6XX and 8 on A7XX.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25534>
This commit is contained in:
Mark Collins
2023-10-03 19:12:13 +00:00
committed by Marge Bot
parent 5fe64837cd
commit 273feeb643
3 changed files with 24 additions and 1 deletions

View File

@@ -629,7 +629,12 @@ tu_physical_device_init(struct tu_physical_device *device,
device->ccu_offset_bypass = depth_cache_size;
device->ccu_offset_gmem = device->gmem_size - color_cache_size;
device->usable_sets = device->reserved_set_idx = device->info->a6xx.max_sets - 1;
if (instance->reserve_descriptor_set) {
device->usable_sets = device->reserved_set_idx = device->info->a6xx.max_sets - 1;
} else {
device->usable_sets = device->info->a6xx.max_sets;
device->reserved_set_idx = -1;
}
break;
}
default:
@@ -757,6 +762,7 @@ static const driOptionDescription tu_dri_options[] = {
DRI_CONF_SECTION_MISCELLANEOUS
DRI_CONF_DISABLE_CONSERVATIVE_LRZ(false)
DRI_CONF_TU_DONT_RESERVE_DESCRIPTOR_SET(false)
DRI_CONF_SECTION_END
};
@@ -773,6 +779,8 @@ tu_init_dri_options(struct tu_instance *instance)
driQueryOptionb(&instance->dri_options, "vk_dont_care_as_load");
instance->conservative_lrz =
!driQueryOptionb(&instance->dri_options, "disable_conservative_lrz");
instance->reserve_descriptor_set =
!driQueryOptionb(&instance->dri_options, "tu_dont_reserve_descriptor_set");
}
VKAPI_ATTR VkResult VKAPI_CALL

View File

@@ -147,6 +147,13 @@ struct tu_instance
* suffer a performance loss with conservative LRZ.
*/
bool conservative_lrz;
/* If to internally reserve a descriptor set for descriptor set
* dynamic offsets, a descriptor set can be freed at the cost of
* being unable to use the feature. As it is a part of the Vulkan
* core, this is enabled by default.
*/
bool reserve_descriptor_set;
};
VK_DEFINE_HANDLE_CASTS(tu_instance, vk.base, VkInstance,
VK_OBJECT_TYPE_INSTANCE)

View File

@@ -574,6 +574,14 @@
DRI_CONF_OPT_B(disable_conservative_lrz, def, \
"Disable conservative LRZ")
/**
* \brief Turnip specific configuration options
*/
#define DRI_CONF_TU_DONT_RESERVE_DESCRIPTOR_SET(def) \
DRI_CONF_OPT_B(tu_dont_reserve_descriptor_set, def, \
"Don't internally reserve one of the HW descriptor sets for descriptor set dynamic offset support, this frees up an extra descriptor set at the cost of that feature")
/**
* \brief venus specific configuration options
*/