diff options
author | Paul Berry <stereotype441@gmail.com> | 2012-06-02 10:34:32 -0700 |
---|---|---|
committer | Paul Berry <stereotype441@gmail.com> | 2012-06-07 10:58:22 -0700 |
commit | 2b776b9ae040c9f53df897ef4e2715a6f5cff9b4 (patch) | |
tree | 349397ee1e0cc3ef0925698c7d468536283a6d67 | |
parent | 873ba64f39c6f001e96954b2819c9075161a65d8 (diff) |
fbo: Use format_desc::base_internal_format rather than test_desc::base.
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.
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
-rw-r--r-- | tests/fbo/fbo-alphatest-formats.c | 4 | ||||
-rw-r--r-- | tests/fbo/fbo-blending-formats.c | 4 | ||||
-rw-r--r-- | tests/fbo/fbo-clear-formats.c | 2 | ||||
-rw-r--r-- | 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 5d1ae8dd9..ca6c1eccb 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 e6546fbaa..fc6a0e60b 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 0cbba3f37..da975dcd9 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 76d0adf55..92b3276f9 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++) { |