[Piglit] [PATCH 05/20] fbo: Use format_desc::base_internal_format rather than test_desc::base.
Paul Berry
stereotype441 at gmail.com
Tue Jun 5 17:03:15 PDT 2012
The field test_desc::base has two disadvantages: (1) it is only
populated for depth and depth/stencil formats (for all other formats
it is zero). (2) it misclassifies GL_DEPTH32F_STENCIL8 as having a
base format of GL_DEPTH_COMPONENT, when the correct base format is
GL_DEPTH_STENCIL.
This patch replaces all references to test_desc::base with
format_desc::base_internal_format, which doesn't have either of these
disadvantages.
---
tests/fbo/fbo-alphatest-formats.c | 4 ++--
tests/fbo/fbo-blending-formats.c | 4 ++--
tests/fbo/fbo-clear-formats.c | 2 +-
tests/fbo/fbo-generatemipmap-formats.c | 3 ++-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/tests/fbo/fbo-alphatest-formats.c b/tests/fbo/fbo-alphatest-formats.c
index 5d1ae8d..ca6c1ec 100644
--- a/tests/fbo/fbo-alphatest-formats.c
+++ b/tests/fbo/fbo-alphatest-formats.c
@@ -71,8 +71,8 @@ static enum piglit_result test_format(const struct format_desc *format, GLenum b
float pos6[] = { 0.5, -1.0, 0.25, 2.0};
float pos7[] = { 0.75, -1.0, 0.25, 2.0};
- if (baseformat == GL_DEPTH_COMPONENT ||
- baseformat == GL_DEPTH_STENCIL)
+ if (format->base_internal_format == GL_DEPTH_COMPONENT ||
+ format->base_internal_format == GL_DEPTH_STENCIL)
return PIGLIT_SKIP;
/*
diff --git a/tests/fbo/fbo-blending-formats.c b/tests/fbo/fbo-blending-formats.c
index e6546fb..fc6a0e6 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -107,8 +107,8 @@ static enum piglit_result test_format(const struct format_desc *format, GLenum b
dst5[2]*(1-src5[3]) + src5[2]*src5[3],
dst5[3]*(1-src5[3]) + src5[3]*src5[3]};
- if (baseformat == GL_DEPTH_COMPONENT ||
- baseformat == GL_DEPTH_STENCIL)
+ if (format->base_internal_format == GL_DEPTH_COMPONENT ||
+ format->base_internal_format == GL_DEPTH_STENCIL)
return PIGLIT_SKIP;
glGenFramebuffersEXT(1, &fb);
diff --git a/tests/fbo/fbo-clear-formats.c b/tests/fbo/fbo-clear-formats.c
index 0cbba3f..da975dc 100644
--- a/tests/fbo/fbo-clear-formats.c
+++ b/tests/fbo/fbo-clear-formats.c
@@ -407,7 +407,7 @@ test_format(const struct format_desc *format, GLenum baseformat)
GLboolean pass = GL_TRUE;
printf("Testing %s", format->name);
- tex = create_tex(format->internalformat, baseformat);
+ tex = create_tex(format->internalformat, format->base_internal_format);
if (tex == 0)
return PIGLIT_SKIP;
diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index 76d0adf..92b3276 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -411,7 +411,8 @@ test_format(const struct format_desc *format, GLenum baseformat, GLenum basetype
GLboolean pass = GL_TRUE;
printf("Testing %s%s\n", format->name, tex_width == 256 ? "" : " (NPOT)");
- tex = create_tex(format->internalformat, baseformat, basetype);
+ tex = create_tex(format->internalformat, format->base_internal_format,
+ basetype);
x = 1;
for (level = 0; (tex_width >> level) || (tex_height >> level); level++) {
--
1.7.7.6
More information about the Piglit
mailing list