[PATCH] WineX11: add a run-total fps counter to the fps debug =
Stefan Doesinger
stefan at codeweavers.com
Sun Aug 24 22:45:21 CDT 2008
channel=0A=
=0A=
The ATI driver developers want to run their DirectX techdemos=0A=
under wine and collect some automated performance data. They=0A=
asked if I can modify the fps debug channel to add all rendered=0A=
frames up to get a performance counter over the entire run of an=0A=
application. I don't see any problem with this.=0A=
---=0A=
dlls/winex11.drv/opengl.c | 8 ++++++--=0A=
1 files changed, 6 insertions(+), 2 deletions(-)=0A=
=0A=
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c=0A=
index a68591d..3f6d131 100644=0A=
--- a/dlls/winex11.drv/opengl.c=0A=
+++ b/dlls/winex11.drv/opengl.c=0A=
@@ -3486,15 +3486,19 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)=0A=
/* FPS support */=0A=
if (TRACE_ON(fps))=0A=
{=0A=
- static long prev_time, frames;=0A=
+ static long prev_time, start_time;=0A=
+ static unsigned long frames, frames_total;=0A=
=0A=
DWORD time =3D GetTickCount();=0A=
frames++;=0A=
+ frames_total++;=0A=
/* every 1.5 seconds */=0A=
if (time - prev_time > 1500) {=0A=
- TRACE_(fps)("@ approx %.2ffps\n", 1000.0*frames/(time - =
prev_time));=0A=
+ TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n",=0A=
+ 1000.0*frames/(time - prev_time), =
1000.0*frames_total/(time - start_time));=0A=
prev_time =3D time;=0A=
frames =3D 0;=0A=
+ if(start_time =3D=3D 0) start_time =3D time;=0A=
}=0A=
}=0A=
=0A=
-- =0A=
1.5.6.4=0A=
=0A=
------=_NextPart_000_0007_01C90695.8A4018C0--
More information about the wine-patches
mailing list