Skip to content

Commit

Permalink
Add perf counter to fence waits.
Browse files Browse the repository at this point in the history
Makes it easy to check if we're GPU bound or not.
  • Loading branch information
Hans-Kristian Arntzen committed May 21, 2016
1 parent 30e4590 commit 218ecc0
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 @@ -1672,7 +1673,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 @@ -1738,7 +1745,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 218ecc0

Please sign in to comment.