aboutsummaryrefslogtreecommitdiff
path: root/layers/buffer_validation.cpp
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@lunarg.com>2018-03-24 19:52:19 -0600
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>2018-03-30 08:44:28 -0600
commit1b4992821704c2a076fe02fadabc424bbe64bdab (patch)
tree0a1a41929fad706de62892ab04e234d58493bf95 /layers/buffer_validation.cpp
parentccc29e05c0c4ba36e81ec6fee5d48ce489d80d12 (diff)
downloadusermoji-1b4992821704c2a076fe02fadabc424bbe64bdab.tar.xz
layers: Eliminate false positive on ownership xfer
Add logic that correctly ignores the src(dst)StageMask for barrier operations that are resource acquire(release) operations. When barrier operations transfer ownership they envitably run on two different queue families which may have incompatible capabilities. For release operations dstStageMask should be ignored. For acquire operations the srcStageMask should be. Note: this can only be done if *all* operations for a barrier command are of one type, as the *StageMasks are specified at the command level. Change-Id: I6c238ab121eaa1230e66716120d37204740408d6
Diffstat (limited to 'layers/buffer_validation.cpp')
-rw-r--r--layers/buffer_validation.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp
index 48212e1a..4142c831 100644
--- a/layers/buffer_validation.cpp
+++ b/layers/buffer_validation.cpp
@@ -573,11 +573,10 @@ bool ValidateBarriersToImages(layer_data *device_data, GLOBAL_CB_NODE const *cb_
}
static bool IsReleaseOp(layer_data *device_data, GLOBAL_CB_NODE *cb_state, VkImageMemoryBarrier const *barrier) {
- if (barrier->srcQueueFamilyIndex == barrier->dstQueueFamilyIndex)
- return false;
+ if (!IsTransferOp(barrier)) return false;
auto pool = GetCommandPoolNode(device_data, cb_state->createInfo.commandPool);
- return pool->queueFamilyIndex == barrier->srcQueueFamilyIndex;
+ return pool && IsReleaseOp<VkImageMemoryBarrier, true>(pool, barrier);
}
void TransitionImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *cb_state, uint32_t memBarrierCount,