From 1ca97f019efcb0cc14f4ba03a6e23ff51ce5ef46 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 19 Jun 2024 10:55:03 +0300 Subject: [PATCH] anv: avoid initalizing TRTT stuff without sparseBinding 7da5b1caef ("anv: move trtt submissions over to the anv_async_submit") added a hard dependency on timeline semaphore which is still optional. And since it gates the sparseBinding feature, we should not use it if sparseBinding is not enabled. Signed-off-by: Lionel Landwerlin Fixes: 7da5b1caef ("anv: move trtt submissions over to the anv_async_submit") Reviewed-by: Kenneth Graunke Part-of: --- src/intel/vulkan/anv_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 70c7b0242ca..6898d3f68fa 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3249,6 +3249,10 @@ anv_device_destroy_context_or_vm(struct anv_device *device) static VkResult anv_device_init_trtt(struct anv_device *device) { + if (device->physical->sparse_type != ANV_SPARSE_TYPE_TRTT || + !device->vk.enabled_features.sparseBinding) + return VK_SUCCESS; + struct anv_trtt *trtt = &device->trtt; VkResult result = @@ -3270,6 +3274,10 @@ anv_device_init_trtt(struct anv_device *device) static void anv_device_finish_trtt(struct anv_device *device) { + if (device->physical->sparse_type != ANV_SPARSE_TYPE_TRTT || + !device->vk.enabled_features.sparseBinding) + return; + struct anv_trtt *trtt = &device->trtt; anv_sparse_trtt_garbage_collect_batches(device, true);