LG1PclAmbienceStencil: allocate stencils in constructor
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
#include <cstddef>
|
||||
#include <user/stimulusBuffer.h>
|
||||
#include <user/stagingBuffer.h>
|
||||
#include "lg1PcloudAmbienceStencil.h"
|
||||
|
||||
namespace smo {
|
||||
namespace stim_buff {
|
||||
@@ -27,13 +30,20 @@ public:
|
||||
const StagingBuffer::IOEngineConstraints& outputEngineConstraints,
|
||||
const SmoCallbacks& callbacks,
|
||||
cl_mem_flags flags,
|
||||
uint32_t ambienceHighVal_)
|
||||
uint32_t ambienceHighVal_,
|
||||
size_t nStencils_, size_t nDgramsPerFrame_)
|
||||
: StimulusBuffer(
|
||||
parent, deviceAttachmentSpec, histbuffMs,
|
||||
inputEngineConstraints, outputEngineConstraints,
|
||||
callbacks, flags),
|
||||
ambienceHighVal(ambienceHighVal_)
|
||||
{}
|
||||
ambienceHighVal(ambienceHighVal_),
|
||||
nStencils(nStencils_)
|
||||
{
|
||||
// Construct stencils and add to list (FIFO behavior)
|
||||
for (size_t i = 0; i < nStencils; ++i) {
|
||||
stencils.emplace_back(nDgramsPerFrame_);
|
||||
}
|
||||
}
|
||||
|
||||
~PcloudAmbienceStimulusBuffer() = default;
|
||||
|
||||
@@ -45,6 +55,8 @@ public:
|
||||
|
||||
public:
|
||||
uint32_t ambienceHighVal;
|
||||
size_t nStencils;
|
||||
std::list<LG1PcloudAmbienceStencil> stencils;
|
||||
};
|
||||
|
||||
} // namespace stim_buff
|
||||
|
||||
Reference in New Issue
Block a user