accleratedjob: simplified function calls

This commit is contained in:
itsmattkc
2022-05-09 15:16:46 -07:00
parent 6c7dbc8521
commit b88e15b8cf
33 changed files with 149 additions and 149 deletions
+4 -4
View File
@@ -30,22 +30,22 @@ class AcceleratedJob {
public:
AcceleratedJob() = default;
NodeValue GetValue(const QString& input) const
NodeValue Get(const QString& input) const
{
return value_map_.value(input);
}
void InsertValue(const QString &input, const NodeValueRow &row)
void Insert(const QString &input, const NodeValueRow &row)
{
value_map_.insert(input, row.value(input));
}
void InsertValue(const QString& input, const NodeValue& value)
void Insert(const QString& input, const NodeValue& value)
{
value_map_.insert(input, value);
}
void InsertValue(const NodeValueRow &row)
void Insert(const NodeValueRow &row)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
value_map_.insert(row);
+1 -1
View File
@@ -552,7 +552,7 @@ void OpenGLRenderer::Blit(QVariant s, ShaderJob job, Texture *destination, Video
// Ensure matrix is set, at least to identity
GLint mvpmat_location = functions_->glGetUniformLocation(shader, "ove_mvpmat");
if (mvpmat_location > -1) {
functions_->glUniformMatrix4fv(mvpmat_location, 1, false, job.GetValue(QStringLiteral("ove_mvpmat")).toMatrix().constData());
functions_->glUniformMatrix4fv(mvpmat_location, 1, false, job.Get(QStringLiteral("ove_mvpmat")).toMatrix().constData());
}
// Set the viewport to the "physical" resolution of the destination
+10 -10
View File
@@ -61,9 +61,9 @@ TexturePtr Renderer::InterlaceTexture(TexturePtr top, TexturePtr bottom, const V
color_cache_mutex_.unlock();
ShaderJob job;
job.InsertValue(QStringLiteral("top_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(top)));
job.InsertValue(QStringLiteral("bottom_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(bottom)));
job.InsertValue(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(params.effective_width(), params.effective_height())));
job.Insert(QStringLiteral("top_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(top)));
job.Insert(QStringLiteral("bottom_tex_in"), NodeValue(NodeValue::kTexture, QVariant::fromValue(bottom)));
job.Insert(QStringLiteral("resolution_in"), NodeValue(NodeValue::kVec2, QVector2D(params.effective_width(), params.effective_height())));
TexturePtr output = CreateTexture(params);
@@ -213,19 +213,19 @@ void Renderer::BlitColorManaged(const ColorTransformJob &color_job, Texture *des
}
ShaderJob job;
job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(color_job.GetInputTexture())));
job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix()));
job.InsertValue(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted()));
job.InsertValue(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation())));
job.InsertValue(color_job.GetValues());
job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(color_job.GetInputTexture())));
job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, color_job.GetTransformMatrix()));
job.Insert(QStringLiteral("ove_cropmatrix"), NodeValue(NodeValue::kMatrix, color_job.GetCropMatrix().inverted()));
job.Insert(QStringLiteral("ove_maintex_alpha"), NodeValue(NodeValue::kInt, int(color_job.GetInputAlphaAssociation())));
job.Insert(color_job.GetValues());
job.SetAlphaChannelRequired(color_job.GetAlphaChannelRequired());
foreach (const ColorContext::LUT& l, color_ctx.lut3d_textures) {
job.InsertValue(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture)));
job.Insert(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture)));
job.SetInterpolation(l.name, l.interpolation);
}
foreach (const ColorContext::LUT& l, color_ctx.lut1d_textures) {
job.InsertValue(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture)));
job.Insert(l.name, NodeValue(NodeValue::kTexture, QVariant::fromValue(l.texture)));
job.SetInterpolation(l.name, l.interpolation);
}
+2 -2
View File
@@ -114,8 +114,8 @@ FramePtr RenderProcessor::GenerateFrame(TexturePtr texture, const rational& time
} else {
// No color transform, just blit
ShaderJob job;
job.InsertValue(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture)));
job.InsertValue(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, matrix));
job.Insert(QStringLiteral("ove_maintex"), NodeValue(NodeValue::kTexture, QVariant::fromValue(texture)));
job.Insert(QStringLiteral("ove_mvpmat"), NodeValue(NodeValue::kMatrix, matrix));
render_ctx_->BlitToTexture(default_shader_, job, blit_tex.get());
}