Skip to content

Commit

Permalink
igl | vulkan | Fix image memory barrier
Browse files Browse the repository at this point in the history
Summary:
Fixed:
```
vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier.
```

Reviewed By: EricGriffith

Differential Revision: D49115074

fbshipit-source-id: d1c5efb190c8377b960d720b18c469fa60bec5dd
  • Loading branch information
corporateshark authored and facebook-github-bot committed Sep 11, 2023
1 parent 94286a3 commit 153462d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/igl/vulkan/VulkanStagingDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void VulkanStagingDevice::imageData(VulkanImage& image,
ivkImageMemoryBarrier(wrapper.cmdBuf_,
image.getVkImage(),
0,
VK_ACCESS_TRANSFER_WRITE_BIT,
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
Expand All @@ -226,7 +226,7 @@ void VulkanStagingDevice::imageData(VulkanImage& image,
// 3. Transition TRANSFER_DST_OPTIMAL into SHADER_READ_ONLY_OPTIMAL
ivkImageMemoryBarrier(wrapper.cmdBuf_,
image.getVkImage(),
VK_ACCESS_TRANSFER_READ_BIT, // VK_ACCESS_TRANSFER_WRITE_BIT,
VK_ACCESS_TRANSFER_READ_BIT | VK_ACCESS_TRANSFER_WRITE_BIT,
VK_ACCESS_SHADER_READ_BIT,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
Expand Down

0 comments on commit 153462d

Please sign in to comment.