From 1cf6dfab2faf62de3d26e6ec0f1108533cc33545 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 22 May 2023 04:21:02 +0200 Subject: [PATCH] vulkan: Add a hackish way to handle empty children For blend and crossfade nodes, one of the children may exist and influence the rendering, while the other does not. Previously, we would skip the node, which would cause the required rendering to not happen. We now send a valid texture id for the invalid offscreen, thereby actually rendering the required parts. Fixes the blend-invisible-child compare test Current state for compare tests: Ok: 397 Expected Fail: 0 Fail: 26 Unexpected Pass: 0 Skipped: 2 Timeout: 0 --- gsk/vulkan/gskvulkanrenderpass.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gsk/vulkan/gskvulkanrenderpass.c b/gsk/vulkan/gskvulkanrenderpass.c index 7ce07858f3..58987fd9aa 100644 --- a/gsk/vulkan/gskvulkanrenderpass.c +++ b/gsk/vulkan/gskvulkanrenderpass.c @@ -1668,6 +1668,16 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self, &op->render.offset, &tex_bounds); get_tex_rect (&op->render.source2_rect, &op->render.node->bounds, &tex_bounds); + if (!op->render.source) + { + op->render.source = op->render.source2; + op->render.source_rect = *graphene_rect_zero(); + } + if (!op->render.source2) + { + op->render.source2 = op->render.source; + op->render.source2_rect = *graphene_rect_zero(); + } } break; @@ -1696,6 +1706,16 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass *self, &op->render.offset, &tex_bounds); get_tex_rect (&op->render.source2_rect, &op->render.node->bounds, &tex_bounds); + if (!op->render.source) + { + op->render.source = op->render.source2; + op->render.source_rect = *graphene_rect_zero(); + } + if (!op->render.source2) + { + op->render.source2 = op->render.source; + op->render.source2_rect = *graphene_rect_zero(); + } } break; -- 2.30.2