Skip to content

Commit 0385d6e

Browse files
committed
[Impeller] Cover color attachment loads in the Vulkan render pass incoming dependency
A color attachment with LoadAction::kLoad is read by its loadOp at COLOR_ATTACHMENT_OUTPUT with COLOR_ATTACHMENT_READ access. The incoming VK_SUBPASS_EXTERNAL dependency only listed COLOR_ATTACHMENT_WRITE in its dstAccessMask, so the layout transition and earlier writes weren't made visible to the load. Add COLOR_ATTACHMENT_READ to the destination scope. Adds Play/RendererTest.CachesRenderPassAndFramebufferMixed/Vulkan to the Vulkan sync validation shard. Fixes flutter#195696
1 parent 287ec89 commit 0385d6e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎engine/src/flutter/impeller/renderer/backend/vulkan/render_pass_builder_vk.cc‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ vk::UniqueRenderPass RenderPassBuilderVK::Build(
201201
deps[0].srcAccessMask = vk::AccessFlagBits::eShaderRead |
202202
vk::AccessFlagBits::eColorAttachmentWrite;
203203
deps[0].dstStageMask = vk::PipelineStageFlagBits::eColorAttachmentOutput;
204-
deps[0].dstAccessMask = vk::AccessFlagBits::eColorAttachmentWrite;
204+
// A color attachment with a LOAD loadOp is read at the color attachment
205+
// output stage, so the read must be in the destination scope for the layout
206+
// transition and earlier writes to be made visible to it.
207+
deps[0].dstAccessMask = vk::AccessFlagBits::eColorAttachmentRead |
208+
vk::AccessFlagBits::eColorAttachmentWrite;
205209
if (depth_stencil_.has_value()) {
206210
// A depth/stencil attachment (for example a cached stencil buffer shared
207211
// between passes) may have been written by an earlier render pass. That

‎engine/src/flutter/testing/run_tests.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def vulkan_validation_env(build_dir: str) -> typing.Dict[str, str]:
227227
'Play/TypographerTest.GlyphAtlasTextureWillGrowTilMaxTextureSize/Vulkan',
228228
# Render passes, offscreen targets, MSAA, depth/stencil and subpasses.
229229
'Play/RendererTest.CanRenderToTexture/Vulkan',
230+
'Play/RendererTest.CachesRenderPassAndFramebufferMixed/Vulkan',
230231
'Play/RendererTest.CanSepiaToneWithSubpasses/Vulkan',
231232
'Play/EntityPassTargetTest.SwapWithMSAAImplicitResolve/Vulkan',
232233
# Compute.

0 commit comments

Comments
 (0)