Commit 2fb6563b by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Fix CommandGraph barrier nodes w.r.t to first node

The barrier dependencies were set in two loops: - From Previous to (Previous, Current] - From (Previous, Current) to Current The "Previous to Current" dependency was set in the first loop. This loop is conditioned to a previous barrier existing at all. The bug is that for the first barrier node, the first loop does not execute and the second loop does not create the dependency from the first node (Previous index being 0 when no previous barrier exists) to the barrier node. Bug: angleproject:2361 Change-Id: I61a78dbbeba6cf97788bf8ea32908c7865ad48c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520994 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent d84728e0
......@@ -632,16 +632,16 @@ void CommandGraph::setNewBarrier(CommandGraphNode *newBarrier)
size_t previousBarrierIndex = 0;
CommandGraphNode *previousBarrier = getLastBarrierNode(&previousBarrierIndex);
// Add a dependency from previousBarrier to all nodes in (previousBarrier, newBarrier].
// Add a dependency from previousBarrier to all nodes in (previousBarrier, newBarrier).
if (previousBarrier && previousBarrierIndex + 1 < mNodes.size())
{
size_t afterNodesCount = mNodes.size() - (previousBarrierIndex + 1);
size_t afterNodesCount = mNodes.size() - (previousBarrierIndex + 2);
CommandGraphNode::SetHappensBeforeDependencies(
previousBarrier, &mNodes[previousBarrierIndex + 1], afterNodesCount);
}
// Add a dependency from all nodes in (previousBarrier, newBarrier) to newBarrier.
addDependenciesToNextBarrier(previousBarrierIndex + 1, mNodes.size() - 1, newBarrier);
// Add a dependency from all nodes in [previousBarrier, newBarrier) to newBarrier.
addDependenciesToNextBarrier(previousBarrierIndex, mNodes.size() - 1, newBarrier);
mLastBarrierIndex = mNodes.size() - 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment