2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/command_stream/linear_stream.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-06-26 15:23:34 +02:00
|
|
|
LinearStream::LinearStream(GraphicsAllocation *gfxAllocation, void *buffer, size_t bufferSize)
|
|
|
|
|
: sizeUsed(0), maxAvailableSpace(bufferSize), buffer(buffer), graphicsAllocation(gfxAllocation) {
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
LinearStream::LinearStream(void *buffer, size_t bufferSize)
|
2019-06-26 15:23:34 +02:00
|
|
|
: LinearStream(nullptr, buffer, bufferSize) {
|
2017-12-21 00:45:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|