renderer: moved all shader code into one solidified function

Makes texture-based optimizations easier when they're all in one place.
This commit is contained in:
itsmattkc
2020-06-10 01:54:02 +10:00
parent 29537fea3c
commit 71ec148e76
35 changed files with 274 additions and 191 deletions
+16 -8
View File
@@ -22,17 +22,25 @@
OLIVE_NAMESPACE_ENTER
void GizmoTraverser::FootageProcessingEvent(StreamPtr stream, const TimeRange &/*input_time*/, NodeValueTable *table)
void GizmoTraverser::ProcessNodeEvent(const Node *node, const TimeRange &range, NodeValueDatabase &input_params_in, NodeValueTable &output_params)
{
if (stream->type() == Stream::kVideo || stream->type() == Stream::kAudio) {
// Convert footage to image/sample buffers
QList<NodeInput*> inputs = node->GetInputsIncludingArrays();
foreach (NodeInput* input, inputs) {
if (input->data_type() == NodeParam::kFootage) {
StreamPtr stream = ResolveStreamFromInput(input);
ImageStreamPtr image_stream = std::static_pointer_cast<ImageStream>(stream);
if (stream
&& (stream->type() == Stream::kVideo || stream->type() == Stream::kImage)) {
ImageStreamPtr image_stream = std::static_pointer_cast<ImageStream>(stream);
table->Push(NodeParam::kTexture, QSize(image_stream->width(),
image_stream->height()));
} else if (stream->type() == Stream::kAudio) {
// FIXME: Get samples
output_params.Push(NodeParam::kTexture,
QSize(image_stream->width(), image_stream->height()),
node);
} else if (stream->type() == Stream::kAudio) {
// FIXME: Do something...
}
}
}
}