Commit dcda816d authored by Marek Olšák's avatar Marek Olšák

Always bind piglit_winsys_fbo instead of 0

Tested-by: Dylan Baker's avatarDylan Baker <baker.dylan.c@gmail.com>
parent 273da108
......@@ -98,7 +98,7 @@ draw_fbo_1d(int x, int y)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_1D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -124,7 +124,7 @@ draw_depth(int x, int y, int depth)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_3D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -116,7 +116,7 @@ piglit_display(void)
pass = piglit_probe_pixel_rgba(fbo_width * 7 / 8, 0, fbo_gray) && pass;
/* Draw the two textures to halves of the window. */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, piglit_width, piglit_height);
glEnable(GL_TEXTURE_2D);
......
......@@ -114,7 +114,7 @@ enum piglit_result piglit_display(void)
glBindTexture(GL_TEXTURE_2D, tex);
glViewport(0, 0, piglit_width, piglit_height);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -131,7 +131,7 @@ enum piglit_result piglit_display(void)
glBindTexture(GL_TEXTURE_2D, tex);
glViewport(0, 0, piglit_width, piglit_height);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -151,7 +151,7 @@ draw_layer(int x, int y, int depth)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
......
......@@ -179,7 +179,7 @@ run_test(void)
fbo = make_fbo(fbo_width, fbo_height);
/* query depth/stencil sizes */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glGetIntegerv(GL_DEPTH_BITS, &win_depth_bits);
glGetIntegerv(GL_STENCIL_BITS, &win_stencil_bits);
......@@ -196,7 +196,7 @@ run_test(void)
}
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, fbo_width, fbo_height);
piglit_ortho_projection(fbo_width, fbo_height, GL_FALSE);
glClearDepth(0.54321);
......@@ -211,7 +211,7 @@ run_test(void)
* Also blit with stencil to exercise this path.
* Not that we need it for this test.
*/
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE,
......@@ -222,19 +222,19 @@ run_test(void)
/* WIN(bottom) -> FBO(middle) */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE,
GL_DEPTH_BUFFER_BIT);
/* FBO(middle) -> WIN(top) back to verify WIN -> FBO */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y1, x0 + SIZE, y1 + SIZE,
x0, y2, x0 + SIZE, y2 + SIZE,
GL_DEPTH_BUFFER_BIT);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
assert(glGetError() == 0);
printf("Verify 1\n");
......@@ -248,7 +248,7 @@ run_test(void)
pass = verify_depth_rect(PAD, y0, SIZE, SIZE) && pass;
printf("Verify 5 (FBO)\n");
pass = verify_depth_rect(PAD, y1, SIZE, SIZE) && pass;
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
assert(glGetError() == 0);
piglit_present_results();
......
......@@ -363,7 +363,7 @@ run_test(const TestCase &test)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
blit(test);
......
......@@ -163,7 +163,7 @@ run_test(void)
fbo = make_fbo(fbo_width, fbo_height);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, fbo_width, fbo_height);
piglit_ortho_projection(fbo_width, fbo_height, GL_FALSE);
glClearColor(1.0, 0.0, 1.0, 0.0);
......@@ -175,25 +175,25 @@ run_test(void)
/* Now that we have correct samples, blit things around.
* FBO(bottom) -> WIN(middle)
*/
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* WIN(bottom) -> FBO(middle) */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* FBO(middle) -> WIN(top) back to verify WIN -> FBO */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y1, x0 + SIZE, y1 + SIZE,
x0, y2, x0 + SIZE, y2 + SIZE);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
pass = verify_color_rect(PAD, y0, SIZE, SIZE) && pass;
pass = verify_color_rect(PAD, y1, SIZE, SIZE) && pass;
......@@ -201,7 +201,7 @@ run_test(void)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
pass = verify_color_rect(PAD, y0, SIZE, SIZE) && pass;
pass = verify_color_rect(PAD, y1, SIZE, SIZE) && pass;
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
piglit_present_results();
......
......@@ -118,7 +118,7 @@ draw_mipmap(int x, int y, int dim)
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -162,7 +162,7 @@ run_test(void)
fbo = make_fbo(fbo_width, fbo_height);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, fbo_width, fbo_height);
piglit_ortho_projection(fbo_width, fbo_height, GL_FALSE);
glClearColor(1.0, 0.0, 1.0, 0.0);
......@@ -174,25 +174,25 @@ run_test(void)
/* Now that we have correct samples, blit things around.
* FBO(bottom) -> WIN(middle)
*/
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* WIN(bottom) -> FBO(middle) */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* FBO(middle) -> WIN(top) back to verify WIN -> FBO */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y1, x0 + SIZE, y1 + SIZE,
x0, y2, x0 + SIZE, y2 + SIZE);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
pass = verify_color_rect(PAD, y0, SIZE, SIZE) && pass;
pass = verify_color_rect(PAD, y1, SIZE, SIZE) && pass;
......
......@@ -123,7 +123,7 @@ piglit_display(void)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -125,7 +125,7 @@ piglit_display(void)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -131,7 +131,7 @@ draw_face(int x, int y, int dim, int face)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_CUBE_MAP);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -174,7 +174,7 @@ draw_layer(int x, int y, int depth)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
......
......@@ -259,7 +259,7 @@ render_to_fbo(void)
glDisable(GL_DEPTH_TEST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
}
......@@ -298,7 +298,7 @@ show_depth_fbo(void)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);
zf = read_float_z_image(0, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glWindowPos2i(SIZE, 0);
glDrawPixels(SIZE, SIZE, GL_LUMINANCE, GL_FLOAT, zf);
......@@ -317,7 +317,7 @@ show_depth_fbo(void)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);
zi = read_uint_z_image(0, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
find_uint_min_max_center(zi, SIZE * SIZE, &min, &max, &center);
printf("depth fbo min 0x%x max 0x%x center 0x%x\n", min, max, center);
......@@ -343,7 +343,7 @@ draw_quad_with_depth_texture(void)
t1 = SIZE;
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......@@ -382,7 +382,7 @@ draw_quad_with_depth_texture(void)
static void
draw_sphere_with_fragment_shader_compare(void)
{
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0 * SIZE, 0, SIZE, SIZE);
......
......@@ -123,7 +123,7 @@ static enum piglit_result test_clear(void)
/* Display the colorbuffer. */
if (!piglit_automatic && f.iformat) {
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBlitFramebufferEXT(0, 0, BUF_SIZE, BUF_SIZE, 0, 0, BUF_SIZE, BUF_SIZE,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
}
......
......@@ -113,7 +113,7 @@ enum piglit_result piglit_display(void)
/* Draw with the texture to make sure a sampler view is created for
* it before it's used as depth buffer by the FBO. */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindTexture(GL_TEXTURE_2D, db_tex);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, frag);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
......@@ -140,7 +140,7 @@ enum piglit_result piglit_display(void)
glEnd();
/* Draw the depth texture as greyscale to the backbuffer. */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glEnable(GL_TEXTURE_2D);
piglit_draw_rect_tex(-1.0f, -1.0f, 2.0f, 2.0f,
......
......@@ -129,7 +129,7 @@ piglit_display(void)
glUseProgram(prog);
/* Draw a square to the left half of the window */
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
glViewport(0, 0, piglit_width, piglit_height);
piglit_draw_rect(-1, -1, 1, 2);
......@@ -140,13 +140,13 @@ piglit_display(void)
/* Blit the square from the FBO to the right half of the window */
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
glBlitFramebuffer(0, 0, fbo_width, fbo_height,
piglit_width/2, 0, piglit_width, piglit_height,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
/* Check that both squares have the correct color */
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
pass = piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
expected) && pass;
......
......@@ -114,7 +114,7 @@ piglit_display(void)
piglit_draw_rect(0, 0, piglit_width, piglit_height);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
/* Draw the two green textures to halves of the window. */
glEnable(GL_TEXTURE_2D);
......
......@@ -171,7 +171,7 @@ generate_and_display_drawbuffers(int count)
/* OK, now draw each of these textures to the winsys framebuffer. */
glUseProgram(0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
......
......@@ -126,7 +126,7 @@ generate_and_display_drawbuffers(int count)
/* OK, now draw each of these textures to the winsys framebuffer. */
glUseProgram(0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
......
......@@ -161,7 +161,7 @@ generate_and_display_drawbuffers(int count)
/* OK, now draw each of these textures to the winsys framebuffer. */
glUseProgram(0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glEnable(GL_TEXTURE_2D);
......
......@@ -121,7 +121,7 @@ piglit_display(void)
expected = green;
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
/* Draw the two green textures to halves of the window. */
glEnable(GL_TEXTURE_2D);
......
......@@ -110,7 +110,7 @@ piglit_display(void)
glColor4fv(green);
piglit_draw_rect(0, 0, piglit_width, piglit_height);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glDisable(GL_BLEND);
/* Draw the two textures to halves of the window. */
......
......@@ -115,7 +115,7 @@ piglit_display(void)
piglit_draw_rect(0, 0, piglit_width, piglit_height);
}
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
/* Draw the two textures to halves of the window. */
......
......@@ -95,7 +95,7 @@ piglit_display(void)
glColor4fv(draw_colors[draw_green]);
piglit_draw_rect(-1, -1, 2, 2);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
piglit_draw_rect_tex(x_screen, y_screen,
w_screen, h_screen,
......
......@@ -97,7 +97,7 @@ piglit_display(void)
piglit_ortho_projection(TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
piglit_draw_rect(0, y, size, size);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......@@ -109,7 +109,7 @@ piglit_display(void)
piglit_ortho_projection(TEX_WIDTH, TEX_HEIGHT, GL_FALSE);
piglit_draw_rect(0, y, size, size);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -104,7 +104,7 @@ piglit_display(void)
piglit_draw_rect(-1, -1, 2, 2);
/* Draw the FBO to the screen. */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, piglit_width, piglit_height);
glClearColor(0.0, 0.0, 1.0, 0.0);
......
......@@ -166,7 +166,7 @@ test(void)
buf = malloc(piglit_width * piglit_height * 4);
glReadPixels(0, 0, piglit_width, piglit_height, GL_RGBA, GL_UNSIGNED_BYTE, buf);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glDrawBuffer(GL_BACK);
glClear(GL_COLOR_BUFFER_BIT);
glDrawPixels(piglit_width, piglit_height, GL_RGBA, GL_UNSIGNED_BYTE, buf);
......
......@@ -262,7 +262,7 @@ draw_mipmap_2d(int x, int y, int dim, int layer)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY_EXT, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
......@@ -284,7 +284,7 @@ draw_mipmap_1d(int x, int y, int dim, int layer)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glTexParameteri(GL_TEXTURE_1D_ARRAY_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexParameteri(GL_TEXTURE_1D_ARRAY_EXT, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
......
......@@ -89,7 +89,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -114,7 +114,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -108,7 +108,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -114,7 +114,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -98,7 +98,7 @@ create_fbo(void)
piglit_draw_rect(TEX_WIDTH / 2, TEX_HEIGHT / 2, TEX_WIDTH, TEX_HEIGHT);
/* Bind back to the (small) window to trigger the bug */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glGenerateMipmapEXT(GL_TEXTURE_2D);
done:
......@@ -113,7 +113,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -108,7 +108,7 @@ draw_mipmap(int x, int y, int dim)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -89,7 +89,7 @@ piglit_display(void)
/* Draw the point out if want to have a look. */
if (!piglit_automatic){
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
glClear(GL_COLOR_BUFFER_BIT);
glBlitFramebuffer(0, 0, rb_size, rb_size,
0, 0, rb_size, rb_size,
......
......@@ -87,7 +87,7 @@ piglit_init(int argc, char **argv)
/* Unbind and rebind the FBO. At one point on Mesa this triggered a
* segfault down inside the glBindFramebuffer code.
*/
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
......@@ -104,7 +104,7 @@ piglit_init(int argc, char **argv)
cleanup:
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
glDeleteTextures(1, &tex);
glDeleteFramebuffers(1, &fbo);
......
......@@ -67,8 +67,8 @@ public:
else
glBindTexture(target, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, piglit_winsys_fbo);
glBindFramebuffer(GL_READ_FRAMEBUFFER, piglit_winsys_fbo);
glDeleteTextures(1, &tex);
glDeleteRenderbuffers(1, &rb);
......
......@@ -126,7 +126,7 @@ piglit_display(void)
pass = piglit_probe_pixel_rgba(fbo_width * 7 / 8, 0, fbo_blend2) && pass;
/* Draw the two textures to halves of the window. */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, piglit_width, piglit_height);
glColor4f(1, 1, 1, 1);
......
......@@ -207,7 +207,7 @@ piglit_display(void)
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
......
......@@ -120,7 +120,7 @@ piglit_display(void)
/* visualize it */
glUseProgram(0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
glViewport(0, 0, 128, 64);
glClearColor(0,0,0.5,0);
glClear(GL_COLOR_BUFFER_BIT);
......
......@@ -85,7 +85,7 @@ piglit_display(void)
pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);
glDisable(GL_DEPTH_TEST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
piglit_draw_rect_tex(0, 0, piglit_width, piglit_height,
......
......@@ -85,7 +85,7 @@ piglit_display(void)
pass = pass && piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, green);
glDisable(GL_STENCIL_TEST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
piglit_draw_rect_tex(0, 0, piglit_width, piglit_height,
......
......@@ -143,7 +143,7 @@ piglit_display(void)
glDeleteBuffersARB(1, &pbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, piglit_width, piglit_height);
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
......
......@@ -165,7 +165,7 @@ run_test(void)
fbo = make_fbo(fbo_width, fbo_height);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glViewport(0, 0, fbo_width, fbo_height);
piglit_ortho_projection(fbo_width, fbo_height, GL_FALSE);
glClearColor(1.0, 0.0, 1.0, 0.0);
......@@ -177,25 +177,25 @@ run_test(void)
/* Now that we have correct samples, blit things around.
* FBO(bottom) -> WIN(middle)
*/
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* WIN(bottom) -> FBO(middle) */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, piglit_winsys_fbo);
copy(x0, y0, x0 + SIZE, y0 + SIZE,
x0, y1, x0 + SIZE, y1 + SIZE);
/* FBO(middle) -> WIN(top) back to verify WIN -> FBO */
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fbo);