Henri Verbeet : wined3d: Move the swapchain fps counter to wined3d_cs_exec_present().
Alexandre Julliard
julliard at winehq.org
Thu May 21 15:41:21 CDT 2020
Module: wine
Branch: master
Commit: b65ca133052ed9053e48c571155a764d4d711277
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b65ca133052ed9053e48c571155a764d4d711277
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Thu May 21 23:39:38 2020 +0430
wined3d: Move the swapchain fps counter to wined3d_cs_exec_present().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/cs.c | 16 ++++++++++++++++
dlls/wined3d/swapchain.c | 33 ---------------------------------
2 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 113b8ff84f..89e59b5373 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -21,6 +21,7 @@
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
+WINE_DECLARE_DEBUG_CHANNEL(fps);
#define WINED3D_INITIAL_CS_SIZE 4096
@@ -529,6 +530,21 @@ static void wined3d_cs_exec_present(struct wined3d_cs *cs, const void *data)
swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->swap_interval, op->flags);
+ if (TRACE_ON(fps))
+ {
+ DWORD time = GetTickCount();
+ ++swapchain->frames;
+
+ /* every 1.5 seconds */
+ if (time - swapchain->prev_time > 1500)
+ {
+ TRACE_(fps)("%p @ approx %.2ffps\n",
+ swapchain, 1000.0 * swapchain->frames / (time - swapchain->prev_time));
+ swapchain->prev_time = time;
+ swapchain->frames = 0;
+ }
+ }
+
wined3d_resource_release(&swapchain->front_buffer->resource);
for (i = 0; i < swapchain->state.desc.backbuffer_count; ++i)
{
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 0af6e8e41c..9020a99520 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -25,7 +25,6 @@
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
-WINE_DECLARE_DEBUG_CHANNEL(fps);
void wined3d_swapchain_cleanup(struct wined3d_swapchain *swapchain)
{
@@ -565,21 +564,6 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain,
wined3d_swapchain_gl_rotate(swapchain, context);
TRACE("SwapBuffers called, Starting new frame\n");
- /* FPS support */
- if (TRACE_ON(fps))
- {
- DWORD time = GetTickCount();
- ++swapchain->frames;
-
- /* every 1.5 seconds */
- if (time - swapchain->prev_time > 1500)
- {
- TRACE_(fps)("%p @ approx %.2ffps\n",
- swapchain, 1000.0 * swapchain->frames / (time - swapchain->prev_time));
- swapchain->prev_time = time;
- swapchain->frames = 0;
- }
- }
wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATION_DRAWABLE);
wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOCATION_DRAWABLE);
@@ -702,23 +686,6 @@ static void swapchain_gdi_present(struct wined3d_swapchain *swapchain,
back->bitmap = bitmap;
swapchain->back_buffers[0]->resource.heap_memory = data;
- /* FPS support */
- if (TRACE_ON(fps))
- {
- static LONG prev_time, frames;
- DWORD time = GetTickCount();
-
- ++frames;
-
- /* every 1.5 seconds */
- if (time - prev_time > 1500)
- {
- TRACE_(fps)("@ approx %.2ffps\n", 1000.0 * frames / (time - prev_time));
- prev_time = time;
- frames = 0;
- }
- }
-
SetRect(&swapchain->front_buffer_update, 0, 0,
swapchain->front_buffer->resource.width,
swapchain->front_buffer->resource.height);
More information about the wine-cvs
mailing list