mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Require same allocation type when obtaining reusable allocation
Change-Id: I829301b83a6214bcfb4fc9f2692f21ae9a002456 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
395d053f02
commit
ce4a75e121
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -209,14 +209,13 @@ LinearStream &CommandQueue::getCS(size_t minRequiredSize) {
|
||||
|
||||
auto requiredSize = minRequiredSize + CSRequirements::csOverfetchSize;
|
||||
|
||||
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, false).release();
|
||||
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
|
||||
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, allocationType).release();
|
||||
|
||||
if (!allocation) {
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, allocationType});
|
||||
}
|
||||
|
||||
allocation->setAllocationType(GraphicsAllocation::AllocationType::LINEAR_STREAM);
|
||||
|
||||
// Deallocate the old block, if not null
|
||||
auto oldAllocation = commandStream->getGraphicsAllocation();
|
||||
|
||||
|
Reference in New Issue
Block a user