fix: Restore main command stream when reset cmd list

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-04-09 11:43:41 +00:00
committed by Compute-Runtime-Automation
parent 6ffa756457
commit 4106398002
2 changed files with 17 additions and 2 deletions

View File

@@ -195,8 +195,18 @@ void CommandContainer::reset() {
getDeallocationContainer().clear();
sshAllocations.clear();
this->handleCmdBufferAllocations(1u);
cmdBufferAllocations.erase(cmdBufferAllocations.begin() + 1, cmdBufferAllocations.end());
auto defaultCmdBuffersCnt = 1u + this->useSecondaryCommandStream;
this->handleCmdBufferAllocations(defaultCmdBuffersCnt);
cmdBufferAllocations.erase(cmdBufferAllocations.begin() + defaultCmdBuffersCnt, cmdBufferAllocations.end());
if (this->useSecondaryCommandStream) {
if (!NEO::MemoryPoolHelper::isSystemMemoryPool(this->getCommandStream()->getGraphicsAllocation()->getMemoryPool())) {
this->swapStreams();
}
setCmdBuffer(cmdBufferAllocations[1]);
this->swapStreams();
}
setCmdBuffer(cmdBufferAllocations[0]);