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
@@ -60,7 +60,7 @@ void NodeParamViewConnectedLabel::UpdateConnected()
{
QString connection_str;
if (input_->IsConnected()) {
if (input_->is_connected()) {
connection_str = input_->get_connected_node()->Name();
} else {
connection_str = tr("Nothing");
@@ -194,7 +194,7 @@ NodeParamViewItemBody::NodeParamViewItemBody(const QVector<NodeInput *> &inputs,
}
}
if (input->IsConnectable()) {
if (input->is_connectable()) {
// Create clickable label used when an input is connected
ui_objects.connected_label = new NodeParamViewConnectedLabel(input);
connect(ui_objects.connected_label, &NodeParamViewConnectedLabel::ConnectionClicked, this, &NodeParamViewItemBody::ConnectionClicked);
@@ -222,7 +222,7 @@ NodeParamViewItemBody::NodeParamViewItemBody(const QVector<NodeInput *> &inputs,
input_ui_map_.insert(input, ui_objects);
// Update "connected" label
if (input->IsConnectable()) {
if (input->is_connectable()) {
UpdateUIForEdgeConnection(input);
}
@@ -310,11 +310,11 @@ void NodeParamViewItemBody::UpdateUIForEdgeConnection(NodeInput *input)
const InputUI& ui_objects = input_ui_map_[input];
foreach (QWidget* w, ui_objects.widget_bridge->widgets()) {
w->setVisible(!input->IsConnected());
w->setVisible(!input->is_connected());
}
// Show/hide connection label
ui_objects.connected_label->setVisible(input->IsConnected());
ui_objects.connected_label->setVisible(input->is_connected());
}
void NodeParamViewItemBody::InputKeyframeEnableChanged(bool e)
+1 -1
View File
@@ -399,7 +399,7 @@ void NodeView::mouseMoveEvent(QMouseEvent *event)
if (param->type() == NodeParam::kInput) {
NodeInput* input = static_cast<NodeInput*>(param);
if (input->IsConnectable()) {
if (input->is_connectable()) {
if (input->data_type() & new_drop_edge->edge()->input()->data_type()) {
drop_input_ = input;
break;
+1 -1
View File
@@ -177,7 +177,7 @@ void NodeViewItem::SetNode(Node *n)
if (p->type() == NodeParam::kInput) {
NodeInput* input = static_cast<NodeInput*>(p);
if (input->IsConnectable()) {
if (input->is_connectable()) {
node_inputs_.append(input);
}
}
+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();