cogl/tests: Skip 10bpc tests if the pixel formats are not supported

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3429>
This commit is contained in:
Sebastian Wick 2023-11-28 22:03:54 +01:00 committed by Marge Bot
parent 7f943613a8
commit 962ca18341

View File

@ -71,6 +71,12 @@ test_offscreen_texture_formats_store_rgb10 (void)
}; };
int i; int i;
if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_RGBA1010102))
{
g_test_skip ("Driver does not support 10bpc formats");
return;
}
/* The extra fraction is there to avoid rounding inconsistencies in OpenGL /* The extra fraction is there to avoid rounding inconsistencies in OpenGL
* implementations. */ * implementations. */
red = (rgb10_red / (float) ((1 << 10) - 1)) + 0.00001; red = (rgb10_red / (float) ((1 << 10) - 1)) + 0.00001;
@ -302,6 +308,12 @@ test_offscreen_texture_formats_paint_rgb10 (void)
}; };
int i; int i;
if (!cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_RGBA1010102))
{
g_test_skip ("Driver does not support 10bpc formats");
return;
}
/* The extra fraction is there to avoid rounding inconsistencies in OpenGL /* The extra fraction is there to avoid rounding inconsistencies in OpenGL
* implementations. */ * implementations. */
red = (rgb10_red / (float) ((1 << 10 ) - 1)) + 0.00001; red = (rgb10_red / (float) ((1 << 10 ) - 1)) + 0.00001;