StimBuff: Use a single StagingBuffer for all StimFrames
We now allocate all the stimFrames for a StimBuffer using a single StagingBuffer. This gives us all the benefits we're looking for (pinning, alignment, etc).
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <memory>
|
||||
#include <user/spMcRingBuffer.h>
|
||||
#include <user/stagingBuffer.h>
|
||||
#include <user/frameAssemblyDesc.h>
|
||||
#include "stimulusFrame.h"
|
||||
#include "deviceAttachmentSpec.h"
|
||||
|
||||
@@ -30,15 +31,15 @@ public:
|
||||
&deviceAttachmentSpec,
|
||||
int histbuffMs,
|
||||
const StagingBuffer::IOEngineConstraints& inputEngineConstraints,
|
||||
const StagingBuffer::IOEngineConstraints& outputEngineConstraints,
|
||||
size_t nSlotsPerStimFrame)
|
||||
const StagingBuffer::IOEngineConstraints& outputEngineConstraints)
|
||||
: parent(parent),
|
||||
deviceAttachmentSpec(deviceAttachmentSpec),
|
||||
histbuffMs(histbuffMs),
|
||||
ringBuffer(
|
||||
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS),
|
||||
inputEngineConstraints, outputEngineConstraints,
|
||||
nSlotsPerStimFrame)
|
||||
stagingBuffer(
|
||||
inputEngineConstraints,
|
||||
outputEngineConstraints,
|
||||
static_cast<size_t>(histbuffMs / CONFIG_STIMBUFF_FRAME_PERIOD_MS)),
|
||||
ringBuffer(static_cast<std::shared_ptr<FrameAssemblyDesc>>(stagingBuffer))
|
||||
{}
|
||||
|
||||
virtual ~StimulusBuffer() = default;
|
||||
@@ -53,6 +54,7 @@ public:
|
||||
StimulusProducer& parent;
|
||||
std::shared_ptr<device::DeviceAttachmentSpec> deviceAttachmentSpec;
|
||||
int histbuffMs;
|
||||
StagingBuffer stagingBuffer;
|
||||
SpMcRingBuffer ringBuffer;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user