Re: [Piglit] [PATCH v2 3/6] s3tc-teximage: port to gles2

2018-10-26 Thread Emil Velikov
Hi Erik,

On Fri, 26 Oct 2018 at 14:03, Erik Faye-Lund
 wrote:

> +#ifdef PIGLIT_USE_OPENGL
> +
> piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +
> +#else // PIGLIT_USE_OPENGL_ES2
> +
> +   tex_program = piglit_build_simple_program(vs_source, fs_source);
> +   glUseProgram(tex_program);
> +   GLint proj_loc = glGetUniformLocation(tex_program, "proj");
> +   piglit_ortho_uniform(proj_loc, piglit_width, piglit_height);
> +

I cannot spot anything wrong with the updated series, so sharing a
wondering thought.

Should we shouldn't fold this ES2 solution within the
piglit_ortho_projection it already already supports GLES1.
The helper library gets built in four flavours (gl, gles1, gles2,
gles3), so the usual #ifdef approach should be just fine.

There are some existing users of piglit_ortho_uniform, but t wouldn't
bother with them.

HTH
Emil
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2 1/6] texturing: make sure s3tc tests require GL 1.1

2018-10-26 Thread Emil Velikov
On Fri, 26 Oct 2018 at 16:39, Erik Faye-Lund
 wrote:
>
> On Fri, 2018-10-26 at 16:21 +0100, Emil Velikov wrote:
> > On Fri, 26 Oct 2018 at 14:03, Erik Faye-Lund
> >  wrote:
> > >
> > > The EXT_texture_compression_s3tc spec lists that it requires
> > > OpenGL 1.1, not 1.0 like some of these list.
> > >
> > > In reality, this probably doesn't make a huge difference, as
> > > OpenGL 1.0 hardware/drivers are pretty much extinct, but let's
> > > just get it right to avoid confusion.
> > >
> > > Signed-off-by: Erik Faye-Lund 
> > > ---
> > >  tests/texturing/s3tc-errors.c  | 2 +-
> > >  tests/texturing/s3tc-teximage.c| 2 +-
> > >  tests/texturing/s3tc-texsubimage.c | 2 +-
> > >  3 files changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-
> > > errors.c
> > > index 81fee3e21..ccedf8a22 100644
> > > --- a/tests/texturing/s3tc-errors.c
> > > +++ b/tests/texturing/s3tc-errors.c
> > > @@ -36,7 +36,7 @@
> > >
> > >  PIGLIT_GL_TEST_CONFIG_BEGIN
> > >
> > > -config.supports_gl_compat_version = 10;
> > > +config.supports_gl_compat_version = 11;
> > >
> >
> > Ages ago Ilia reported on IRC that some tests (was it 10 or 11, don't
> > recall) failing on the classic swrast and/or nouveau_vieux.
> > That waffle issue should be fixed, although if he can give this patch
> > a try (with platform glx) that'll be appreciated ...
> >
> > Gut feeling suggests that the fix may not have been enough.
>
> I don't think I understand the issue... Some of these tests use 10 and
> some use 11 here, and 11 is the correct value (according to the spec).
> I'm just making it consistent...
>
> This is just a filter under what contexts these tests will run, no? I
> haven't seen an OpenGL 1.0-only implementation, well, ever I think?
> Isn't this just theoretical anyway? I don't understand how this could
> have any practical effect...
>
It's been ~3 years so, my memory and amount of details is flaky.

A while ago Ilia and Brian Paul reported that some tests annotated as
10 (or was it 11)  were failing on nouveau_vieux and classic swrast
respectively.
That was because piglit was passing the explicit version to waffle,
which in turn was using the GLX_ARB_create_context since it's the only
way to request a specific version.

That should be addressed with the following waffle commit [1],
although I'm concerned about the 10 check in the patch.
Sadly I did not document why in the commit log (nor was it asked
during review), perhaps it has something to do with the massive
comment in waffle's glx_context.c [2].

That said, if your patch causes problems I could double-check and fix waffle.
Since I've annoyed Ilia enough times, I wanted to spare another
instance - hence the suggestion.

HTH
Emil

[1] 
https://github.com/waffle-gl/waffle/commit/e7f0314c7c87e031148d7dee0e6f28d490a97a2a
[2] 
https://github.com/waffle-gl/waffle/blob/e7f0314c7c87e031148d7dee0e6f28d490a97a2a/src/waffle/glx/glx_context.c#L86
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] fbo: add a few quirk-tests for format-emulation

2018-10-26 Thread Emil Velikov
On Fri, 26 Oct 2018 at 12:35, Erik Faye-Lund
 wrote:
