Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb2d236

Browse files
committed
Add note about implicit host write synchronization on command buffer submission
1 parent 382c7a3 commit fb2d236

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

06_Texture_mapping/00_Images.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,13 @@ if (oldLayout == VK_IMAGE_LAYOUT_PREINITIALIZED && newLayout == VK_IMAGE_LAYOUT_
757757

758758
If we need to do more transitions in the future, then we'll extend the function.
759759
The application should now run successfully, although there are of course no
760-
visual changes yet.
760+
visual changes yet. One thing to note is that command buffer submission results
761+
in implicit `VK_ACCESS_HOST_WRITE_BIT` synchronization at the beginning. Since
762+
the `transitionImageLayout` function executes a command buffer with only a
763+
single command, we can use this implicit synchronization and set `srcAccessMask`
764+
to `0` for the first two types of transitions. It's up to you if you want to be
765+
explicit about it or not, but I'm personally not a fan of relying on these
766+
OpenGL-like "hidden" operations.
761767

762768
There is actually a special type of image layout that supports all operations,
763769
`VK_IMAGE_LAYOUT_GENERAL`. The problem with it, of course, is that it doesn't

0 commit comments

Comments
 (0)