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...
}
}
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ public:
GizmoTraverser() = default;
protected:
virtual void FootageProcessingEvent(StreamPtr stream, const TimeRange &input_time, NodeValueTable* table) override;
virtual void ProcessNodeEvent(const Node *node, const TimeRange &range, NodeValueDatabase &input_params_in, NodeValueTable &output_params) override;
};
+2 -2
View File
@@ -704,8 +704,8 @@ void ViewerWidget::UpdateStack()
rational new_tb;
if (GetConnectedNode()
&& !GetConnectedNode()->texture_input()->IsConnected()
&& GetConnectedNode()->samples_input()->IsConnected()) {
&& !GetConnectedNode()->texture_input()->is_connected()
&& GetConnectedNode()->samples_input()->is_connected()) {
// If we have a node AND video is disconnected AND audio is connected, show waveform view
stack_->setCurrentWidget(waveform_view_);
new_tb = GetConnectedNode()->audio_params().time_base();