-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
Description
Describe the bug
When the Vulkan SDK 1.4.328.1+Vulkan Configurator with sync2 activated, Avalonia seems to have several Write_after_write hazards active related to image layout transitions.
Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6
[AppName: GpuInterop] vkCmdBeginRenderPass(): WRITE_AFTER_WRITE hazard detected: attachment loadOp access is not synchronized with the attachment layout transition. vkCmdBeginRenderPass clears the depth aspect of attachment 1 (VkImageView 0x460000000046) in subpass 0 of VkRenderPass 0x470000000047 (loadOp VK_ATTACHMENT_LOAD_OP_CLEAR), which was previously written during an image layout transition initiated by the same command.
The current synchronization allows VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT accesses at VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, but to prevent this hazard, it must allow VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT accesses at VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT.
[Extra properties]
message_type = RenderPassLoadOpVsLayoutTransitionError
hazard_type = WRITE_AFTER_WRITE
access = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT(VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)
prior_access = SYNC_IMAGE_LAYOUT_TRANSITION
write_barriers = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT(VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT)
command = vkCmdBeginRenderPass
load_op = VK_ATTACHMENT_LOAD_OP_CLEAR
Objects: 1
[0] VkRenderPass 0x470000000047
[AppName: GpuInterop] vkCmdBeginRenderPass(): WRITE_AFTER_WRITE hazard detected: attachment loadOp access is not synchronized with the attachment layout transition. vkCmdBeginRenderPass clears the depth aspect of attachment 1 (VkImageView 0x460000000046) in subpass 0 of VkRenderPass 0x470000000047 (loadOp VK_ATTACHMENT_LOAD_OP_CLEAR), which was previously written during an image layout transition initiated by the same command.
The current synchronization allows VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT accesses at VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT, but to prevent this hazard, it must allow VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT accesses at VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT.
[Extra properties]
message_type = RenderPassLoadOpVsLayoutTransitionError
hazard_type = WRITE_AFTER_WRITE
access = VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT(VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT)
prior_access = SYNC_IMAGE_LAYOUT_TRANSITION
write_barriers = VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT(VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT)
command = vkCmdBeginRenderPass
load_op = VK_ATTACHMENT_LOAD_OP_CLEAR
Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6
[AppName: AvaloniaUI] vkCmdPipelineBarrier(): WRITE_AFTER_WRITE hazard detected. vkCmdPipelineBarrier performs image layout transition on the VkImage 0x7e000000007e, which was previously written by vkCmdBlitImage.
No sufficient synchronization is present to ensure that a layout transition does not conflict with a prior write (VK_ACCESS_2_TRANSFER_WRITE_BIT) at VK_PIPELINE_STAGE_2_BLIT_BIT.
pImageMemoryBarriers[0]: {
source accesses = 0,
destination accesses = 0,
srcStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
}
[Extra properties]
message_type = ImageBarrierError
hazard_type = WRITE_AFTER_WRITE
access = SYNC_IMAGE_LAYOUT_TRANSITION
prior_access = VK_PIPELINE_STAGE_2_BLIT_BIT(VK_ACCESS_2_TRANSFER_WRITE_BIT)
write_barriers = 0
command = vkCmdPipelineBarrier
prior_command = vkCmdBlitImage
seq_no = 3
reset_no = 0
Objects: 2
[0] VkCommandBuffer 0x2ae617e9f88
[1] VkImage 0x7e000000007e
These will repeat.
To Reproduce
Integrated GPU Intel(R) HD Graphics 530 (0.404.2114)
Vulkan Configurator Vesion 3.4.0 - 20251008
Vulkan API Version 1.4.328
Windows 10.
Open Vulkan Configurator, enable synchronization 2 and tick Synchronization->Submit time validation.
Message Severity Warning and Error.
(untick "Limit Duplicated Messages")
Edit: Seems to happen when hovering over one of the sliders and during init-phase)
Expected behavior
No sync errors
Avalonia version
11.3.7
OS
Windows
Additional context
PS: I will check if this persists in the latest release build (11.3.8)