From: Benjamin Otte Date: Mon, 22 May 2023 02:21:02 +0000 (+0200) Subject: vulkan: Add a hackish way to handle empty children X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~185^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1cf6dfab2faf62de3d26e6ec0f1108533cc33545;p=gtk4.git 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 --- 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;