diff options
author | Chris Forbes <chrisforbes@google.com> | 2017-04-28 17:29:10 -0700 |
---|---|---|
committer | Chris Forbes <chrisf@ijw.co.nz> | 2017-05-01 09:05:05 -0700 |
commit | 6e3442c40be4c735b830775a753bb449c331e15d (patch) | |
tree | bef4044084fc4ead4b9c08b1a84e50dae53bd7ee | |
parent | d9944715fa5a4a750a26680f08e5defe85aa7a66 (diff) |
layers: Don't insist on memory dependency for present
When transitioning to/from VK_IMAGE_LAYOUT_PRESENT_SRC_KHR we don't need
to insist on VK_ACCESS_MEMORY_READ_BIT. On the transition TO, it's
automatically handled; in the transition FROM, it's a WAR hazard rather
than RAW/WAW so only the execution dependency is needed.
Fixes #1717.
-rw-r--r-- | layers/buffer_validation.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index ec8016f5..d5b15cb8 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -2078,10 +2078,6 @@ bool ValidateMaskBitsFromLayouts(core_validation::layer_data *device_data, VkCom skip |= ValidateMaskBits(device_data, cmdBuffer, accessMask, layout, VK_ACCESS_TRANSFER_READ_BIT, 0, type); break; } - case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: { - skip |= ValidateMaskBits(device_data, cmdBuffer, accessMask, layout, VK_ACCESS_MEMORY_READ_BIT, 0, type); - break; - } case VK_IMAGE_LAYOUT_UNDEFINED: { if (accessMask != 0) { // TODO: Verify against Valid Use section spec @@ -2092,6 +2088,17 @@ bool ValidateMaskBitsFromLayouts(core_validation::layer_data *device_data, VkCom } break; } + case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: + // Notes: QueuePresentKHR performs automatic visibility operations, + // so the app is /NOT/ required to include VK_ACCESS_MEMORY_READ_BIT + // when transitioning to this layout. + // + // When transitioning /from/ this layout, the application needs to + // avoid only a WAR hazard -- any writes need to be ordered after + // the PE's reads. There is no need for a memory dependency for this + // case. + /* fallthrough */ + case VK_IMAGE_LAYOUT_GENERAL: default: { break; } } |