Commit 730eb7b3 authored by Ian Romanick's avatar Ian Romanick

Correct errors in the fbo-incomplete-texture tests

These tests originally wanted the FBO to be incomplete.  However, this
just verified incorrect behavior in another vendor's driver.  The spec
says that all of these cases should produce a complete FBO.

The format of the texture was also change from RGB to RGBA.  This
should prevent FRAMEBUFFER_UNSUPPORTED on some drivers.
parent 76df501a
......@@ -23,10 +23,12 @@
/**
* \file fbo-incomplete-texture-01.c
* Verify that an FBO with an incomplete texture attached in itself incomplete
* Verify that an FBO with an incomplete texture attached is complete
*
* This test uses a 2D texture that specifies a mipmap filter, but the mipmap
* stack is not complete.
* stack is not complete. This should not affect the completeness of the FBO.
* This test originally wanted the FBO to be incomplete. However, this just
* verified incorrect behavior in another vendor's driver.
*
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
......@@ -60,8 +62,8 @@ piglit_init(int argc, char **argv)
*/
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
......@@ -79,13 +81,10 @@ piglit_init(int argc, char **argv)
}
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status == GL_FRAMEBUFFER_COMPLETE) {
printf("FBO erroneously complete\n");
if (status != GL_FRAMEBUFFER_COMPLETE) {
fprintf(stderr, "FBO erroneously incomplete: 0x%04x\n",
status);
piglit_report_result(PIGLIT_FAILURE);
} else if (status != GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) {
fprintf(stderr, "FBO incomplete for incorrect reason 0x%04x "
"(should be 0x%04x)\n",
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, status);
}
piglit_report_result(PIGLIT_SUCCESS);
......
......@@ -23,9 +23,12 @@
/**
* \file fbo-incomplete-texture-02.c
* Verify that an FBO with an incomplete texture attached in itself incomplete
* Verify that an FBO with an incomplete texture attached is complete
*
* This test uses a cube map where one of the faces has not been specified.
* As long as the missing face isn't attached to the FBO, the FBO should not
* be incomplete. This test originally wanted the FBO to be incomplete.
* However, this just verified incorrect behavior in another vendor's driver.
*
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
......@@ -59,16 +62,16 @@ piglit_init(int argc, char **argv)
*/
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 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);
......@@ -85,13 +88,10 @@ piglit_init(int argc, char **argv)
}
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status == GL_FRAMEBUFFER_COMPLETE) {
printf("FBO erroneously complete\n");
if (status != GL_FRAMEBUFFER_COMPLETE) {
fprintf(stderr, "FBO erroneously incomplete: 0x%04x\n",
status);
piglit_report_result(PIGLIT_FAILURE);
} else if (status != GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) {
fprintf(stderr, "FBO incomplete for incorrect reason 0x%04x "
"(should be 0x%04x)\n",
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, status);
}
piglit_report_result(PIGLIT_SUCCESS);
......
......@@ -23,10 +23,11 @@
/**
* \file fbo-incomplete-texture-03.c
* Verify that an FBO with an incomplete texture attached in itself incomplete
* Verify that an FBO with an incomplete texture attached is complete
*
* This test uses a cube map where one of the faces is specified with the
* wrong size.
* wrong size. This test originally wanted the FBO to be incomplete.
* However, this just verified incorrect behavior in another vendor's driver.
*
* \author Ian Romanick <ian.d.romanick@intel.com>
*/
......@@ -60,18 +61,18 @@ piglit_init(int argc, char **argv)
*/
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_CUBE_MAP, tex);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGB, 32, 32, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGB, 64, 64, 0,
GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL_RGBA, 32, 32, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA, 64, 64, 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);
......@@ -88,13 +89,10 @@ piglit_init(int argc, char **argv)
}
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status == GL_FRAMEBUFFER_COMPLETE) {
printf("FBO erroneously complete\n");
if (status != GL_FRAMEBUFFER_COMPLETE) {
fprintf(stderr, "FBO erroneously incomplete: 0x%04x\n",
status);
piglit_report_result(PIGLIT_FAILURE);
} else if (status != GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) {
fprintf(stderr, "FBO incomplete for incorrect reason 0x%04x "
"(should be 0x%04x)\n",
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, status);
}
piglit_report_result(PIGLIT_SUCCESS);
......
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