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
@@ -341,8 +341,8 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt
QString::number(val_a.type()),
QString::number(val_b.type())));
job.InsertValue(param_a_in, val_a);
job.InsertValue(param_b_in, val_b);
job.Insert(param_a_in, val_a);
job.Insert(param_b_in, val_b);
bool operation_is_noop = false;
@@ -370,7 +370,7 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt
operation_is_noop = true;
} else {
// Replace with adjusted matrix
job.InsertValue(val_a.type() == NodeValue::kTexture ? param_b_in : param_a_in,
job.Insert(val_a.type() == NodeValue::kTexture ? param_b_in : param_a_in,
NodeValue(NodeValue::kMatrix, adjusted_matrix, this));
// It's likely an alpha channel will result from this operation
@@ -414,7 +414,7 @@ void MathNodeBase::ValueInternal(Operation operation, Pairing pairing, const QSt
output->Push(NodeValue::kSamples, QVariant::fromValue(buffer), this);
} else {
SampleJob job(val_a.type() == NodeValue::kSamples ? val_a : val_b);
job.InsertValue(number_param, NodeValue(NodeValue::kFloat, number, this));
job.Insert(number_param, NodeValue(NodeValue::kFloat, number, this));
output->Push(NodeValue::kSamples, QVariant::fromValue(job), this);
}
}
+5 -5
View File
@@ -77,18 +77,18 @@ ShaderCode MergeNode::GetShaderCode(const ShaderRequest &request) const
void MergeNode::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
{
ShaderJob job;
job.InsertValue(value);
job.Insert(value);
TexturePtr base_tex = job.GetValue(kBaseIn).toTexture();
TexturePtr blend_tex = job.GetValue(kBlendIn).toTexture();
TexturePtr base_tex = job.Get(kBaseIn).toTexture();
TexturePtr blend_tex = job.Get(kBlendIn).toTexture();
if (base_tex || blend_tex) {
if (!base_tex || (blend_tex && blend_tex->channel_count() < VideoParams::kRGBAChannelCount)) {
// We only have a blend texture or the blend texture is RGB only, no need to alpha over
table->Push(job.GetValue(kBlendIn));
table->Push(job.Get(kBlendIn));
} else if (!blend_tex) {
// We only have a base texture, no need to alpha over
table->Push(job.GetValue(kBaseIn));
table->Push(job.Get(kBaseIn));
} else {
// We have both textures, push the job
if (base_tex->channel_count() < VideoParams::kRGBAChannelCount) {