>
> On Thu, 2018-10-25 at 14:39 +0100, Emil Velikov wrote:
> > On Thu, 25 Oct 2018 at 11:07, Erik Faye-Lund
> >  wrote:
> > >
> > > On Wed, 2018-10-24 at 16:32 +0100, Emil Velikov wrote:
> > > > Hi Erik,
> > > >
> > > > A bit of an open question, do we want this test on GLES? If yes,
> > > > see
> > > > the GLES
> > > > notes below.
> > > >
> > >
> > > Right. I think I'm fine with only OpenGL for now, as this is a
> > > quirk-
> > > test.
> > >
> > > But yeah, it's totally valuable for GLES as well, and as you point
> > > our, should be pretty easy to port there. I'll leave that for the
> > > future for now, though.
> > >
> > > > Alternatively, I've only spotted couple small nitpicks.
> > > >
> > > > On Thu, 20 Sep 2018 at 19:19, Erik Faye-Lund
> > > >  wrote:
> > > > >
> > > > > Drivers who implement GL_ALPHA textures by swizzling a GL_R
> > > > > texture
> > > > > needs to be prepared to offer multiple blend-colors, otherwise
> > > > > they
> > > > > will produce the wrong result, because the blend-color will
> > > > > also
> > > > > need per-format swizzling.
> > > > >
> > > > > Similarly, when drivers implement GL_RGB with GL_RGBA and
> > > > > adjust
> > > > > the
> > > > > blend-factors, they need to have separate blend-factors for all
> > > > > framebuffer attachments or the results will be wrong.
> > > > >
> > > > > This reveals a couple of bugs in virgl, where these currently
> > > > > fail.
> > > > >
> > > > > Signed-off-by: Erik Faye-Lund 
> > > > > ---
> > > > >  tests/fbo/CMakeLists.gl.txt|   1 +
> > > > >  tests/fbo/fbo-blending-format-quirks.c | 175
> > > > > +
> > > > >  tests/opengl.py|   1 +
> > > > >  3 files changed, 177 insertions(+)
> > > > >  create mode 100644 tests/fbo/fbo-blending-format-quirks.c
> > > > >
> > > > > diff --git a/tests/fbo/CMakeLists.gl.txt
> > > > > b/tests/fbo/CMakeLists.gl.txt
> > > > > index d594c24d3..1a1a60765 100644
> > > > > --- a/tests/fbo/CMakeLists.gl.txt
> > > > > +++ b/tests/fbo/CMakeLists.gl.txt
> > > > > @@ -29,6 +29,7 @@ piglit_add_executable (fbo-blit fbo-blit.c)
> > > > >  piglit_add_executable (fbo-blit-d24s8 fbo-blit-d24s8.c)
> > > > >  piglit_add_executable (fbo-blit-stretch fbo-blit-stretch.cpp)
> > > > >  piglit_add_executable (fbo-blending-formats fbo-blending-
> > > > > formats.c)
> > > > > +piglit_add_executable (fbo-blending-format-quirks fbo-
> > > > > blending-
> > > > > format-quirks.c)
> > > >
> > > > GLES:
> > > > Add a trivial .gles1.txt and/or gles2.txt file. You can use the
> > > > ext_image_dma_buf_import ones for reference.
> > > >
> > > >
> > > > >  piglit_add_executable (fbo-blending-snorm fbo-blending-
> > > > > snorm.c)
> > > > >  piglit_add_executable (fbo-colormask-formats fbo-colormask-
> > > > > formats.c)
> > > > >  piglit_add_executable (fbo-copypix fbo-copypix.c)
> > > > > diff --git a/tests/fbo/fbo-blending-format-quirks.c
> > > > > b/tests/fbo/fbo-blending-format-quirks.c
> > > > > new file mode 100644
> > > > > index 0..f6865d42b
> > > > > --- /dev/null
> > > > > +++ b/tests/fbo/fbo-blending-format-quirks.c
> > > > > +#include "piglit-util-gl.h"
> > > > > +
> > > > > +PIGLIT_GL_TEST_CONFIG_BEGIN
> > > > > +
> > > > > +   config.supports_gl_compat_version = 10;
> > > > > +
> > > >
> > > > GLES:
> > > > #ifdef PIGLIT_USE_OPENGL
> > > > config.supports_gl_compat_version = 10;
> > > > #else
> > > > config.supports_gl_es_version = ...
> > > > #endif
> > > >
> > > >
> > > > > +enum piglit_result piglit_display(void)
> > > > > +{
> > > > > +   int i;
> > > > > +enum piglit_result result, end_result = PIGLIT_PASS;
> > > > > +bool all_skip = true;
> > > > > +
> > > > > +   struct {
> > > >
> > > > static const
> > > >
> > >
> > > Fixed, thanks.
> > >
> > > > > +   const char *name;
> > > > > +   GLenum formats[2];
> > > > > +   GLenum factors[2];
> > > > > +   float expect[2][4];
> > > > > +   } cases[] = {
> > > >
> > > >
> > > > > +
> > > > > +void piglit_init(int argc, char **argv)
> > > > > +{
> > > >
> > > > piglit_require_extension("GL_EXT_framebuffer_object");
> > > >
> >
> > You need this ^^
> >
>
> Right, thanks. Fixed.
>
> However, I used tests/fbo/fbo-blending-formats.c as a reference, and
> this doesn't seem to do this either. So perhaps a fixup there is in
> order as well?
>
I think so. That's somewhat orthogonal to this patch, so I'd leave
that for another day.

> Also, I'm curious; EXT_framebuffer_object is an old, arguably broken
> spec. Why are we requiring it rather than ARB_framebuffer_object? Is
> the assumption that everyone who implements ARB_framebuffer_object will
> also implement EXT_framebuffer_object?
>
Silly answer off the top of my head - everything in mesa supports the
EXT one, unlike the ARB one.

> If I were to create a new driver today, I think I would drop
> 

Re: [Piglit] [PATCH v2 1/6] texturing: make sure s3tc tests require GL 1.1

2018-10-26 Thread Erik Faye-Lund
On Fri, 2018-10-26 at 16:21 +0100, Emil Velikov wrote:
> On Fri, 26 Oct 2018 at 14:03, Erik Faye-Lund
>  wrote:
> > 
> > The EXT_texture_compression_s3tc spec lists that it requires
> > OpenGL 1.1, not 1.0 like some of these list.
> > 
> > In reality, this probably doesn't make a huge difference, as
> > OpenGL 1.0 hardware/drivers are pretty much extinct, but let's
> > just get it right to avoid confusion.
> > 
> > Signed-off-by: Erik Faye-Lund 
> > ---
> >  tests/texturing/s3tc-errors.c  | 2 +-
> >  tests/texturing/s3tc-teximage.c| 2 +-
> >  tests/texturing/s3tc-texsubimage.c | 2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-
> > errors.c
> > index 81fee3e21..ccedf8a22 100644
> > --- a/tests/texturing/s3tc-errors.c
> > +++ b/tests/texturing/s3tc-errors.c
> > @@ -36,7 +36,7 @@
> > 
> >  PIGLIT_GL_TEST_CONFIG_BEGIN
> > 
> > -config.supports_gl_compat_version = 10;
> > +config.supports_gl_compat_version = 11;
> > 
> 
> Ages ago Ilia reported on IRC that some tests (was it 10 or 11, don't
> recall) failing on the classic swrast and/or nouveau_vieux.
> That waffle issue should be fixed, although if he can give this patch
> a try (with platform glx) that'll be appreciated ...
> 
> Gut feeling suggests that the fix may not have been enough.

I don't think I understand the issue... Some of these tests use 10 and
some use 11 here, and 11 is the correct value (according to the spec).
I'm just making it consistent...

This is just a filter under what contexts these tests will run, no? I
haven't seen an OpenGL 1.0-only implementation, well, ever I think?
Isn't this just theoretical anyway? I don't understand how this could
have any practical effect...

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 7/6] texturing: run gles2 variants as well

2018-10-26 Thread Erik Faye-Lund
It's nice if these tests also run automatically, so let's add them to
opengl.py.

Signed-off-by: Erik Faye-Lund 
---
Yeah, so Ilia pointed out on IRC that it would be a good idea to hook
these up so they run automatically as well. So here's an additional
patch for that. If desired, I can squash these in with the patches that
ports the tests instead of having an additional patch in the end.

 tests/opengl.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/opengl.py b/tests/opengl.py
index 54cfd04d5..c7b5aaf6e 100644
--- a/tests/opengl.py
+++ b/tests/opengl.py
@@ -3210,9 +3210,12 @@ with profile.test_list.group_manager(
 g(['arb_texture_compression-invalid-formats', 's3tc'], 'invalid formats')
 g(['gen-compressed-teximage'], run_concurrent=False)
 g(['s3tc-errors'])
+g(['s3tc-errors_gles2'])
 g(['s3tc-targeted'])
 g(['s3tc-teximage'], run_concurrent=False)
+g(['s3tc-teximage_gles2'], run_concurrent=False)
 g(['s3tc-texsubimage'], run_concurrent=False)
+g(['s3tc-texsubimage_gles2'], run_concurrent=False)
 g(['getteximage-targets', '2D', 'S3TC'])
 g(['getteximage-targets', '2D_ARRAY', 'S3TC'])
 g(['getteximage-targets', 'CUBE', 'S3TC'])
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2 1/6] texturing: make sure s3tc tests require GL 1.1

2018-10-26 Thread Emil Velikov
On Fri, 26 Oct 2018 at 14:03, Erik Faye-Lund
 wrote:
>
> The EXT_texture_compression_s3tc spec lists that it requires
> OpenGL 1.1, not 1.0 like some of these list.
>
> In reality, this probably doesn't make a huge difference, as
> OpenGL 1.0 hardware/drivers are pretty much extinct, but let's
> just get it right to avoid confusion.
>
> Signed-off-by: Erik Faye-Lund 
> ---
>  tests/texturing/s3tc-errors.c  | 2 +-
>  tests/texturing/s3tc-teximage.c| 2 +-
>  tests/texturing/s3tc-texsubimage.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
> index 81fee3e21..ccedf8a22 100644
> --- a/tests/texturing/s3tc-errors.c
> +++ b/tests/texturing/s3tc-errors.c
> @@ -36,7 +36,7 @@
>
>  PIGLIT_GL_TEST_CONFIG_BEGIN
>
> -config.supports_gl_compat_version = 10;
> +config.supports_gl_compat_version = 11;
>
Ages ago Ilia reported on IRC that some tests (was it 10 or 11, don't
recall) failing on the classic swrast and/or nouveau_vieux.
That waffle issue should be fixed, although if he can give this patch
a try (with platform glx) that'll be appreciated ...

Gut feeling suggests that the fix may not have been enough.

-Emil
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl/frexp: fix the incorrect expected values

2018-10-26 Thread andrey simiklit
Hello,

Thanks a lot for reviewing.

Regards,
Andrii.

On Fri, Oct 26, 2018 at 3:23 PM Haehnle, Nicolai 
wrote:

> On 24.10.18 14:52, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > I guess that this test has the incorrect expected values.
> > For instance the test expects that exponent for a value 2 will be 1
> > But it contradicts to spec because in this case
> > the value of 'significand' must be 1.0:
> > 2.0 = 1.0 * 2 ^ 1
> >
> > GLSL spec says (about 'frexp'):
> >"Splits x into a floating-point significand in the range
> > [0.5, 1.0) and an integral exponent of two, such that:
> >
> >x = significand * 2 ^ exponent
> >
> > The significand is returned by the function and the
> > exponent is returned in the parameter exp. For a
> > floating-point value of zero, the significant and exponent
> > are both zero. For a floating-point value that is an
> > infinity or is not a number, the results are undefined.
>
> You're absolutely right. It seems like radeonsi is currently passing
> this incorrectly, because a bunch of other things surrounding frexp are
> broken.
>
> The test change is correct.
>
> Reviewed-by: Nicolai Hähnle 
>
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108537
> > Signed-off-by: Andrii Simiklit 
> > ---
> >   .../fs-frexp-dvec4-only-exponent.shader_test| 13 -
> >   1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > index d7dc64032..c4a7555ff 100644
> > ---
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > +++
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > @@ -31,7 +31,18 @@ clear color 0 0 0 1
> >   clear
> >
> >   uniform dvec4 u_in 2 3 4 9
> > -uniform ivec4 u_exponent 1 1 2 3
> > +
> > +# The function frexp() splits each single-precision floating-point
> number in
> > +#  into a binary significand, a floating-point number in the range
> [0.5,
> > +# 1.0), and an integral exponent of two, such that:
> > +#
> > +#x = significand * 2 ^ exponent
> > +#
> > +# 2 = 0.5 * 2^2
> > +# 3 = 0.75 * 2^2
> > +# 4 = 0.5 * 2^3
> > +# 9 = 0.5625 * 2^4
> > +uniform ivec4 u_exponent 2 2 3 4
> >
> >   draw rect -1 -1 2 2
> >   probe all rgba 0 1 0 1
> >
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl-1.0: Bitmap test that draws zelda hearts.

2018-10-26 Thread kusmabite
On Fri, 2018-05-11 at 13:38 -0700, Laura Ekstrand wrote:
> ---
>  tests/opengl.py|   1 +
>  tests/spec/gl-1.0/CMakeLists.gl.txt|   1 +
>  tests/spec/gl-1.0/bitmap-heart-dance.c | 219
> +
>  3 files changed, 221 insertions(+)
>  create mode 100644 tests/spec/gl-1.0/bitmap-heart-dance.c
> 
> diff --git a/tests/opengl.py b/tests/opengl.py
> index 347e8c5d4..ddf07b0b7 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -570,6 +570,7 @@ with profile.test_list.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', '!opengl 1.0')) as g:
>  g(['gl-1.0-beginend-coverage'])
> +g(['gl-1.0-bitmap-heart-dance'])
>  g(['gl-1.0-dlist-beginend'])
>  g(['gl-1.0-dlist-bitmap'])
>  g(['gl-1.0-dlist-materials'])
> diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt b/tests/spec/gl-
> 1.0/CMakeLists.gl.txt
> index e5986968c..c97a160fc 100644
> --- a/tests/spec/gl-1.0/CMakeLists.gl.txt
> +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
> @@ -10,6 +10,7 @@ link_libraries (
>  
>  piglit_add_executable (gl-1.0-user-clip-all-planes user-clip-all-
> planes.c)
>  piglit_add_executable (gl-1.0-beginend-coverage beginend-coverage.c)
> +piglit_add_executable (gl-1.0-bitmap-heart-dance bitmap-heart-
> dance.c)
>  piglit_add_executable (gl-1.0-blend-func blend.c)
>  piglit_add_executable (gl-1.0-dlist-beginend dlist-beginend.c)
>  piglit_add_executable (gl-1.0-dlist-bitmap dlist-bitmap.c)
> diff --git a/tests/spec/gl-1.0/bitmap-heart-dance.c b/tests/spec/gl-
> 1.0/bitmap-heart-dance.c
> new file mode 100644
> index 0..cb1c7faa7
> --- /dev/null
> +++ b/tests/spec/gl-1.0/bitmap-heart-dance.c
> @@ -0,0 +1,219 @@
> +/*
> + * Copyright (C) 2018 Laura Ekstrand
> + *
> + * Permission is hereby granted, free of charge, to any person
> obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom
> the
> + * Software is furnished to do so, subject to the following
> conditions:
> + *
> + * The above copyright notice and this permission notice (including
> the next
> + * paragraph) shall be included in all copies or substantial
> portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO
> EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
> OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> OTHER DEALINGS
> + * IN THE SOFTWARE.
> + */
> +
> +/**
> + * Test glBitmap in a methodical way using a series of heart shapes.
> + * Heart shape is diagram A.2 from Garnstudio free sock pattern
> Heart Dance
> + * (https://www.garnstudio.com/pattern.php?id=7440=17).
> + * Knitting color work is basically glBitmap for knits!
> + *
> + *   _ * _ _ _ * _ _where  _ = 0
> + *   * * * _ * * * _   * = 1
> + *   * * * * * * * _
> + *   * * * * * * * _
> + *   _ * * * * * _ _
> + *   _ _ * * * _ _ _
> + *   _ _ _ * _ _ _ _
> + *   _ _ _ _ _ _ _ _
> + *
> + * Or:  Little endBig end
> + *   0 1 0 0 0 1 0 0 68   0x44 0x22
> + *   1 1 1 0 1 1 1 0238   0xEE 0x77
> + *   1 1 1 1 1 1 1 0254   0xFE 0xF7
> + *   1 1 1 1 1 1 1 0254   0xFE 0xF7
> + *   0 1 1 1 1 1 0 0124   0x7C 0xE3
> + *   0 0 1 1 1 0 0 0 56   0x38 0xC2
> + *   0 0 0 1 0 0 0 0 16   0x10 0x80
> + *   0 0 0 0 0 0 0 0  0   0x00 0x00
> + *
> + * Laura Ekstrand
> + * March 2018
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> + config.supports_gl_compat_version = 10;
> + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
> +PIGLIT_GL_VISUAL_RGBA;
> + config.window_width = 340;
> + config.window_height = 200;
> + config.khr_no_error_support = PIGLIT_NO_ERRORS;
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const float  red[4] = {0.502, 0.082, 0.082, 1.0};
> +static const float   salmon[4] = {1.000, 0.353, 0.353, 1.0};
> +static const float pink[4] = {0.945, 0.471, 0.639, 1.0};
> +static const float   orange[4] = {1.000, 0.286, 0.000, 1.0};
> +static const float ltorange[4] = {1.000, 0.514, 0.322, 1.0};
> +static const float   yellow[4] = {1.000, 0.871, 0.133, 1.0};
> +static GLubyte bitmap[8] = { 0x00, 0x10, 0x38, 0x7C,
> +  0xFE, 0xFE, 0xEE, 0x44 };
> +
> +static const char *fragShaderText =
> +

[Piglit] [PATCH v2 2/6] texturing: use piglit_draw_rect_tex instead of glBegin/glEnd

2018-10-26 Thread Erik Faye-Lund
This will make it easier to port these tests to gles.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/s3tc-teximage.c| 9 ++---
 tests/texturing/s3tc-texsubimage.c | 9 ++---
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/tests/texturing/s3tc-teximage.c b/tests/texturing/s3tc-teximage.c
index a08feaa69..a7225f6f0 100644
--- a/tests/texturing/s3tc-teximage.c
+++ b/tests/texturing/s3tc-teximage.c
@@ -61,13 +61,8 @@ display_mipmaps(int start_x, int start_y)
 
/* Disply all the mipmap levels */
for (i = SIZE; i > 0; i /= 2) {
-   glBegin(GL_QUADS);
-   glTexCoord2f(0.0, 0.0); glVertex2f(start_x + 0, start_y + 0);
-   glTexCoord2f(1.0, 0.0); glVertex2f(start_x + i, start_y + 0);
-   glTexCoord2f(1.0, 1.0); glVertex2f(start_x + i, start_y + i);
-   glTexCoord2f(0.0, 1.0); glVertex2f(start_x + 0, start_y + i);
-   glEnd();
-
+   piglit_draw_rect_tex(start_x, start_y, i, i,
+0.0f, 0.0f, 1.0f, 1.0f);
start_x += i + 5;
}
 }
diff --git a/tests/texturing/s3tc-texsubimage.c 
b/tests/texturing/s3tc-texsubimage.c
index 39b94938e..3e2260139 100644
--- a/tests/texturing/s3tc-texsubimage.c
+++ b/tests/texturing/s3tc-texsubimage.c
@@ -61,13 +61,8 @@ display_mipmaps(int start_x, int start_y)
 
/* Disply all the mipmap levels */
for (i = SIZE; i > 0; i /= 2) {
-   glBegin(GL_QUADS);
-   glTexCoord2f(0.0, 0.0); glVertex2f(start_x + 0, start_y + 0);
-   glTexCoord2f(1.0, 0.0); glVertex2f(start_x + i, start_y + 0);
-   glTexCoord2f(1.0, 1.0); glVertex2f(start_x + i, start_y + i);
-   glTexCoord2f(0.0, 1.0); glVertex2f(start_x + 0, start_y + i);
-   glEnd();
-
+   piglit_draw_rect_tex(start_x, start_y, i, i,
+0.0f, 0.0f, 1.0f, 1.0f);
start_x += i + 5;
}
 }
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 6/6] s3tc-errors: port to gles20

2018-10-26 Thread Erik Faye-Lund
The glGetTexLevelParameteriv-function wasn't added to gles before
gles31, so let's just skip those tests on earlier versions. This
allows us to also run this test on gles20.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/s3tc-errors.c | 51 ++-
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index 4401dd23c..7e9bfa8b5 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -39,7 +39,7 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 #ifdef PIGLIT_USE_OPENGL
 config.supports_gl_compat_version = 11;
 #else // PIGLIT_USE_OPENGL_ES2
-config.supports_gl_es_version = 31;
+config.supports_gl_es_version = 20;
 #endif
 
 config.window_width = 200;
@@ -196,34 +196,37 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
pass = check_rendering(width, height) && pass;
 
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED,
-_compressed);
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT,
-);
-   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
-GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
-_size);
+   if (!piglit_is_gles() || piglit_get_gl_version() >= 31) {
 
-   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, 
GL_TEXTURE_COMPRESSED,
+_compressed);
+   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
+GL_TEXTURE_INTERNAL_FORMAT, );
+   glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
+GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
+_size);
 
-   if (!is_compressed) {
-   printf("Image was not compressed\n");
-   pass = false;
-   }
+   pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
 
-   if (format != requested_format) {
-   printf("Internal Format mismatch. Found: 0x%04x Expected: 
0x%04x\n",
-  format, requested_format);
-   pass = false;
-   }
+   if (!is_compressed) {
+   printf("Image was not compressed\n");
+   pass = false;
+   }
+
+   if (format != requested_format) {
+   printf("Internal Format mismatch. Found: 0x%04x 
Expected: 0x%04x\n",
+  format, requested_format);
+   pass = false;
+   }
 
-   expected_size = piglit_compressed_image_size(requested_format, width,
-   height);
+   expected_size = piglit_compressed_image_size(requested_format,
+   width, height);
 
-   if (compressed_size != expected_size) {
-   printf("Compressed image size mismatch. Found: %u Expected: 
%u\n",
-  compressed_size, expected_size);
-   pass = false;
+   if (compressed_size != expected_size) {
+   printf("Compressed image size mismatch. Found: %u 
Expected: %u\n",
+  compressed_size, expected_size);
+   pass = false;
+   }
}
 
 #ifdef PIGLIT_USE_OPENGL
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 1/6] texturing: make sure s3tc tests require GL 1.1

2018-10-26 Thread Erik Faye-Lund
The EXT_texture_compression_s3tc spec lists that it requires
OpenGL 1.1, not 1.0 like some of these list.

In reality, this probably doesn't make a huge difference, as
OpenGL 1.0 hardware/drivers are pretty much extinct, but let's
just get it right to avoid confusion.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/s3tc-errors.c  | 2 +-
 tests/texturing/s3tc-teximage.c| 2 +-
 tests/texturing/s3tc-texsubimage.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index 81fee3e21..ccedf8a22 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -36,7 +36,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-config.supports_gl_compat_version = 10;
+config.supports_gl_compat_version = 11;
 
 config.window_width = 200;
 config.window_height = 200;
diff --git a/tests/texturing/s3tc-teximage.c b/tests/texturing/s3tc-teximage.c
index 07e04f729..a08feaa69 100644
--- a/tests/texturing/s3tc-teximage.c
+++ b/tests/texturing/s3tc-teximage.c
@@ -36,7 +36,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 11;
 
config.window_width = 500;
config.window_height = 600;
diff --git a/tests/texturing/s3tc-texsubimage.c 
b/tests/texturing/s3tc-texsubimage.c
index 17d739a39..39b94938e 100644
--- a/tests/texturing/s3tc-texsubimage.c
+++ b/tests/texturing/s3tc-texsubimage.c
@@ -36,7 +36,7 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 10;
+   config.supports_gl_compat_version = 11;
 
config.window_width = 500;
config.window_height = 600;
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 5/6] s3tc-errors: port to gles31

