Skip to content
Snippets Groups Projects
Commit aa2050bf authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow application to a frameset

parent 8f475675
No related branches found
No related tags found
1 merge request!158Implements #228 adaptive MLS and smoothing channel
This commit is part of merge request !158. Comments created here will be created in the context of that merge request.
......@@ -282,11 +282,13 @@ static void run(ftl::Configurable *root) {
UNIQUE_LOCK(scene_A.mtx, lk);
// Apply pre-filters to all frames
for (int i=0; i<scene_A.frames.size(); ++i) {
/*for (int i=0; i<scene_A.frames.size(); ++i) {
auto &f = scene_A.frames[i];
auto s = scene_A.sources[i];
prefilter->apply(f, f, s, 0);
}
}*/
prefilter->apply(scene_A, scene_A, 0);
// Send all frames to GPU, block until done?
//scene_A.upload(Channel::Colour + Channel::Depth); // TODO: (Nick) Add scene stream.
......
......@@ -38,6 +38,29 @@ Graph::~Graph() {
}
bool Graph::apply(FrameSet &in, FrameSet &out, cudaStream_t stream) {
if (!value("enabled", true)) return false;
if (in.frames.size() != out.frames.size()) return false;
for (auto &i : operators_) {
// Make sure there are enough instances
while (i.instances.size() < in.frames.size()) {
i.instances.push_back(i.maker->make());
}
for (int j=0; j<in.frames.size(); ++j) {
auto *instance = i.instances[j];
if (instance->enabled()) {
instance->apply(in.frames[j], out.frames[j], in.sources[j], stream);
}
}
}
return true;
}
bool Graph::apply(Frame &in, Frame &out, Source *s, cudaStream_t stream) {
if (!value("enabled", true)) return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment