KhronosGroup / KhronosGroup/Vulkan-Tools

vkcube synchronization issues

Open
#1,162 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
491
Forks
202
Avg merge
1h 37m
Merged PRs (30d)
4

Description

Running vkcube with synchronization enabled in validation layers gives:

```
Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6
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 0x260000000026) in subpass 0 of VkRenderPass 0xd000000000d (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_READ_BIT|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.
Objects: 1
[0] VkRenderPass 0xd000000000d

Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6
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 0x260000000026) in subpass 0 of VkRenderPass 0xd000000000d (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_READ_BIT|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.
Objects: 1
[0] VkRenderPass 0xd000000000d

Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6
vkQueueSubmit(): WRITE_AFTER_WRITE hazard detected. vkCmdBeginRenderPass (from VkCommandBuffer 0x267cb00e610 submitted on the current VkQueue 0x267cab003d0) writes to resource, which was previously written by vkCmdEndRenderPass (from VkCommandBuffer 0x267cb00bc50 submitted on VkQueue 0x267cab003d0).
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.
Objects: 2
[0] VkQueue 0x267cab003d0
[1] VkCommandBuffer 0x267cb00e610
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the validation errors while running vkcube with synchronization validation enabled. Inspect the vkcube render-pass and command submission paths related to the reported depth attachment transitions; done means the reported synchronization hazards no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.