Repository navigation
Description
Steps to reproduce
With #195596 applied, build impeller_unittests with SwiftShader and run it with synchronization validation enabled:
./bin/et build -c ci/host_debug_arm64_tests //flutter/impeller:impeller_unittests
cd ../out/ci/host_debug_arm64_tests
VK_ICD_FILENAMES=$PWD/vk_swiftshader_icd.json \
VK_LAYER_PATH=$PWD/vulkan-data \
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
DYLD_LIBRARY_PATH=$PWD \
./impeller_unittests \
--gtest_filter='Play/AiksTest.CanRenderNestedBackdropBlur/Vulkan:Play/AiksTest.GaussianBlurBackdropTinyMipMap/Vulkan' \
--enable_vulkan_sync_validationExpected results
No synchronization hazards reported.
Actual results
ID Name: SYNC-HAZARD-WRITE-AFTER-WRITE
Trigger: vkQueueSubmit(): WRITE_AFTER_WRITE hazard detected. vkCmdBeginRenderPass (from VkCommandBuffer 0x…[EntityPass Command Buffer] submitted on the current VkQueue 0x…[ImpellerGraphicsQ]) writes to resource, which was previously written at the end of subpass 0 (vkCmdEndRenderPass) by the attachment storeOp (from VkCommandBuffer 0x…[EntityPass Command Buffer] submitted on VkQueue 0x…[ImpellerGraphicsQ]).
No sufficient synchronization is present to ensure that a layout transition does not conflict with a prior write (VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) at VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT.Analysis
A depth/stencil attachment is reused by a render pass in a later submission, for example a cached stencil buffer shared across EntityPass passes. The layout transition at vkCmdBeginRenderPass isn't ordered after the previous pass's depth/stencil storeOp. The incoming VK_SUBPASS_EXTERNAL dependency in RenderPassBuilderVK::Build only lists eColorAttachmentOutput | eFragmentShader in srcStageMask and eShaderRead | eColorAttachmentWrite in srcAccessMask. It probably also needs eLateFragmentTests and eDepthStencilAttachmentWrite.
This is the source-side counterpart of the third hazard in #194987, which is about the destination side of the same dependency. One fix may cover both.
Play/AiksTest.CanRenderNestedBackdropBlur/Vulkan and Play/AiksTest.GaussianBlurBackdropTinyMipMap/Vulkan are commented out of the sync validation shard (#195502) until this and #194987 are fixed.
Activity
[Impeller] Cover depth/stencil in the Vulkan render pass incoming dep…
[vulkan]: Adds depth/stencil synchronization for subpasses (flutter#1…