vulkan: Add a hackish way to handle empty children
authorBenjamin Otte <otte@redhat.com>
Mon, 22 May 2023 02:21:02 +0000 (04:21 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Jun 2023 17:42:01 +0000 (19:42 +0200)
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

index 7ce07858f3c2ae72d002cd808d594835d518de65..58987fd9aa5776d63ba4b5a72c62d79036b27463 100644 (file)
@@ -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;