[Piglit] [PATCH 1/3] etc1: Fix glTexImage2D call in basic API test
Anuj Phogat
anuj.phogat at gmail.com
Wed Jan 30 11:04:58 PST 2013
On Tue, Jan 29, 2013 at 5:18 PM, Chad Versace
<chad.versace at linux.intel.com> wrote:
>
> On mesa-1559994 with Intel Sandybridge, this test failed due to two
> unexpected GL errors. This patch fixes the first.
>
> The test wanted
>
> glTexImage2D(format=GL_RGB, internalformat=GL_ETC1_RGB8_OES)
>
> to emit GL_INVALID_VALUE. However, implementations are allowed to emit
> GL_INVALID_VALUE or GL_INVALID_OPERATION for that call. From page 73 of
> the OpenGL ES 1.1 spec:
>
> Specifying a value for internalformat that is not one of the above
> values generates the error INVALID VALUE. If internalformat does not
> match format, the error INVALID OPERATION is generated.
>
> To correct this, change format to GL_ETC1_RGB8_OES.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55147
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
> .../oes_compressed_etc1_rgb8_texture-basic.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/oes_compressed_etc1_rgb8_texture/oes_compressed_etc1_rgb8_texture-basic.c b/tests/spec/oes_compressed_etc1_rgb8_texture/oes_compressed_etc1_rgb8_texture-basic.c
> index 70e1a8c..aa0b137 100644
> --- a/tests/spec/oes_compressed_etc1_rgb8_texture/oes_compressed_etc1_rgb8_texture-basic.c
> +++ b/tests/spec/oes_compressed_etc1_rgb8_texture/oes_compressed_etc1_rgb8_texture-basic.c
> @@ -53,9 +53,15 @@ piglit_display(void)
>
> glClear(GL_COLOR_BUFFER_BIT);
>
> - /* no compression support */
> + /* GL_ETC1_RGB8_OES is not a valid format for glTexImage2D().
> + *
> + * From page 73 OpenGL ES 1.1 spec:
> + *
> + * Specifying a value for internalformat that is not one of the above
> + * values generates the error INVALID VALUE.
> + */
> glTexImage2D(GL_TEXTURE_2D, 0, format,
> - width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, fake_tex_data);
> + width, height, 0, format, GL_UNSIGNED_BYTE, fake_tex_data);
> pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
>
> glCopyTexImage2D(GL_TEXTURE_2D, 0, format, 0, 0, width, height, 0);
> --
> 1.8.1.1
>
This series is Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the Piglit
mailing list