Commit 2b53dc19 authored by Chris Forbes's avatar Chris Forbes

Convert simple if(piglit_get_gl_version() < N) { SKIP } to require

Generated from the following semantic patch:

@@
expression VER;
expression MSG;
@@

-	if (piglit_get_gl_version() < VER) {
-		printf(MSG);
-		piglit_report_result(PIGLIT_SKIP);
(
-		exit(1);
|
)
-	}

+   piglit_require_gl_version(VER);
Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Signed-off-by: Chris Forbes's avatarChris Forbes <chrisf@ijw.co.nz>
parent 19399323
......@@ -61,10 +61,7 @@ piglit_init(int argc, char **argv)
(void) argc;
(void) argv;
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
loadTex();
......
......@@ -10,10 +10,7 @@ piglit_init(int argc, char *argv[])
{
GLuint id;
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
piglit_require_extension("GL_ARB_vertex_buffer_object");
......
......@@ -162,10 +162,7 @@ void piglit_init(int argc, char **argv)
{
GLuint fs, vs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_framebuffer_object");
......
......@@ -211,10 +211,7 @@ piglit_display(void)
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -230,10 +230,7 @@ piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_framebuffer_object");
piglit_require_extension("GL_ARB_draw_buffers");
......
......@@ -179,10 +179,7 @@ piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_framebuffer_object");
piglit_require_extension("GL_ARB_draw_buffers");
......
......@@ -187,10 +187,7 @@ piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_framebuffer_object");
piglit_require_extension("GL_ARB_draw_buffers");
......
......@@ -141,10 +141,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
vs = piglit_compile_shader(GL_VERTEX_SHADER,
"shaders/glsl-mvp.vert");
......
......@@ -209,10 +209,7 @@ piglit_init(int argc, char**argv)
{
GLuint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_framebuffer_object");
......
......@@ -214,10 +214,7 @@ piglit_display(void)
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -52,10 +52,7 @@ static GLubyte colors[16] = {255, 0, 0, 127,
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
piglit_require_extension("GL_EXT_vertex_array_bgra");
......
......@@ -110,10 +110,7 @@ compileLinkProg(void)
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_vertex_array_bgra");
......
......@@ -132,10 +132,7 @@ piglit_init(int argc, char **argv)
piglit_report_result(PIGLIT_SKIP);
}
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
printf("\nAll 4 quads should be the same color.\n");
glEnable(GL_BLEND);
......
......@@ -129,10 +129,7 @@ piglit_init(int argc, char **argv)
{
GLuint vert_prog, frag_prog;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
reshape(piglit_width, piglit_height);
......
......@@ -32,10 +32,7 @@ PIGLIT_GL_TEST_MAIN(
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 14) {
printf("Requires OpenGL 1.4.\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(14);
}
static void rotate_colors(float *array)
......
......@@ -46,10 +46,7 @@ void piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
piglit_require_extension("GL_ARB_draw_elements_base_vertex");
......
......@@ -49,10 +49,7 @@ piglit_init(int argc, char **argv)
{
GLfloat red[4] = {1, 0, 0, 1};
if (piglit_get_gl_version() < 12) {
printf("Requires OpenGL 1.2\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(12);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, red);
......
......@@ -51,10 +51,7 @@ void piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
glShadeModel(GL_FLAT);
glClearColor(0.2, 0.2, 0.2, 1.0);
......
......@@ -51,10 +51,7 @@ void piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
piglit_require_extension("GL_ARB_half_float_vertex");
glShadeModel(GL_FLAT);
......
......@@ -51,10 +51,7 @@ void piglit_init(int argc, char **argv)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
glShadeModel(GL_FLAT);
glClearColor(0.2, 0.2, 0.2, 1.0);
......
......@@ -144,10 +144,7 @@ piglit_init(int argc, char **argv)
{
int i;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0 / GLSL\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
shader[0] = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fpFragDepthText);
assert(shader[0]);
......
......@@ -101,8 +101,5 @@ piglit_display(void)
void
piglit_init(int argc, char**argv)
{
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
}
......@@ -128,10 +128,7 @@ piglit_init(int argc, char **argv)
{
GLint query_bits;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
/* It is legal for a driver to support the query API but not have
* any query bits. I wonder how many applications actually check for
......
......@@ -384,10 +384,7 @@ init(void)
void
piglit_init(int argc, char *argv[])
{
if (piglit_get_gl_version() < 13) {
printf("Requires OpenGL 1.3\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(13);
init();
}
......
......@@ -69,10 +69,7 @@ piglit_init(int argc, char **argv)
};
GLubyte indices[] = {0, 1, 2, 3};
if (piglit_get_gl_version() < 15) {
printf("Requires OpenGL 1.5\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(15);
piglit_require_extension("GL_ARB_vertex_array_object");
......
......@@ -56,10 +56,7 @@ piglit_init(int argc, char **argv)
GLuint prog;
GLuint vs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_separate_shader_objects");
......
......@@ -51,10 +51,7 @@ piglit_init(int argc, char **argv)
GLuint got;
GLuint vs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_separate_shader_objects");
......
......@@ -52,10 +52,7 @@ piglit_init(int argc, char **argv)
GLuint prog;
GLenum err;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_separate_shader_objects");
......
......@@ -112,10 +112,7 @@ piglit_init(int argc, char **argv)
? 0 : GL_INVALID_ENUM;
GLboolean pass;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_EXT_separate_shader_objects");
......
......@@ -271,10 +271,7 @@ piglit_init(int argc, char **argv)
GLubyte rectangle[200][200][4];
GLubyte tex[256*256][4];
if (piglit_get_gl_version() < 13) {
printf("Requires OpenGL 1.3\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(13);
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
......
......@@ -240,10 +240,7 @@ piglit_init(int argc, char **argv)
GLuint texname;
GLubyte tex[4][4][4];
if (piglit_get_gl_version() < 13) {
printf("Requires OpenGL 1.3\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(13);
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
......
......@@ -63,10 +63,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_fragment_coord_conventions");
......
......@@ -127,9 +127,5 @@ piglit_init(int argc, char **argv)
{
piglit_require_vertex_shader();
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
exit(1);
}
piglit_require_gl_version(20);
}
......@@ -111,9 +111,6 @@ enum piglit_result piglit_display(void)
void piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
}
......@@ -89,10 +89,7 @@ static const char *fragShaderText2 =
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
compileLinkProg();
......
......@@ -88,10 +88,7 @@ static const char *fragShaderText2 =
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -96,11 +96,7 @@ piglit_display(void)
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
exit(1);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
}
......@@ -75,8 +75,5 @@ piglit_display(void)
void
piglit_init(int argc, char **argv)
{
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
}
......@@ -50,10 +50,7 @@ void piglit_init(int argc, char **argv)
GLint prog;
GLboolean ok;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_explicit_attrib_location");
......
......@@ -53,10 +53,7 @@ void piglit_init(int argc, char **argv)
GLint loc;
GLboolean ok;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_explicit_attrib_location");
......
......@@ -50,10 +50,7 @@ void piglit_init(int argc, char **argv)
GLint prog;
GLboolean ok;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_explicit_attrib_location");
......
......@@ -47,10 +47,7 @@ void piglit_init(int argc, char **argv)
GLint prog;
GLboolean ok;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_explicit_attrib_location");
......
......@@ -52,10 +52,7 @@ void piglit_init(int argc, char **argv)
GLboolean ok;
GLint loc;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_require_extension("GL_ARB_explicit_attrib_location");
......
......@@ -74,10 +74,7 @@ piglit_init(int argc, char **argv)
float black[4] = {0.0, 0.0, 0.0, 0.0};
float white[4] = {1.0, 1.0, 1.0, 0.0};
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -68,10 +68,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -96,10 +96,7 @@ piglit_init(int argc, char **argv)
{
GLuint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
vs = piglit_compile_shader(GL_VERTEX_SHADER,
"shaders/glsl-color-mvp.vert");
......
......@@ -72,10 +72,7 @@ piglit_init(int argc, char **argv)
" gl_FragColor = gl_Fog.color;\n"
"}\n";
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
vs = piglit_compile_shader(GL_VERTEX_SHADER,
"shaders/glsl-mvp.vert");
......
......@@ -115,10 +115,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs, prog;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -137,10 +137,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs, prog;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
......
......@@ -74,10 +74,7 @@ piglit_init(int argc, char **argv)
{
GLint vs, fs;
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -106,10 +106,7 @@ piglit_init(int argc, char **argv)
*/
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
piglit_require_gl_version(20);
vs = piglit_compile_shader(GL_VERTEX_SHADER,
"shaders/glsl-mvp.vert");
......
......@@ -104,10 +104,7 @@ piglit_init(int argc, char **argv)
*/
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
if (piglit_get_gl_version() < 20) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}