Commit 8f104ee6 authored by Kenneth Graunke's avatar Kenneth Graunke

Add a piglit_require_GLSL_version(int version) helper function.

Many tests want to check for a specific GLSL version.  This helper
function makes that really easy: piglit_require_GLSL_version(130);
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 3f040233
......@@ -204,6 +204,24 @@ piglit_require_GLSL(void)
}
}
void
piglit_require_GLSL_version(int version)
{
bool es;
int major, minor;
piglit_require_GLSL();
piglit_get_glsl_version(&es, &major, &minor);
if (es || 100 * major + minor < version) {
printf("GLSL %d.%d not supported.\n",
version / 100, version % 100);
piglit_report_result(PIGLIT_SKIP);
exit(1);
}
}
void
piglit_require_vertex_shader(void)
{
......
......@@ -311,6 +311,13 @@ extern PFNGLUNIFORMMATRIX4X3FVPROC piglit_UniformMatrix4x3fv;
#endif
/*@}*/
/**
* Require a specific version of GLSL.
*
* \param version Integer version, for example 130
*/
extern void piglit_require_GLSL_version(int version);
/** Require any version of GLSL */
extern void piglit_require_GLSL(void);
extern void piglit_require_fragment_shader(void);
extern void piglit_require_vertex_shader(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment