From ae5512bc0536596a753705bba97d645c946d4c6a Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Wed, 12 Jul 2023 18:34:07 +0200 Subject: [PATCH] cogl/tests: Do not blend for texture format paint tests The default cogl blend string is `RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))` which is alpha blending with premult fragment results. We do not clear the src framebuffer and even if we did set alpha to 1 in the src fb, the resulting alpha would be 1 and we want to check the alpha of the fragment color. Just turn off any kind of blending instead and write out the fragment color to the fb. Part-of: --- src/tests/cogl/conform/test-offscreen-texture-formats.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/cogl/conform/test-offscreen-texture-formats.c b/src/tests/cogl/conform/test-offscreen-texture-formats.c index 093eea01e..828398d97 100644 --- a/src/tests/cogl/conform/test-offscreen-texture-formats.c +++ b/src/tests/cogl/conform/test-offscreen-texture-formats.c @@ -344,6 +344,8 @@ test_offscreen_texture_formats_paint_rgb10 (void) red, green, blue, alpha); pipeline = cogl_pipeline_new (test_ctx); + cogl_pipeline_set_blend (pipeline, + "RGBA = ADD (SRC_COLOR, 0)", NULL); cogl_pipeline_set_layer_texture (pipeline, 0, tex_src); cogl_framebuffer_draw_rectangle (COGL_FRAMEBUFFER (offscreen_dst), pipeline, @@ -468,6 +470,8 @@ test_offscreen_texture_formats_paint_rgb8 (void) &color); pipeline = cogl_pipeline_new (test_ctx); + cogl_pipeline_set_blend (pipeline, + "RGBA = ADD (SRC_COLOR, 0)", NULL); cogl_pipeline_set_layer_texture (pipeline, 0, tex_src); cogl_framebuffer_draw_rectangle (COGL_FRAMEBUFFER (offscreen_dst), pipeline,