Commit 551b535c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winevulkan: Move vkQueuePresent FPS trace out of the drivers.

parent de4edeaa
......@@ -46,8 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
#ifdef SONAME_LIBVULKAN
WINE_DECLARE_DEBUG_CHANNEL(fps);
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
#define VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK 1000123000
......@@ -248,30 +246,7 @@ static VkResult macdrv_vkGetSwapchainImagesKHR(VkDevice device,
static VkResult macdrv_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info)
{
TRACE("%p, %p\n", queue, present_info);
VkResult res = pvkQueuePresentKHR(queue, present_info);
if (TRACE_ON(fps))
{
static unsigned long frames, frames_total;
static long prev_time, start_time;
DWORD time;
time = NtGetTickCount();
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;
return pvkQueuePresentKHR(queue, present_info);
}
static const char *macdrv_get_host_surface_extension(void)
......
......@@ -31,6 +31,7 @@
#include "ntuser.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
WINE_DECLARE_DEBUG_CHANNEL(fps);
static PFN_vkCreateInstance p_vkCreateInstance;
static PFN_vkEnumerateInstanceVersion p_vkEnumerateInstanceVersion;
......@@ -1705,6 +1706,28 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr
if (swapchains != swapchains_buffer) free(swapchains);
if (TRACE_ON(fps))
{
static unsigned long frames, frames_total;
static long prev_time, start_time;
DWORD time;
time = NtGetTickCount();
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;
}
......
......@@ -47,7 +47,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
#ifdef SONAME_LIBVULKAN
WINE_DECLARE_DEBUG_CHANNEL(fps);
static pthread_mutex_t vulkan_mutex;
......@@ -263,34 +262,8 @@ 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);
res = pvkQueuePresentKHR(queue, present_info);
if (TRACE_ON(fps))
{
static unsigned long frames, frames_total;
static long prev_time, start_time;
DWORD time;
time = NtGetTickCount();
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;
return pvkQueuePresentKHR(queue, present_info);
}
static const char *X11DRV_get_host_surface_extension(void)
......
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