Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- 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 113b8ff84f6..89e59b5373a 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 0af6e8e41c5..9020a995209 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);