[Piglit] [PATCH v3 2/5] Split piglit_get_gl_version() into two functions.
Brian Paul
brianp at vmware.com
Fri Oct 14 07:47:04 PDT 2011
On 10/13/2011 02:45 PM, Paul Berry wrote:
> Previously, piglit_get_gl_version() had three return values: the GL
> version (major and minor version numbers separately) and a boolean
> indicating whether or not the API is GL ES. This meant that we had to
> jump through hoops in order to use it, e.g.:
>
> /* Are we using GL with a version of at least 3.1? */
> bool es;
> int major;
> int minor;
> piglit_get_gl_version(&es,&major,&minor);
> if (!es&& (major> 3 || (major == 3&& minor>= 1)))
> ...
>
> This patch changes piglit_get_gl_version() so that it returns a single
> integer whose value is 10 times the GL version (e.g. 31 for GL version
> 3.1), and splits off the functionality for checking whether the API is
> GL ES to a new function, piglit_is_gles().
>
> Now the same logic looks like this:
>
> /* Are we using GL with a version of at least 3.1? */
> if (!piglit_is_gles()&& piglit_get_gl_version()>= 31)
> ...
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the Piglit
mailing list