Skip to content

Commit

Permalink
Merge pull request libretro#3016 from Themaister/master
Browse files Browse the repository at this point in the history
Add perf counter to fence waits.
  • Loading branch information
inactive123 committed May 21, 2016
2 parents 6b0c978 + 218ecc0 commit 72e1a33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gfx/common/vulkan_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <dynamic/dylib.h>

#include "vulkan_common.h"
#include "../../performance_counters.h"

vulkan_context_fp_t vkcfp;

Expand Down Expand Up @@ -1699,7 +1700,13 @@ void vulkan_acquire_next_image(gfx_ctx_vulkan_data_t *vk)

if (*next_fence != VK_NULL_HANDLE)
{
static struct retro_perf_counter fence_wait = {0};
rarch_perf_init(&fence_wait, "fence_wait");

retro_perf_start(&fence_wait);
VKFUNC(vkWaitForFences)(vk->context.device, 1, next_fence, true, UINT64_MAX);
retro_perf_stop(&fence_wait);

VKFUNC(vkResetFences)(vk->context.device, 1, next_fence);
}
else
Expand Down Expand Up @@ -1765,7 +1772,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
else
swapchain_size = surface_properties.currentExtent;

desired_swapchain_images = surface_properties.minImageCount + 1;
desired_swapchain_images = surface_properties.minImageCount + 1;

/* Limit latency. */
if (desired_swapchain_images > 3)
Expand Down

0 comments on commit 72e1a33

Please sign in to comment.