Commit ad8bd91a authored by Juliet fru's avatar Juliet fru Committed by Brian Paul

Replaced assert(glGetError()) with gl_check_gl_error()

Report PIGLIT_FAIL if there's an unexpected error.
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
parent a636a361
......@@ -10,9 +10,6 @@ See https://bugs.freedesktop.org/show_bug.cgi?id=65676 for more details.
Move/rename tests in the bugs/ directory to proper places under tests/spec/
Replace calls such as assert(glGetError() == 0) with piglit_check_gl_error().
Quite a few tests have GL enum names encoded in tables. For example, in
tests/texturing/texture-rg.c:
......
......@@ -55,7 +55,8 @@ piglit_init(int argc, char**argv)
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 4, &data, GL_STATIC_DRAW_ARB);
glDeleteBuffersARB(1, &buf);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Then, another normal path: create, map, write, unmap, delete */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
......@@ -64,7 +65,8 @@ piglit_init(int argc, char**argv)
*v = data;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
glDeleteBuffersARB(1, &buf);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Then, do the failing path: create, map, delete */
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf);
......@@ -72,7 +74,8 @@ piglit_init(int argc, char**argv)
v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
*v = data;
glDeleteBuffersARB(1, &buf);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
piglit_report_result(PIGLIT_PASS);
}
......
......@@ -56,7 +56,8 @@ create_1d_fbo(void)
BUF_WIDTH,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -67,7 +68,8 @@ create_1d_fbo(void)
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -76,7 +76,8 @@ create_3d_fbo(void)
BUF_WIDTH, BUF_HEIGHT, pot_depth,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -90,7 +91,8 @@ create_3d_fbo(void)
0,
depth);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -73,7 +73,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -172,7 +172,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
printf("Testing %s", format->name);
......
......@@ -51,7 +51,8 @@ static void create_fbo(GLuint *out_tex)
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
BUF_WIDTH, BUF_WIDTH, 0,
GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
......@@ -76,7 +77,8 @@ static void create_fbo(GLuint *out_tex)
glClearDepth(0.0);
glClear(GL_DEPTH_BUFFER_BIT);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
......
......@@ -66,7 +66,8 @@ static void create_fbo(GLuint *out_tex)
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
BUF_WIDTH, BUF_WIDTH, 0,
GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
......@@ -91,7 +92,8 @@ static void create_fbo(GLuint *out_tex)
glClearDepth(0.0);
glClear(GL_DEPTH_BUFFER_BIT);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.5f);
......
......@@ -93,14 +93,16 @@ create_array_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* allocate empty array texture */
glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, 0, GL_RGBA,
BUF_WIDTH, BUF_HEIGHT, num_layers,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -113,7 +115,8 @@ create_array_fbo(void)
0,
layer);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -280,7 +280,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
printf("Testing %s", format->name);
......
......@@ -81,7 +81,8 @@ make_fbo(int w, int h)
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......@@ -229,7 +230,8 @@ run_test(void)
GL_DEPTH_BUFFER_BIT);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
printf("Verify 1\n");
pass = verify_depth_rect(PAD, y0, SIZE, SIZE) && pass;
......@@ -243,7 +245,8 @@ run_test(void)
printf("Verify 5 (FBO)\n");
pass = verify_depth_rect(PAD, y1, SIZE, SIZE) && pass;
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
piglit_present_results();
......
......@@ -353,7 +353,8 @@ run_test(const TestCase &test)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
......
......@@ -77,7 +77,8 @@ make_fbo(int w, int h)
target,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -76,7 +76,8 @@ piglit_init(int argc, char **argv)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
......@@ -104,7 +105,8 @@ piglit_init(int argc, char **argv)
0.0);
glClear(GL_COLOR_BUFFER_BIT);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
}
done:
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
......
......@@ -145,7 +145,8 @@ static enum piglit_result test_format(const struct format_desc *format)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
printf("Testing %s", format->name);
......
......@@ -72,7 +72,8 @@ make_fbo(int w, int h)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -67,7 +67,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -76,7 +77,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -68,7 +68,8 @@ create_fbo(void)
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Draw into the second level. */
glGenFramebuffersEXT(1, &fb);
......@@ -78,7 +79,8 @@ create_fbo(void)
GL_TEXTURE_2D,
tex,
1);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -82,7 +82,8 @@ create_cube_fbo(void)
level++;
}
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -97,7 +98,8 @@ create_cube_fbo(void)
tex,
level);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -225,13 +225,15 @@ create_array_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* allocate empty array texture */
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_DEPTH24_STENCIL8,
width, height, layers, 0,
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffers(1, &fb);
glBindFramebuffer(GL_FRAMEBUFFER, fb);
......@@ -271,7 +273,8 @@ create_array_fbo(void)
0,
layer);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
......@@ -347,7 +350,8 @@ create_array_fbo(void)
done:
glDeleteFramebuffers(1, &fb);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......@@ -385,7 +389,8 @@ draw_layer(int x, int y, int depth)
(double)height / piglit_height * 2,
0, 0, 1, 1);
glUseProgram(0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
}
static GLboolean test_layer_drawing(int start_x, int start_y, float expected)
......@@ -433,7 +438,8 @@ test_once(void)
}
glDeleteTextures(1, &tex);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return pass;
}
......@@ -506,5 +512,6 @@ void piglit_init(int argc, char **argv)
program_fs_empty = piglit_build_simple_program(vs_text,
frag_shader_empty_text);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
}
......@@ -83,7 +83,8 @@ create_fbo(void)
glTexImage2D(TexTarget, 0, depthIntFormat,
SIZE, SIZE, 0,
GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGetTexLevelParameteriv(TexTarget, 0, GL_TEXTURE_DEPTH_SIZE, &Zbits);
/* color texture */
......@@ -94,7 +95,8 @@ create_fbo(void)
glTexImage2D(TexTarget, 0, GL_RGBA,
SIZE, SIZE, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Create FBO */
glGenFramebuffersEXT(1, &FBO);
......@@ -112,7 +114,8 @@ create_fbo(void)
DepthTex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......@@ -315,7 +318,8 @@ show_depth_fbo(void)
glWindowPos2i(SIZE, 0);
glDrawPixels(SIZE, SIZE, GL_LUMINANCE, GL_FLOAT, zf);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
#if DEBUG
{
......
......@@ -84,13 +84,15 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
BUF_WIDTH,
0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Create the depth-stencil buffer. */
glGenTextures(1, &ds);
glBindTexture(GL_TEXTURE_1D, ds);
glTexImage1D(GL_TEXTURE_1D, 0, f.iformat, BUF_WIDTH, 0, f.format, f.type, NULL);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
/* Create the FBO. */
glGenFramebuffersEXT(1, &fb);
......@@ -116,7 +118,8 @@ static void create_1d_fbo(GLuint *out_tex, GLuint *out_ds)
0);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -311,7 +311,8 @@ enum piglit_result piglit_display(void)
piglit_present_results();
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return res;
}
......
......@@ -480,7 +480,8 @@ enum piglit_result piglit_display(void)
piglit_present_results();
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return res;
}
......
......@@ -69,7 +69,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -104,7 +104,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -77,7 +77,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -105,7 +105,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -61,7 +61,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -60,7 +60,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -62,7 +62,8 @@ attach_texture(int i)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
return tex;
}
......
......@@ -72,7 +72,8 @@ void piglit_init(int argc, char **argv)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
......
......@@ -78,7 +78,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
GL_FRAMEBUFFER_COMPLETE_EXT);
......
......@@ -78,7 +78,8 @@ piglit_display(void)
GL_TEXTURE_2D,
tex,
0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) ==
GL_FRAMEBUFFER_COMPLETE_EXT);
......
......@@ -57,13 +57,15 @@ create_fbo(unsigned width, unsigned height, GLuint *out_tex)
0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, tex, 0);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......@@ -121,7 +123,8 @@ piglit_display(void)
glDeleteTextures(1, &tex);
glDeleteFramebuffersEXT(1, &fb);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
for (y = 0; y < piglit_height; y++) {
for (x = 0; x < piglit_width; x++) {
......
......@@ -135,14 +135,16 @@ create_array_fbo_1d(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_1D_ARRAY_EXT, tex);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
glTexImage2D(GL_TEXTURE_1D_ARRAY_EXT, i, format,
dim, num_layers, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -153,7 +155,8 @@ create_array_fbo_1d(void)
tex,
0,
layer);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......@@ -222,14 +225,16 @@ create_array_fbo_2d(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D_ARRAY_EXT, tex);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
for (i = 0, dim = TEX_WIDTH; dim >0; i++, dim /= 2) {
glTexImage3D(GL_TEXTURE_2D_ARRAY_EXT, i, format,
dim, dim, num_layers, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenFramebuffersEXT(1, &fb);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
......@@ -240,7 +245,8 @@ create_array_fbo_2d(void)
tex,
0,
layer);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
......
......@@ -82,7 +82,8 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
if ((baseformat == GL_DEPTH_COMPONENT) || (baseformat == GL_DEPTH_STENCIL)) {
tex = piglit_depth_texture(GL_TEXTURE_2D, internalformat,
tex_width, tex_height, 1, GL_FALSE);
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
if (internalformat == GL_DEPTH32F_STENCIL8) {
format = GL_DEPTH_STENCIL;
type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
......@@ -117,7 +118,8 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
0,
format, type, NULL);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
glGenerateMipmapEXT(GL_TEXTURE_2D);
......@@ -226,7 +228,8 @@ draw_mipmap(int x, int y, int level, GLenum basetype)
b||l||i||d ? 0.5 : 1,
a||i ? 0.5 : 1);
}
assert(glGetError() == 0);
if (!piglit_check_gl_error(GL_NO_ERROR))