On Wed, 25 Jul 2012 15:19:23 +0200
Olivier Blin <olivier.b...@softathome.com> wrote:

> ---
>  clients/gears.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/clients/gears.c b/clients/gears.c
> index 70ec86c..19165e7 100644
> --- a/clients/gears.c
> +++ b/clients/gears.c
> @@ -59,6 +59,8 @@ struct gears {
>  
>       GLint gear_list[3];
>       int fullscreen;
> +     int frames;
> +     uint32_t last_fps;
>  };
>  
>  struct gear_template {
> @@ -203,10 +205,33 @@ make_gear(const struct gear_template *t)
>  }
>  
>  static void
> +update_fps(struct gears *gears, uint32_t time)
> +{
> +     long diff_ms;
> +
> +     gears->frames++;
> +
> +     diff_ms = time - gears->last_fps;
> +
> +     if (diff_ms > 5000) {
> +             float seconds = diff_ms / 1000.0;
> +             float fps = gears->frames / seconds;
> +
> +             printf("%d frames in %6.3f seconds = %6.3f FPS\n", 
> gears->frames, seconds, fps);

Gears will now need the same disclaimer as glxgears has,
otherwise end users will start using this as a generic
Wayland performance benchmark. I can imagine some
headlines on Phoronix when they compare Wayland gears with
glxgears and draw wildly incorrect conclusions.

I hope you will add a message explaining what this "fps" number
really means and what it can be used for.


Thanks,
pq
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to