Refactor allocateGraphicsMemoryInPreferredPool

- extend AllocationType to code necessary flags
- remove redundant args
- refactor Buffer::create()

Change-Id: Ic4b2e0931fad8198ad1cf4f79de210d815048ccf
This commit is contained in:
Hoppe, Mateusz
2018-07-24 18:36:26 +02:00
committed by sys_ocldev
parent c2454d5aa2
commit 4441387969
27 changed files with 468 additions and 112 deletions

View File

@@ -849,7 +849,7 @@ cl_int Program::parseProgramScopePatchList() {
surfaceSize = patch.InlineDataSize;
headerSize = sizeof(SPatchAllocateConstantMemorySurfaceProgramBinaryInfo);
constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(true, true, false, false, nullptr, surfaceSize, GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(true, nullptr, surfaceSize, GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
memcpy_s(constantSurface->getUnderlyingBuffer(), surfaceSize, (cl_char *)pPatch + headerSize, surfaceSize);
pCurPatchListPtr = ptrOffset(pCurPatchListPtr, surfaceSize);
@@ -871,7 +871,7 @@ cl_int Program::parseProgramScopePatchList() {
surfaceSize = patch.InlineDataSize;
globalVarTotalSize += (size_t)surfaceSize;
headerSize = sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo);
globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(true, true, false, false, nullptr, surfaceSize, GraphicsAllocation::AllocationType::GLOBAL_SURFACE);
globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(true, nullptr, surfaceSize, GraphicsAllocation::AllocationType::GLOBAL_SURFACE);
memcpy_s(globalSurface->getUnderlyingBuffer(), surfaceSize, (cl_char *)pPatch + headerSize, surfaceSize);
pCurPatchListPtr = ptrOffset(pCurPatchListPtr, surfaceSize);