Commit ed809071 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

winex11: Add simple fps counter for Vulkan.

The fps counter is implemented in winex11 because winevulkan thunks can be bypassed. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4b90a46e
......@@ -41,6 +41,7 @@
#include "wine/vulkan_driver.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
WINE_DECLARE_DEBUG_CHANNEL(fps);
#ifdef SONAME_LIBVULKAN
......@@ -513,8 +514,34 @@ static VkResult X11DRV_vkGetSwapchainImagesKHR(VkDevice device,
static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info)
{
VkResult res;
TRACE("%p, %p\n", queue, present_info);
return pvkQueuePresentKHR(queue, present_info);
res = pvkQueuePresentKHR(queue, present_info);
if (TRACE_ON(fps))
{
static unsigned long frames, frames_total;
static long prev_time, start_time;
DWORD time;
time = GetTickCount();
frames++;
frames_total++;
if (time - prev_time > 1500)
{
TRACE_(fps)("%p @ approx %.2ffps, total %.2ffps\n",
queue, 1000.0 * frames / (time - prev_time),
1000.0 * frames_total / (time - start_time));
prev_time = time;
frames = 0;
if (!start_time)
start_time = time;
}
}
return res;
}
static const struct vulkan_funcs vulkan_funcs =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment