mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-23 20:12:03 +08:00
Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
33 lines
801 B
C++
33 lines
801 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/command_stream/linear_stream.h"
|
|
|
|
#include "runtime/memory_manager/graphics_allocation.h"
|
|
|
|
namespace NEO {
|
|
|
|
LinearStream::LinearStream(void *buffer, size_t bufferSize)
|
|
: sizeUsed(0), maxAvailableSpace(bufferSize), buffer(buffer), graphicsAllocation(nullptr) {
|
|
}
|
|
|
|
LinearStream::LinearStream(GraphicsAllocation *gfxAllocation)
|
|
: sizeUsed(0), graphicsAllocation(gfxAllocation) {
|
|
if (gfxAllocation) {
|
|
maxAvailableSpace = gfxAllocation->getUnderlyingBufferSize();
|
|
buffer = gfxAllocation->getUnderlyingBuffer();
|
|
} else {
|
|
maxAvailableSpace = 0;
|
|
buffer = nullptr;
|
|
}
|
|
}
|
|
|
|
LinearStream::LinearStream()
|
|
: LinearStream(nullptr) {
|
|
}
|
|
} // namespace NEO
|