Commit 40202a1d authored by Brian Paul's avatar Brian Paul

texture-storage: fix internal format mistakes in the test

Per issue 17 of the extension spec, unsized internalFormat values are
not allowed.  Change GL_RGBA to GL_RGBA8 and add some extra error
checks.

The test passes on NVIDIA now.
parent 02c78ff3
......@@ -69,15 +69,17 @@ test_one_level_errors(GLenum target)
glBindTexture(target, tex);
if (target == GL_TEXTURE_1D) {
glTexStorage1D(target, 1, GL_RGBA, width);
glTexStorage1D(target, 1, GL_RGBA8, width);
}
else if (target == GL_TEXTURE_2D) {
glTexStorage2D(target, 1, GL_RGBA, width, height);
glTexStorage2D(target, 1, GL_RGBA8, width, height);
}
else if (target == GL_TEXTURE_3D) {
glTexStorage3D(target, 1, GL_RGBA, width, height, depth);
glTexStorage3D(target, 1, GL_RGBA8, width, height, depth);
}
piglit_check_gl_error(GL_NO_ERROR);
glGetTexLevelParameteriv(target, 0, GL_TEXTURE_WIDTH, &v);
if (v != width) {
printf("%s: bad width: %d, should be %d\n", TestName, v, width);
......@@ -111,7 +113,7 @@ test_one_level_errors(GLenum target)
return GL_FALSE;
}
glTexStorage2D(target, 1, GL_RGBA, width, height);
glTexStorage2D(target, 1, GL_RGBA8, width, height);
if (glGetError() != GL_INVALID_OPERATION) {
printf("%s: glTexStorage2D() failed to generate error\n", TestName);
return GL_FALSE;
......@@ -149,18 +151,20 @@ test_mipmap_errors(GLenum target)
glBindTexture(target, tex);
if (target == GL_TEXTURE_1D) {
glTexStorage1D(target, levels, GL_RGBA, width);
glTexStorage1D(target, levels, GL_RGBA8, width);
targetString = "GL_TEXTURE_1D";
}
else if (target == GL_TEXTURE_2D) {
glTexStorage2D(target, levels, GL_RGBA, width, height);
glTexStorage2D(target, levels, GL_RGBA8, width, height);
targetString = "GL_TEXTURE_2D";
}
else if (target == GL_TEXTURE_3D) {
glTexStorage3D(target, levels, GL_RGBA, width, height, depth);
glTexStorage3D(target, levels, GL_RGBA8, width, height, depth);
targetString = "GL_TEXTURE_3D";
}
piglit_check_gl_error(GL_NO_ERROR);
glGetTexParameteriv(target, GL_TEXTURE_IMMUTABLE_FORMAT, &v);
if (!v) {
printf("%s: %s GL_TEXTURE_IMMUTABLE_FORMAT query returned false\n", TestName, targetString);
......@@ -238,7 +242,9 @@ test_2d_mipmap_rendering(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexStorage2D(GL_TEXTURE_2D, levels, GL_RGBA, width, height);
glTexStorage2D(GL_TEXTURE_2D, levels, GL_RGBA8, width, height);
piglit_check_gl_error(GL_NO_ERROR);
/* check that the mipmap level sizes are correct */
for (l = 0; l < levels; l++) {
......
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