mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +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
|
||||
*
|
||||
@@ -59,11 +59,11 @@ void ExperimentalCommandBuffer::getCS(size_t minRequiredSize) {
|
||||
|
||||
auto requiredSize = minRequiredSize + CSRequirements::csOverfetchSize;
|
||||
auto storageWithAllocations = commandStreamReceiver->getInternalAllocationStorage();
|
||||
GraphicsAllocation *allocation = storageWithAllocations->obtainReusableAllocation(requiredSize, false).release();
|
||||
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
|
||||
GraphicsAllocation *allocation = storageWithAllocations->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 = currentStream->getGraphicsAllocation();
|
||||
if (oldAllocation) {
|
||||
|
||||
Reference in New Issue
Block a user