Skip to content

Conversation

@TP-David
Copy link
Contributor

@TP-David TP-David commented Jan 20, 2026

These errors appear when enabling "Synchronization" Layer Configuration in Vulkan Configurator and running vsgdraw and vsgtext:

  1. Validation Error: [ SYNC-HAZARD-WRITE-AFTER-READ ] | MessageID = 0x376bc9df vkQueueSubmit(): WRITE_AFTER_READ hazard detected. vkCmdBeginRenderPass: ...
    Fix in vsg::createRenderPass:
    Add VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT to colorDependency.srcAccessMask and depthDependency.dstAccessMask
    Add VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT to depthDependency.srcStageMask and depthDependency.dstStageMask
    Fix in vsg::createMultisampledRenderPass (for multi-sampled windows):
    Add VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT to dependency.dstStageMask and dependency2.srcStageMask
    Add VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT to dependency.dstAccessMask and dependency2.srcAccessMask

  2. Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] | MessageID = 0x5c0ec5d6 vkQueueSubmit(): WRITE_AFTER_WRITE hazard detected. vkCmdCopyBuffer...
    Fix:
    Added a per‑TransferTask fence to serialize transfer submissions so back‑to‑back vkCmdCopyBuffer writes can't overlap on the same queue.

Add VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT to colorDependency.srcAccessMask and depthDependency.dstAccessMask
Add VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT to depthDependency.srcStageMask and depthDependency.dstStageMask
Added a per‑TransferTask fence to serialize transfer submissions so back‑to‑back vkCmdCopyBuffer writes can't overlap on the same queue.
@robertosfield
Copy link
Collaborator

What OS, drivers and hardware did you use in testing?

@TP-David
Copy link
Contributor Author

OS Windows 11
GPU NVIDIA RTX 2000 Ada Generation Laptop GPU
Driver date 10/12/2025
Vulkan 1.4.328.1

…i-sampled window

Add VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT to dependency.dstStageMask and dependency2.srcStageMask
Add VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT to dependency.dstAccessMask and dependency2.srcAccessMask
@robertosfield
Copy link
Collaborator

I've done a first pass review and feel that issues need to be investigated fully, while these changes may be a solution for quieten the validation warnings, there might be more appropriate ways to tackle them. Could you submit the access mask changes and the fence addition as two separate PRs.

When I get to testing and investigating whether these changes are appropriate I'll need to do performance testing as well as checking validation, and testing against other examples as making changes that affect all a broad usage case might have unintended consequences on performance and behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants