From 793d8b876ca2b51b4bdec46a274546c72e049dd4 Mon Sep 17 00:00:00 2001 From: Friedrich Vock Date: Sat, 8 Jul 2023 12:32:07 +0200 Subject: [PATCH] radv: Handle VK_SUBOPTIMAL_KHR in trace layers vkQueuePresentKHR might return VK_SUBOPTIMAL_KHR which is not VK_SUCCESS but presentation succeeded anyway. We should capture a trace even if VK_SUBOPTIMAL_KHR is returned. Cc: mesa-stable Part-of: (cherry picked from commit b8edd19358eaba847de3063b24f2ab0dd6f69f14) --- .pick_status.json | 2 +- src/amd/vulkan/layers/radv_rmv_layer.c | 2 +- src/amd/vulkan/layers/radv_rra_layer.c | 2 +- src/amd/vulkan/layers/radv_sqtt_layer.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 38fd0746aee..c5239e1a634 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2614,7 +2614,7 @@ "description": "radv: Handle VK_SUBOPTIMAL_KHR in trace layers", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/layers/radv_rmv_layer.c b/src/amd/vulkan/layers/radv_rmv_layer.c index 6fd48bd22bf..92d975456b5 100644 --- a/src/amd/vulkan/layers/radv_rmv_layer.c +++ b/src/amd/vulkan/layers/radv_rmv_layer.c @@ -34,7 +34,7 @@ rmv_QueuePresentKHR(VkQueue _queue, const VkPresentInfoKHR *pPresentInfo) struct radv_device *device = queue->device; VkResult res = queue->device->layer_dispatch.rmv.QueuePresentKHR(_queue, pPresentInfo); - if (res != VK_SUCCESS || !device->vk.memory_trace_data.is_enabled) + if ((res != VK_SUCCESS && res != VK_SUBOPTIMAL_KHR) || !device->vk.memory_trace_data.is_enabled) return res; vk_rmv_log_misc_token(&device->vk, VK_RMV_MISC_EVENT_TYPE_PRESENT); diff --git a/src/amd/vulkan/layers/radv_rra_layer.c b/src/amd/vulkan/layers/radv_rra_layer.c index c09d586e09b..b1331843e9a 100644 --- a/src/amd/vulkan/layers/radv_rra_layer.c +++ b/src/amd/vulkan/layers/radv_rra_layer.c @@ -93,7 +93,7 @@ rra_QueuePresentKHR(VkQueue _queue, const VkPresentInfoKHR *pPresentInfo) { RADV_FROM_HANDLE(radv_queue, queue, _queue); VkResult result = queue->device->layer_dispatch.rra.QueuePresentKHR(_queue, pPresentInfo); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) return result; radv_rra_handle_trace(_queue); diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c index ab0e331869c..0aa4929c91f 100644 --- a/src/amd/vulkan/layers/radv_sqtt_layer.c +++ b/src/amd/vulkan/layers/radv_sqtt_layer.c @@ -588,7 +588,7 @@ sqtt_QueuePresentKHR(VkQueue _queue, const VkPresentInfoKHR *pPresentInfo) VkResult result; result = queue->device->layer_dispatch.rgp.QueuePresentKHR(_queue, pPresentInfo); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR) return result; radv_handle_thread_trace(_queue);