KhronosGroup / KhronosGroup/Vulkan-ValidationLayers
Hazard WRITE_AFTER_WRITE using Secondary Command Buffers
- Dominant language
- C++
- Stars
- 1k
- Forks
- 504
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 224
Description
**Environment:**
- OS: Windows 11 22H2
- GPU and driver version: NVIDIA GeForce RTX 3050 Laptop. Driver version: 551.86.0.0
- SDK or header version if building from repo: 1.3.280.0
- Options enabled (synchronization, best practices, etc.): synchronization
**Describe the Issue**
The source issue was described on [Discourse](https://community.khronos.org/t/hazard-write-after-write/110622).
I faced the problem when I used multisubpass and secondary command buffers. I got the Hazard WAW error. Without secondary buffers, I got no errors.
You can familiarize yourself with the example based on VulkanTutorial [here](https://github.com/wusikijeronii/VulkanTutorial-cleaned/blob/main/code/27_depth_buffering.cpp).
I received an error about sync image layout, but it is somewhat nonsensical that Store Op could hazard anything (look at the error below).
**Additional context**
code or terminal output
```sh
validation layer: Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0xead9370000000008, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x5c0ec5d6 | vkCmdEndRenderPass(): Hazard WRITE_AFTER_WRITE in subpass 1 for attachment 1 color aspect during store with storeOp VK_ATTACHMENT_STORE_OP_DONT_CARE. Access info (usage: SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: SYNC_FRAGMENT_SHADER_INPUT_ATTACHMENT_READ, command: vkCmdNextSubpass, seq_no: 3, subcmd: 1, renderpass: VkRenderPass 0xead9370000000008[], reset_no: 2)
```
Contributor guide
Assessment
This issue has not been assessed yet.