mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
Revert "fix: Remove fence handling when reuse cmd buffer"
This reverts commit f3bbd70a58.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
46fb73026e
commit
63a5b64c7e
@@ -296,9 +296,28 @@ void CommandContainer::handleCmdBufferAllocations(size_t startIndex) {
|
||||
}
|
||||
for (size_t i = startIndex; i < cmdBufferAllocations.size(); i++) {
|
||||
if (this->reusableAllocationList) {
|
||||
if (isHandleFenceCompletionRequired) {
|
||||
bool allocationHandled = false;
|
||||
for (auto &engine : this->device->getMemoryManager()->getRegisteredEngines(cmdBufferAllocations[i]->getRootDeviceIndex())) {
|
||||
auto osContextId = engine.osContext->getContextId();
|
||||
if (cmdBufferAllocations[i]->isUsedByOsContext(osContextId) && engine.commandStreamReceiver->isAnyDirectSubmissionEnabled()) {
|
||||
auto lock = engine.commandStreamReceiver->obtainUniqueOwnership();
|
||||
auto taskCount = engine.commandStreamReceiver->peekTaskCount() + 1;
|
||||
cmdBufferAllocations[i]->updateTaskCount(taskCount, osContextId);
|
||||
cmdBufferAllocations[i]->updateResidencyTaskCount(taskCount, osContextId);
|
||||
engine.commandStreamReceiver->flushTagUpdate();
|
||||
engine.commandStreamReceiver->waitForTaskCount(taskCount);
|
||||
allocationHandled = true;
|
||||
}
|
||||
}
|
||||
if (!allocationHandled && isHandleFenceCompletionRequired) {
|
||||
this->device->getMemoryManager()->handleFenceCompletion(cmdBufferAllocations[i]);
|
||||
}
|
||||
|
||||
for (auto &engine : this->device->getMemoryManager()->getRegisteredEngines(cmdBufferAllocations[i]->getRootDeviceIndex())) {
|
||||
auto osContextId = engine.osContext->getContextId();
|
||||
cmdBufferAllocations[i]->releaseUsageInOsContext(osContextId);
|
||||
}
|
||||
|
||||
reusableAllocationList->pushFrontOne(*cmdBufferAllocations[i]);
|
||||
} else {
|
||||
this->device->getMemoryManager()->freeGraphicsMemory(cmdBufferAllocations[i]);
|
||||
|
||||
Reference in New Issue
Block a user