2018-10-26 Thread Erik Faye-Lund
This specification is also supported on gles2, so let's add support
for gles31 to the test also.

Sadly, because gles2 doesn't support glGetCompressedTexImage, we can't
easily support the test-cases that re-uploads compressed data. Disabling
them and keeping the others are better than nothing, so let's do that
for now.

Similarly, because glGetTexLevelParameteriv isn't supported on gles
before version 3.1, let's set that as the minimum version.

A potential future improvement could be to embed a pre-compressed image
so these tests can run in all cases. But that requires a lot more work,
so I'll leave that for later.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/CMakeLists.gles2.txt |  1 +
 tests/texturing/s3tc-errors.c| 57 +++-
 2 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/tests/texturing/CMakeLists.gles2.txt 
b/tests/texturing/CMakeLists.gles2.txt
index 37f1e1986..67ec52b8e 100644
--- a/tests/texturing/CMakeLists.gles2.txt
+++ b/tests/texturing/CMakeLists.gles2.txt
@@ -2,5 +2,6 @@ link_libraries(piglitutil_${piglit_target_api})
 
 piglit_add_executable (s3tc-teximage_gles2 s3tc-teximage.c)
 piglit_add_executable (s3tc-texsubimage_gles2 s3tc-texsubimage.c)
+piglit_add_executable (s3tc-errors_gles2 s3tc-errors.c)
 
 # vim: ft=cmake:
diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index ccedf8a22..4401dd23c 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -36,7 +36,11 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
+#ifdef PIGLIT_USE_OPENGL
 config.supports_gl_compat_version = 11;
+#else // PIGLIT_USE_OPENGL_ES2
+config.supports_gl_es_version = 31;
+#endif
 
 config.window_width = 200;
 config.window_height = 200;
@@ -50,6 +54,36 @@ static const float green[4] = {0.0, 1.0, 0.0, 1.0};
 static const float blue[4] =  {0.0, 0.0, 1.0, 1.0};
 static const float white[4] = {1.0, 1.0, 1.0, 1.0};
 
+#ifdef  PIGLIT_USE_OPENGL_ES2
+
+const char *vs_source =
+   "#version 100\n"
+   "attribute vec4 piglit_vertex;\n"
+   "attribute vec2 piglit_texcoord;\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform mat4 proj;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_Position = proj * piglit_vertex;\n"
+   "tex_coord = piglit_texcoord;\n"
+   "}\n";
+
+const char *fs_source =
+   "#version 100\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform sampler2D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_FragColor = texture2D(tex, tex_coord);\n"
+   "}\n";
+
+#include "piglit-matrix.h"
+
+GLint tex_program, proj_loc;
+
+#endif
 
 static const GLenum s3tc_formats[] = {
GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
@@ -66,12 +100,19 @@ check_rendering_(int width, int height, int line)
const int h = height / 2 - 2;
bool pass = true;
 
+#ifdef PIGLIT_USE_OPENGL
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+#else
+   glUseProgram(tex_program);
+   piglit_ortho_uniform(proj_loc, piglit_width, piglit_height);
+#endif
 
glClear(GL_COLOR_BUFFER_BIT);
 
+#ifdef PIGLIT_USE_OPENGL
glEnable(GL_TEXTURE_2D);
glColor3f(1, 1, 1);
+#endif
 
/* draw the texture */
piglit_draw_rect_tex(0, 0, width, height, 0, 0, 1, 1);
@@ -128,7 +169,9 @@ check_gl_error2_(GLenum err1, GLenum err2, int line)
 static bool
 test_format(int width, int height, GLfloat *image, GLenum requested_format)
 {
+#ifdef PIGLIT_USE_OPENGL
GLubyte *compressed_image;
+#endif
GLenum format2;
int x, y, w, h;
GLuint tex;
@@ -183,6 +226,7 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
pass = false;
}
 
+#ifdef PIGLIT_USE_OPENGL
/* Use GL_TEXTURE_COMPRESSED_IMAGE_SIZE even if it wasn't what we
 * expected to avoid corruption due to under-allocated buffer.
 */
@@ -190,6 +234,7 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
 
/* Read back the compressed image data */
glGetCompressedTexImage(GL_TEXTURE_2D, 0, compressed_image);
+#endif
 
/* Try texsubimage on 4-texel boundary - should work */
x = 20;
@@ -216,6 +261,7 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
 
pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
 
+#ifdef PIGLIT_USE_OPENGL
/* Try compressed subimage on 4-texel boundary - should work */
x = 12;
y = 8;
@@ -260,6 +306,7 @@ test_format(int width, int height, GLfloat *image, GLenum 
requested_format)
  piglit_compressed_image_size(format, 4, 4),
  compressed_image +
  piglit_compressed_pixel_offset(format, width, 
x, y));
+
/* Note, we can get either of these errors depending on the order
 * in 

[Piglit] [PATCH v2 4/6] s3tc-texsubimage: port to gles2

2018-10-26 Thread Erik Faye-Lund
This specification is also supported on gles2, so let's add support
for gles2 to the test also.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/CMakeLists.gles2.txt |  1 +
 tests/texturing/s3tc-texsubimage.c   | 48 
 2 files changed, 49 insertions(+)

diff --git a/tests/texturing/CMakeLists.gles2.txt 
b/tests/texturing/CMakeLists.gles2.txt
index de4c1a53c..37f1e1986 100644
--- a/tests/texturing/CMakeLists.gles2.txt
+++ b/tests/texturing/CMakeLists.gles2.txt
@@ -1,5 +1,6 @@
 link_libraries(piglitutil_${piglit_target_api})
 
 piglit_add_executable (s3tc-teximage_gles2 s3tc-teximage.c)
+piglit_add_executable (s3tc-texsubimage_gles2 s3tc-texsubimage.c)
 
 # vim: ft=cmake:
diff --git a/tests/texturing/s3tc-texsubimage.c 
b/tests/texturing/s3tc-texsubimage.c
index 3e2260139..7f05b1080 100644
--- a/tests/texturing/s3tc-texsubimage.c
+++ b/tests/texturing/s3tc-texsubimage.c
@@ -36,7 +36,11 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
+#ifdef PIGLIT_USE_OPENGL
config.supports_gl_compat_version = 11;
+#else // PIGLIT_USE_OPENGL_ES2
+   config.supports_gl_es_version = 20;
+#endif
 
config.window_width = 500;
config.window_height = 600;
@@ -52,12 +56,45 @@ const float green[4] = {0.0, 1.0, 0.0, 1.0};
 const float blue[4] =  {0.0, 0.0, 1.0, 1.0};
 const float white[4] = {1.0, 1.0, 1.0, 1.0};
 
+#ifdef  PIGLIT_USE_OPENGL_ES2
+
+const char *vs_source =
+   "#version 100\n"
+   "attribute vec4 piglit_vertex;\n"
+   "attribute vec2 piglit_texcoord;\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform mat4 proj;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_Position = proj * piglit_vertex;\n"
+   "tex_coord = piglit_texcoord;\n"
+   "}\n";
+
+const char *fs_source =
+   "#version 100\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform sampler2D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_FragColor = texture2D(tex, tex_coord);\n"
+   "}\n";
+
+#include "piglit-matrix.h"
+
+GLint tex_program;
+
+#endif
+
 static void
 display_mipmaps(int start_x, int start_y)
 {
int i;
 
+#ifdef PIGLIT_USE_OPENGL
glEnable(GL_TEXTURE_2D);
+#endif
 
/* Disply all the mipmap levels */
for (i = SIZE; i > 0; i /= 2) {
@@ -221,5 +258,16 @@ piglit_init(int argc, char **argv)
 {
piglit_require_extension("GL_EXT_texture_compression_s3tc");
 
+#ifdef PIGLIT_USE_OPENGL
+
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+#else // PIGLIT_USE_OPENGL_ES2
+
+   tex_program = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(tex_program);
+   GLint proj_loc = glGetUniformLocation(tex_program, "proj");
+   piglit_ortho_uniform(proj_loc, piglit_width, piglit_height);
+
+#endif
 }
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 3/6] s3tc-teximage: port to gles2

2018-10-26 Thread Erik Faye-Lund
This specification is also supported on gles2, so let's add support
for gles2 to the test also.

Signed-off-by: Erik Faye-Lund 
---
 tests/texturing/CMakeLists.gles2.txt |  5 +++
 tests/texturing/s3tc-teximage.c  | 48 
 2 files changed, 53 insertions(+)
 create mode 100644 tests/texturing/CMakeLists.gles2.txt

diff --git a/tests/texturing/CMakeLists.gles2.txt 
b/tests/texturing/CMakeLists.gles2.txt
new file mode 100644
index 0..de4c1a53c
--- /dev/null
+++ b/tests/texturing/CMakeLists.gles2.txt
@@ -0,0 +1,5 @@
+link_libraries(piglitutil_${piglit_target_api})
+
+piglit_add_executable (s3tc-teximage_gles2 s3tc-teximage.c)
+
+# vim: ft=cmake:
diff --git a/tests/texturing/s3tc-teximage.c b/tests/texturing/s3tc-teximage.c
index a7225f6f0..1b65f6ce1 100644
--- a/tests/texturing/s3tc-teximage.c
+++ b/tests/texturing/s3tc-teximage.c
@@ -36,7 +36,11 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
+#ifdef PIGLIT_USE_OPENGL
config.supports_gl_compat_version = 11;
+#else // PIGLIT_USE_OPENGL_ES2
+   config.supports_gl_es_version = 20;
+#endif
 
config.window_width = 500;
config.window_height = 600;
@@ -52,12 +56,45 @@ const float green[4] = {0.0, 1.0, 0.0, 1.0};
 const float blue[4] =  {0.0, 0.0, 1.0, 1.0};
 const float white[4] = {1.0, 1.0, 1.0, 1.0};
 
+#ifdef  PIGLIT_USE_OPENGL_ES2
+
+const char *vs_source =
+   "#version 100\n"
+   "attribute vec4 piglit_vertex;\n"
+   "attribute vec2 piglit_texcoord;\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform mat4 proj;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_Position = proj * piglit_vertex;\n"
+   "tex_coord = piglit_texcoord;\n"
+   "}\n";
+
+const char *fs_source =
+   "#version 100\n"
+   "varying mediump vec2 tex_coord;\n"
+   "uniform sampler2D tex;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_FragColor = texture2D(tex, tex_coord);\n"
+   "}\n";
+
+#include "piglit-matrix.h"
+
+GLint tex_program;
+
+#endif
+
 static void
 display_mipmaps(int start_x, int start_y)
 {
int i;
 
+#ifdef PIGLIT_USE_OPENGL
glEnable(GL_TEXTURE_2D);
+#endif
 
/* Disply all the mipmap levels */
for (i = SIZE; i > 0; i /= 2) {
@@ -144,5 +181,16 @@ piglit_init(int argc, char **argv)
 {
piglit_require_extension("GL_EXT_texture_compression_s3tc");
 
+#ifdef PIGLIT_USE_OPENGL
+
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+#else // PIGLIT_USE_OPENGL_ES2
+
+   tex_program = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(tex_program);
+   GLint proj_loc = glGetUniformLocation(tex_program, "proj");
+   piglit_ortho_uniform(proj_loc, piglit_width, piglit_height);
+
+#endif
 }
-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 0/6] port s3tc tests to gles2

2018-10-26 Thread Erik Faye-Lund
Here's version 2 of this series.

Changes since v1:
- Added a "_gles2"-suffix to the executable-names, to avoid name
  collisions with the desktop gl opens.
- Avoid running parts of the test that calls glGetTexLevelParameteriv on
  gles 3.0 and below.

To avoid too much churn in a single patch, the latter point is done as a
separate (new) patch. This is why the series is longer than before.

Erik Faye-Lund (6):
  texturing: make sure s3tc tests require GL 1.1
  texturing: use piglit_draw_rect_tex instead of glBegin/glEnd
  s3tc-teximage: port to gles2
  s3tc-texsubimage: port to gles2
  s3tc-errors: port to gles31
  s3tc-errors: port to gles20

 tests/texturing/CMakeLists.gles2.txt |   7 ++
 tests/texturing/s3tc-errors.c| 108 ---
 tests/texturing/s3tc-teximage.c  |  59 +--
 tests/texturing/s3tc-texsubimage.c   |  59 +--
 4 files changed, 191 insertions(+), 42 deletions(-)
 create mode 100644 tests/texturing/CMakeLists.gles2.txt

-- 
2.17.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] fbo: add a few quirk-tests for format-emulation

2018-10-26 Thread Erik Faye-Lund
On Thu, 2018-10-25 at 14:39 +0100, Emil Velikov wrote:
> On Thu, 25 Oct 2018 at 11:07, Erik Faye-Lund
>  wrote:
> > 
> > On Wed, 2018-10-24 at 16:32 +0100, Emil Velikov wrote:
> > > Hi Erik,
> > > 
> > > A bit of an open question, do we want this test on GLES? If yes,
> > > see
> > > the GLES
> > > notes below.
> > > 
> > 
> > Right. I think I'm fine with only OpenGL for now, as this is a
> > quirk-
> > test.
> > 
> > But yeah, it's totally valuable for GLES as well, and as you point
> > our, should be pretty easy to port there. I'll leave that for the
> > future for now, though.
> > 
> > > Alternatively, I've only spotted couple small nitpicks.
> > > 
> > > On Thu, 20 Sep 2018 at 19:19, Erik Faye-Lund
> > >  wrote:
> > > > 
> > > > Drivers who implement GL_ALPHA textures by swizzling a GL_R
> > > > texture
> > > > needs to be prepared to offer multiple blend-colors, otherwise
> > > > they
> > > > will produce the wrong result, because the blend-color will
> > > > also
> > > > need per-format swizzling.
> > > > 
> > > > Similarly, when drivers implement GL_RGB with GL_RGBA and
> > > > adjust
> > > > the
> > > > blend-factors, they need to have separate blend-factors for all
> > > > framebuffer attachments or the results will be wrong.
> > > > 
> > > > This reveals a couple of bugs in virgl, where these currently
> > > > fail.
> > > > 
> > > > Signed-off-by: Erik Faye-Lund 
> > > > ---
> > > >  tests/fbo/CMakeLists.gl.txt|   1 +
> > > >  tests/fbo/fbo-blending-format-quirks.c | 175
> > > > +
> > > >  tests/opengl.py|   1 +
> > > >  3 files changed, 177 insertions(+)
> > > >  create mode 100644 tests/fbo/fbo-blending-format-quirks.c
> > > > 
> > > > diff --git a/tests/fbo/CMakeLists.gl.txt
> > > > b/tests/fbo/CMakeLists.gl.txt
> > > > index d594c24d3..1a1a60765 100644
> > > > --- a/tests/fbo/CMakeLists.gl.txt
> > > > +++ b/tests/fbo/CMakeLists.gl.txt
> > > > @@ -29,6 +29,7 @@ piglit_add_executable (fbo-blit fbo-blit.c)
> > > >  piglit_add_executable (fbo-blit-d24s8 fbo-blit-d24s8.c)
> > > >  piglit_add_executable (fbo-blit-stretch fbo-blit-stretch.cpp)
> > > >  piglit_add_executable (fbo-blending-formats fbo-blending-
> > > > formats.c)
> > > > +piglit_add_executable (fbo-blending-format-quirks fbo-
> > > > blending-
> > > > format-quirks.c)
> > > 
> > > GLES:
> > > Add a trivial .gles1.txt and/or gles2.txt file. You can use the
> > > ext_image_dma_buf_import ones for reference.
> > > 
> > > 
> > > >  piglit_add_executable (fbo-blending-snorm fbo-blending-
> > > > snorm.c)
> > > >  piglit_add_executable (fbo-colormask-formats fbo-colormask-
> > > > formats.c)
> > > >  piglit_add_executable (fbo-copypix fbo-copypix.c)
> > > > diff --git a/tests/fbo/fbo-blending-format-quirks.c
> > > > b/tests/fbo/fbo-blending-format-quirks.c
> > > > new file mode 100644
> > > > index 0..f6865d42b
> > > > --- /dev/null
> > > > +++ b/tests/fbo/fbo-blending-format-quirks.c
> > > > +#include "piglit-util-gl.h"
> > > > +
> > > > +PIGLIT_GL_TEST_CONFIG_BEGIN
> > > > +
> > > > +   config.supports_gl_compat_version = 10;
> > > > +
> > > 
> > > GLES:
> > > #ifdef PIGLIT_USE_OPENGL
> > > config.supports_gl_compat_version = 10;
> > > #else
> > > config.supports_gl_es_version = ...
> > > #endif
> > > 
> > > 
> > > > +enum piglit_result piglit_display(void)
> > > > +{
> > > > +   int i;
> > > > +enum piglit_result result, end_result = PIGLIT_PASS;
> > > > +bool all_skip = true;
> > > > +
> > > > +   struct {
> > > 
> > > static const
> > > 
> > 
> > Fixed, thanks.
> > 
> > > > +   const char *name;
> > > > +   GLenum formats[2];
> > > > +   GLenum factors[2];
> > > > +   float expect[2][4];
> > > > +   } cases[] = {
> > > 
> > > 
> > > > +
> > > > +void piglit_init(int argc, char **argv)
> > > > +{
> > > 
> > > piglit_require_extension("GL_EXT_framebuffer_object");
> > > 
> 
> You need this ^^
> 

Right, thanks. Fixed.

However, I used tests/fbo/fbo-blending-formats.c as a reference, and
this doesn't seem to do this either. So perhaps a fixup there is in
order as well?

Also, I'm curious; EXT_framebuffer_object is an old, arguably broken
spec. Why are we requiring it rather than ARB_framebuffer_object? Is
the assumption that everyone who implements ARB_framebuffer_object will
also implement EXT_framebuffer_object?

If I were to create a new driver today, I think I would drop
EXT_framebuffer_object, because it creates an ambiguity if framebuffer
objects are shared among contexts or not... So I'm not sure it's a good
assumption.

Better, I think, would be to require *either*.

I'm leaving the test as-is with your suggested change, though. I think
this is a much bigger question, which can be dealt with independently.

> 
> > > GLES:
> > > #ifdef PIGLIT_USE_OPENGL
> > > piglit_require_extension("GL_EXT_framebuffer_object");
> > > #else
> > >