Skip to content

Commit

Permalink
radv: Handle VK_SUBOPTIMAL_KHR in trace layers
Browse files Browse the repository at this point in the history
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24052>
(cherry picked from commit b8edd19)
  • Loading branch information
pixelcluster authored and 1ace committed Aug 16, 2023
1 parent de8707b commit 793d8b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pick_status.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion src/amd/vulkan/layers/radv_rmv_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/amd/vulkan/layers/radv_rra_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/amd/vulkan/layers/radv_sqtt_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 793d8b8

Please sign in to comment.