venus: Enable VK_EXT_memory_budget

Tested dEQP-VK.info.device_memory_budget on Intel with vtest.  When the
test is ran at approximately the same time on the native driver and on
vtest, the qpa result files each report approximately the same memory
budget.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
This commit is contained in:
Lina Versace 2023-03-23 13:57:08 -07:00 committed by Marge Bot
parent 85007a5caf
commit 655150918b

View file

@ -1123,6 +1123,7 @@ vn_physical_device_get_passthrough_extensions(
.EXT_image_view_min_lod = true,
.EXT_index_type_uint8 = true,
.EXT_line_rasterization = true,
.EXT_memory_budget = true,
.EXT_multi_draw = true,
.EXT_mutable_descriptor_type = true,
.EXT_primitive_topology_list_restart = true,
@ -1900,7 +1901,29 @@ vn_GetPhysicalDeviceMemoryProperties2(
{
struct vn_physical_device *physical_dev =
vn_physical_device_from_handle(physicalDevice);
struct vn_instance *instance = physical_dev->instance;
VkPhysicalDeviceMemoryBudgetPropertiesEXT *memory_budget = NULL;
/* Don't waste time searching for unsupported structs. */
if (physical_dev->base.base.supported_extensions.EXT_memory_budget) {
memory_budget =
vk_find_struct(pMemoryProperties->pNext,
PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT);
}
/* When the app queries invariant memory properties, we return a cached
* copy. For dynamic properties, we must query the server.
*/
if (memory_budget) {
vn_call_vkGetPhysicalDeviceMemoryProperties2(instance, physicalDevice,
pMemoryProperties);
}
/* Even when we query the server for memory properties, we must still
* overwrite the invariant memory properties returned from the server with
* our cached version. Our cached version may differ from the server's
* version due to workarounds.
*/
pMemoryProperties->memoryProperties =
physical_dev->memory_properties.memoryProperties;
}