From 1b4992821704c2a076fe02fadabc424bbe64bdab Mon Sep 17 00:00:00 2001 From: John Zulauf Date: Sat, 24 Mar 2018 19:52:19 -0600 Subject: 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 --- layers/buffer_validation.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'layers/buffer_validation.cpp') 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(pool, barrier); } void TransitionImageLayouts(layer_data *device_data, GLOBAL_CB_NODE *cb_state, uint32_t memBarrierCount, -- cgit v1.2.3