Move OsContext id setting to constructor.

Change-Id: I1b809befc02536257800e3667307b8deabd5c95d
This commit is contained in:
Mrozek, Michal
2018-09-12 07:47:55 +02:00
committed by sys_ocldev
parent 8e33ec04c5
commit 581805cc88
15 changed files with 39 additions and 27 deletions

View File

@@ -387,9 +387,12 @@ RequirementsStatus MemoryManager::checkAllocationsForOverlapping(AllocationRequi
}
void MemoryManager::registerOsContext(OsContext *contextToRegister) {
auto contextId = contextToRegister->getContextId();
if (contextId + 1 > registeredOsContexts.size()) {
registeredOsContexts.resize(contextId + 1);
}
contextToRegister->incRefInternal();
contextToRegister->setContextId(static_cast<uint32_t>(registeredOsContexts.size()));
registeredOsContexts.push_back(contextToRegister);
registeredOsContexts[contextToRegister->getContextId()] = contextToRegister;
}
bool MemoryManager::getAllocationData(AllocationData &allocationData, bool allocateMemory, const void *hostPtr, size_t size, GraphicsAllocation::AllocationType type) {