[Mesa-dev] [PATCH 4/6] glxgears: Notify user if direct rendering or hardware acceleration is not available and that this not a benchmark.

Jose Fonseca jfonseca at vmware.com
Wed Nov 23 03:32:52 PST 2011


glxgears is a benchmark, just doesn't benchmark what people often expect. I often use it as a present/swapbuffers benchmark. So the whole blurb about not using glxgears as a benchmark is false.

Again, detecting software rendering by the string is unreliable.

Maybe it help if you could provide some context for your motivation for doing this.  Is the purpose here educate users, or avoid invalid bug reports, or what?


The warning about direct rendering is ok, but should be printed to stderr, and no need for capital "WARNING" as glxgears doesn't produces almost no output so any warning should standout easily.


Jose

----- Original Message -----
> From: Matthias Hopf <mhopf at suse.de>
> 
> ---
>  src/xdemos/glxgears.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/src/xdemos/glxgears.c b/src/xdemos/glxgears.c
> index cff92b0..c64c2c9 100644
> --- a/src/xdemos/glxgears.c
> +++ b/src/xdemos/glxgears.c
> @@ -766,6 +766,14 @@ main(int argc, char *argv[])
>        printf("GL_EXTENSIONS = %s\n", (char *)
>        glGetString(GL_EXTENSIONS));
>     }
>  
> +   if (! glXIsDirect(dpy, ctx))
> +      printf ("\n***\n*** WARNING: Direct Rendering is NOT
> enabled\n***\n");
> +   else if (strcasestr ((char *) glGetString(GL_RENDERER),
> "software"))
> +      printf ("\n***\n*** WARNING: Hardware acceleration is NOT
> active\n***\n");
> +   printf ("\n*** NOTE: Don't use glxgears as a benchmark.\n"
> +	   "    OpenGL implementations are not optimized for frame rates >>
> 60fps,\n"
> +	   "    thus these numbers are meaningless when compared between
> vendors.\n\n");
> +
>     init();
>  
>     /* Set initial projection/viewing transformation.
> --
> 1.7.7
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list