Skip to content

Commit 9e4c3f9

Browse files
Justus Wangdavidlunarg
authored andcommitted
layersvt: Fix access mask in screenshot layer
This change fixes two access mask issues in screenshot layer: 1. The pipeline barrier which used to transition from present layout for swapchain image should use VK_ACCESS_MEMORY_WRITE_BIT as srcAccessMask to make sure all writes that are performed by entities known to the Vulkan device are made available before read happens. 2. The pipeline barrier which used to transition a dest layout to general layout should have dstAccessMask for CPU to read memory.
1 parent a36d5fd commit 9e4c3f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layersvt/screenshot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ static void writePPM(const char *filename, VkImage image1) {
732732
// This barrier is used to transition from/to present Layout
733733
VkImageMemoryBarrier presentMemoryBarrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
734734
NULL,
735-
VK_ACCESS_TRANSFER_WRITE_BIT,
735+
VK_ACCESS_MEMORY_WRITE_BIT,
736736
VK_ACCESS_TRANSFER_READ_BIT,
737737
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
738738
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
@@ -758,7 +758,7 @@ static void writePPM(const char *filename, VkImage image1) {
758758
VkImageMemoryBarrier generalMemoryBarrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
759759
NULL,
760760
VK_ACCESS_TRANSFER_WRITE_BIT,
761-
VK_ACCESS_TRANSFER_READ_BIT,
761+
VK_ACCESS_MEMORY_READ_BIT,
762762
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
763763
VK_IMAGE_LAYOUT_GENERAL,
764764
VK_QUEUE_FAMILY_IGNORED,

0 commit comments

Comments
 (0)