diff --git a/tests/alpha-blending-test.c b/tests/alpha-blending-test.c index 8ae4b810a..b7ea6c21b 100644 --- a/tests/alpha-blending-test.c +++ b/tests/alpha-blending-test.c @@ -60,6 +60,11 @@ static const struct setup_args my_setup_args[] = { .color_management = true, .meta.name = "GL sRGB EOTF" }, + { + .renderer = WESTON_RENDERER_VULKAN, + .color_management = false, + .meta.name = "Vulkan" + }, }; static enum test_result_code diff --git a/tests/buffer-transforms-test.c b/tests/buffer-transforms-test.c index fdeb845f3..e20c0af33 100644 --- a/tests/buffer-transforms-test.c +++ b/tests/buffer-transforms-test.c @@ -48,6 +48,13 @@ .transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform_name = #t, \ .meta.name = "GL " #s " " #t, \ + }, \ + { \ + .renderer = WESTON_RENDERER_VULKAN, \ + .scale = s, \ + .transform = WL_OUTPUT_TRANSFORM_ ## t, \ + .transform_name = #t, \ + .meta.name = "Vulkan " #s " " #t, \ } struct setup_args { diff --git a/tests/client-buffer-test.c b/tests/client-buffer-test.c index 148a680b0..e326a18a9 100644 --- a/tests/client-buffer-test.c +++ b/tests/client-buffer-test.c @@ -107,6 +107,16 @@ static const uint32_t gl_dmabuf_format_must_pass[] = { DRM_FORMAT_P016, }; +static const uint32_t vulkan_shm_format_must_pass[] = { + DRM_FORMAT_ARGB8888, + DRM_FORMAT_XRGB8888 +}; + +static const uint32_t vulkan_dmabuf_format_must_pass[] = { + DRM_FORMAT_ARGB8888, + DRM_FORMAT_XRGB8888 +}; + static const struct setup_args my_setup_args[] = { { .meta.name = "GL", @@ -124,6 +134,15 @@ static const struct setup_args my_setup_args[] = { .dmabuf_format_num = ARRAY_LENGTH(gl_dmabuf_format_must_pass), .gl_force_import_yuv_fallback = true, }, + { + .renderer = WESTON_RENDERER_VULKAN, + .logging_scopes = "log", + .meta.name = "Vulkan", + .shm_format_must_pass = vulkan_shm_format_must_pass, + .shm_format_num = ARRAY_LENGTH(vulkan_shm_format_must_pass), + .dmabuf_format_must_pass = vulkan_dmabuf_format_must_pass, + .dmabuf_format_num = ARRAY_LENGTH(vulkan_dmabuf_format_must_pass), + }, }; static enum test_result_code diff --git a/tests/output-capture-protocol-test.c b/tests/output-capture-protocol-test.c index cb48c09a9..8289adcff 100644 --- a/tests/output-capture-protocol-test.c +++ b/tests/output-capture-protocol-test.c @@ -49,6 +49,11 @@ static const struct setup_args my_setup_args[] = { .renderer = WESTON_RENDERER_GL, .expected_drm_format = DRM_FORMAT_ARGB8888, }, + { + .meta.name = "Vulkan", + .renderer = WESTON_RENDERER_VULKAN, + .expected_drm_format = DRM_FORMAT_ARGB8888, + }, }; static enum test_result_code diff --git a/tests/output-damage-test.c b/tests/output-damage-test.c index cc7975464..320f5e91f 100644 --- a/tests/output-damage-test.c +++ b/tests/output-damage-test.c @@ -51,12 +51,12 @@ .meta.name = "GL no-shadow " #s " " #t, \ }, \ { \ - .renderer = WESTON_RENDERER_GL, \ + .renderer = WESTON_RENDERER_VULKAN, \ .scale = s, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform_name = #t, \ - .gl_shadow_fb = true, \ - .meta.name = "GL shadow " #s " " #t, \ + .gl_shadow_fb = false, \ + .meta.name = "Vulkan " #s " " #t, \ } struct setup_args { @@ -112,9 +112,9 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg) * Then the test checks that only the damage area gets the new color * on screen. * - * The following quirk forces GL-renderer to update the whole texture - * even for partial damage. Otherwise, GL-renderer would only copy the - * damaged area from the wl_shm buffer into a GL texture. + * The following quirk forces GL-renderer and Vulkan-renderer to update + * the whole texture even for partial damage. Otherwise, they would + * only copy the damaged area from the wl_shm buffer into a texture. * * Those output_damage tests where the surface is scaled up by the * compositor will use bilinear texture sampling due to the policy @@ -122,12 +122,13 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg) * * Pixman renderer never makes copies of wl_shm buffers, so bilinear * sampling there will always produce the expected result. However, - * with GL-renderer if the texture is not updated beyond the strict - * damage region, bilinear sampling will result in a blend of the old - * and new colors at the edges of the damage rectangles. This blend - * would be detrimental to testing the damage regions and would cause - * test failures due to reference image mismatch. What we actually - * want to see is the crisp outline of the damage rectangles. + * with GL-renderer and Vulkan-renderer if the texture is not updated + * beyond the strict damage region, bilinear sampling will result in a + * blend of the old and new colors at the edges of the damage + * rectangles. This blend would be detrimental to testing the damage + * regions and would cause test failures due to reference image + * mismatch. What we actually want to see is the crisp outline of the + * damage rectangles. */ setup.test_quirks.force_full_upload = true; diff --git a/tests/output-decorations-test.c b/tests/output-decorations-test.c index 6b26e0df4..88bfedb05 100644 --- a/tests/output-decorations-test.c +++ b/tests/output-decorations-test.c @@ -39,6 +39,10 @@ static const struct setup_args my_setup_args[] = { .meta.name = "GL", .renderer = WESTON_RENDERER_GL, }, + { + .renderer = WESTON_RENDERER_VULKAN, + .meta.name = "Vulkan", + }, }; static enum test_result_code diff --git a/tests/output-transforms-test.c b/tests/output-transforms-test.c index 28b681207..05b9da45c 100644 --- a/tests/output-transforms-test.c +++ b/tests/output-transforms-test.c @@ -48,6 +48,13 @@ .transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform_name = #t, \ .meta.name = "GL " #s " " #t, \ + }, \ + { \ + .renderer = WESTON_RENDERER_VULKAN, \ + .scale = s, \ + .transform = WL_OUTPUT_TRANSFORM_ ## t, \ + .transform_name = #t, \ + .meta.name = "Vulkan " #s " " #t, \ } struct setup_args { diff --git a/tests/pointer-shot-test.c b/tests/pointer-shot-test.c index 8ef7df740..23de08e57 100644 --- a/tests/pointer-shot-test.c +++ b/tests/pointer-shot-test.c @@ -48,6 +48,10 @@ static const struct setup_args my_setup_args[] = { .renderer = WESTON_RENDERER_GL, .meta.name = "GL" }, + { + .renderer = WESTON_RENDERER_VULKAN, + .meta.name = "Vulkan" + }, }; static enum test_result_code diff --git a/tests/subsurface-shot-test.c b/tests/subsurface-shot-test.c index 52e3a648f..80cdbb27b 100644 --- a/tests/subsurface-shot-test.c +++ b/tests/subsurface-shot-test.c @@ -48,6 +48,10 @@ static const struct setup_args my_setup_args[] = { .renderer = WESTON_RENDERER_GL, .meta.name = "GL" }, + { + .renderer = WESTON_RENDERER_VULKAN, + .meta.name = "Vulkan" + }, }; static enum test_result_code diff --git a/tests/viewporter-shot-test.c b/tests/viewporter-shot-test.c index baa8fa0d2..caede8482 100644 --- a/tests/viewporter-shot-test.c +++ b/tests/viewporter-shot-test.c @@ -48,6 +48,10 @@ static const struct setup_args my_setup_args[] = { .renderer = WESTON_RENDERER_GL, .meta.name = "GL" }, + { + .renderer = WESTON_RENDERER_VULKAN, + .meta.name = "Vulkan" + }, }; static enum test_result_code diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c index cb396a54b..6207e64bf 100644 --- a/tests/weston-test-fixture-compositor.c +++ b/tests/weston-test-fixture-compositor.c @@ -227,6 +227,7 @@ renderer_to_str(enum weston_renderer_type t) [WESTON_RENDERER_NOOP] = "noop", [WESTON_RENDERER_PIXMAN] = "pixman", [WESTON_RENDERER_GL] = "gl", + [WESTON_RENDERER_VULKAN] = "vulkan", }; test_assert_true(t >= 0 && t <= ARRAY_LENGTH(names)); return names[t]; @@ -414,6 +415,13 @@ execute_compositor(const struct compositor_setup *setup, } #endif +#ifndef ENABLE_VULKAN + if (setup->renderer == WESTON_RENDERER_VULKAN) { + fprintf(stderr, "Vulkan renderer required but not built, skipping.\n"); + ret = RESULT_SKIP; + } +#endif + test_data.test_quirks = setup->test_quirks; test_data.test_private_data = data; prog_args_save(&args);