mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Add cmd buffer to container if needed
Command buffers in CommandContainer are removed through cmdBufferAllocations. This PR ensures that allocations will be stored there if they are currently used by given cmd container. Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5078cc27e0
commit
3f17b26253
@@ -333,10 +333,14 @@ void CommandContainer::ensureHeapSizePrepared(size_t sshRequiredSize, size_t dsh
|
||||
GraphicsAllocation *CommandContainer::reuseExistingCmdBuffer() {
|
||||
size_t alignedSize = alignUp<size_t>(this->getTotalCmdBufferSize(), MemoryConstants::pageSize64k);
|
||||
auto cmdBufferAllocation = this->reusableAllocationList->detachAllocation(alignedSize, nullptr, this->immediateCmdListCsr, AllocationType::COMMAND_BUFFER).release();
|
||||
if (cmdBufferAllocation) {
|
||||
this->cmdBufferAllocations.push_back(cmdBufferAllocation);
|
||||
}
|
||||
return cmdBufferAllocation;
|
||||
}
|
||||
|
||||
void CommandContainer::addCurrentCommandBufferToReusableAllocationList() {
|
||||
this->cmdBufferAllocations.erase(std::find(this->cmdBufferAllocations.begin(), this->cmdBufferAllocations.end(), this->commandStream->getGraphicsAllocation()));
|
||||
this->storeAllocationAndFlushTagUpdate(this->commandStream->getGraphicsAllocation());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user