[Piglit] [PATCH v2 2/5] fbo-storage-formats: enable tests for OpenGl 3.0 formats.
Chad Versace
chad.versace at linux.intel.com
Tue Sep 3 11:30:45 PDT 2013
On 08/23/2013 11:51 AM, Kenney Phillis wrote:
> Enable the Floating point and Interformats that are introduced in the
> OpenGL 3.0 specification. Currently the test uses an OpenGL 3.1
> Core context for Mesa based drivers, and this test should also work
> just fine when Compatibility contexts support Opengl 3.1 or newer.
> ---
> tests/fbo/fbo-storage-formats.c | 42 ++++++++++++++++++++-------------------
> 1 file changed, 22 insertions(+), 20 deletions(-)
>
> diff --git a/tests/fbo/fbo-storage-formats.c b/tests/fbo/fbo-storage-formats.c
> index bbe286c..e66d4f0 100644
> --- a/tests/fbo/fbo-storage-formats.c
> +++ b/tests/fbo/fbo-storage-formats.c
> @@ -35,6 +35,7 @@
> PIGLIT_GL_TEST_CONFIG_BEGIN
>
> config.supports_gl_compat_version = 10;
> +config.supports_gl_core_version = 31;
>
> config.window_visual = PIGLIT_GL_VISUAL_RGB;
>
> @@ -43,7 +44,8 @@ PIGLIT_GL_TEST_CONFIG_END
> #define EXT_packed_depth_stencil 1
> #define ARB_framebuffer_object 2
> #define ARB_texture_rg 3
> -#define MAX_EXT 4
> +#define HAS_OPENGL_3x 4
> +#define MAX_EXT 5
>
> static GLboolean have_extension[MAX_EXT];
>
> @@ -100,25 +102,24 @@ static const struct format_info formats[] = {
> { GL_RG, ARB_texture_rg },
> { GL_RG8, ARB_texture_rg },
> { GL_RG16, ARB_texture_rg },
> -#if 0
> - /* XXX also depend on texture_float, texture_integer extensions */
> - { GL_R16F, ARB_texture_rg },
> - { GL_R32F, ARB_texture_rg },
> - { GL_RG16F, ARB_texture_rg },
> - { GL_RG32F, ARB_texture_rg },
> - { GL_R8I, ARB_texture_rg },
> - { GL_R8UI, ARB_texture_rg },
> - { GL_R16I, ARB_texture_rg },
> - { GL_R16UI, ARB_texture_rg },
> - { GL_R32I, ARB_texture_rg },
> - { GL_R32UI, ARB_texture_rg },
> - { GL_RG8I, ARB_texture_rg },
> - { GL_RG8UI, ARB_texture_rg },
> - { GL_RG16I, ARB_texture_rg },
> - { GL_RG16UI, ARB_texture_rg },
> - { GL_RG32I, ARB_texture_rg },
> - { GL_RG32UI, ARB_texture_rg },
> -#endif
> +
> + /* OpenGL 3.x Formats */
> + { GL_R16F, HAS_OPENGL_3x },
> + { GL_R32F, HAS_OPENGL_3x },
> + { GL_RG16F, HAS_OPENGL_3x },
> + { GL_RG32F, HAS_OPENGL_3x },
> + { GL_R8I, HAS_OPENGL_3x },
> + { GL_R8UI, HAS_OPENGL_3x },
> + { GL_R16I, HAS_OPENGL_3x },
> + { GL_R16UI, HAS_OPENGL_3x },
> + { GL_R32I, HAS_OPENGL_3x },
> + { GL_R32UI, HAS_OPENGL_3x },
> + { GL_RG8I, HAS_OPENGL_3x },
> + { GL_RG8UI, HAS_OPENGL_3x },
> + { GL_RG16I, HAS_OPENGL_3x },
> + { GL_RG16UI, HAS_OPENGL_3x },
> + { GL_RG32I, HAS_OPENGL_3x },
> + { GL_RG32UI, HAS_OPENGL_3x },
>
> /* GL_EXT_packed_depth_stencil */
> { GL_DEPTH_STENCIL_EXT, EXT_packed_depth_stencil },
> @@ -243,5 +244,6 @@ piglit_init(int argc, char**argv)
> have_extension[ARB_framebuffer_object] = piglit_is_extension_supported("GL_ARB_framebuffer_object");
> have_extension[ARB_texture_rg] = piglit_is_extension_supported("GL_ARB_texture_rg");
>
> + have_extension[HAS_OPENGL_3x] = (30 <= piglit_get_gl_version()) ? GL_TRUE : GL_FALSE;
> piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> }
This patch is incorrect.
The formats enabled by this patch, the 3.0 spec requires that the implementation support
them all as *texture* formats, but not necessarily as *renderbuffer* formats.
See the list "Color formats (texture-only)" on page 180 (196 of pdf) of the OpenGL 3.0 spec.
If the test reported SKIP when the glRenderbufferStorage rejected such a format, then this
patch would be ok. But, as is, the test reports FAIL when glRenderbufferStorage rejects.
More information about the Piglit
mailing list