From d2cfbff186fb722df8a4184eaeb10335bdbcd06d Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 15 Apr 2021 16:32:28 +0300 Subject: [PATCH] gl-renderer: use shadow framebuffer automatically This creates the FP16 shadow framebuffer automatically if the color transformation from blending space to output space is not identity and the backend does not claim to implement it on the renderer's behalf. That makes the weston_output_set_renderer_shadow_buffer() API and use-renderer-shadow weston.ini option obsolete. To still cater for the one test that needs to enable the shadow framebuffer in spite of not needing it for color correct blending, the quirk it uses now also forces the shadow. Signed-off-by: Pekka Paalanen --- libweston/renderer-gl/gl-renderer.c | 7 +++---- tests/output-damage-test.c | 8 +++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 98661c9e..f4ee6891 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -3313,7 +3313,9 @@ gl_renderer_output_create(struct weston_output *output, go->begin_render_sync = EGL_NO_SYNC_KHR; go->end_render_sync = EGL_NO_SYNC_KHR; - if (output->use_renderer_shadow_buffer) { + if ((output->from_blend_to_output != NULL && + output->from_blend_to_output_by_backend == false) || + quirks->gl_force_full_redraw_of_shadow_fb) { assert(gr->gl_supports_color_transforms); ret = gl_fbo_texture_init(&go->shadow, @@ -3329,9 +3331,6 @@ gl_renderer_output_create(struct weston_output *output, free(go); return -1; } - } else if (quirks->gl_force_full_redraw_of_shadow_fb) { - weston_log("ERROR: gl_force_full_redraw_of_shadow_fb quirk used but shadow fb was not enabled.\n"); - abort(); } output->renderer_state = go; diff --git a/tests/output-damage-test.c b/tests/output-damage-test.c index 7d26e027..21555a35 100644 --- a/tests/output-damage-test.c +++ b/tests/output-damage-test.c @@ -139,16 +139,14 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg) * color regardless of damage. The blit uses damage too, and * the damage pattern that is tested for needs to appear in * that step. + * + * The quirk also ensures the shadow framebuffer is created + * even if not needed. */ setup.test_quirks.gl_force_full_redraw_of_shadow_fb = true; /* To skip instead of fail the test if shadow not available */ setup.test_quirks.required_capabilities = WESTON_CAP_COLOR_OPS; - - weston_ini_setup(&setup, - cfgln("[output]"), - cfgln("name=headless"), - cfgln("use-renderer-shadow=true")); } return weston_test_harness_execute_as_client(harness, &setup);