Hi Erik,

A bit of an open question, do we want this test on GLES? If yes, see the GLES
notes below.

Alternatively, I've only spotted couple small nitpicks.

On Thu, 20 Sep 2018 at 19:19, Erik Faye-Lund
<erik.faye-l...@collabora.com> 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 <erik.faye-l...@collabora.com>
> ---
>  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 000000000..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

> +               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");

GLES:
#ifdef PIGLIT_USE_OPENGL
        piglit_require_extension("GL_EXT_framebuffer_object");
#else
        piglit_require_extension("GL_OES_framebuffer_object");
        // Or use GLES 2.0 above and drop the extension check
        // Note; the EXT suffix will need need to be changed to OES or dropped.
#endif


With the nitpicks, ES is something that can be done when needed.
Reviewed-by: Emil Velikov <emil.veli...@collabora.com>


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

Reply via email to