ShaderNode: Fix compilation
This commit is contained in:
@@ -33,7 +33,7 @@ class BinOp : public ShaderNode
|
||||
QString validationMessage() const override;
|
||||
|
||||
private:
|
||||
virtual void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) = 0;
|
||||
virtual void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) = 0;
|
||||
|
||||
bool ComputePreview(QPixmap& pixmap) override;
|
||||
void UpdateOutput();
|
||||
@@ -50,7 +50,7 @@ class BinAdd : public BinOp<DataType, nzsl::Ast::BinaryType::Add>
|
||||
public:
|
||||
using BinOp<DataType, nzsl::Ast::BinaryType::Add>::BinOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ class BinMul : public BinOp<DataType, nzsl::Ast::BinaryType::Multiply>
|
||||
public:
|
||||
using BinOp<DataType, nzsl::Ast::BinaryType::Multiply>::BinOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ class BinSub : public BinOp<DataType, nzsl::Ast::BinaryType::Subtract>
|
||||
public:
|
||||
using BinOp<DataType, nzsl::Ast::BinaryType::Subtract>::BinOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -80,7 +80,7 @@ class BinDiv : public BinOp<DataType, nzsl::Ast::BinaryType::Divide>
|
||||
public:
|
||||
using BinOp<DataType, nzsl::Ast::BinaryType::Divide>::BinOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void BinOp<DataType, Op>::UpdateOutput()
|
||||
m_output = std::make_shared<DataType>();
|
||||
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ void BinOp<DataType, Op>::UpdateOutput()
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void BinAdd<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void BinAdd<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
output[i] = left[i] + right[i];
|
||||
@@ -199,7 +199,7 @@ QString BinAdd<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void BinMul<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void BinMul<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
output[i] = left[i] * right[i];
|
||||
@@ -212,7 +212,7 @@ QString BinMul<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void BinSub<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void BinSub<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
output[i] = left[i] - right[i];
|
||||
@@ -225,7 +225,7 @@ QString BinSub<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void BinDiv<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void BinDiv<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
output[i] = left[i] / right[i];
|
||||
|
||||
@@ -53,7 +53,7 @@ std::shared_ptr<QtNodes::NodeData> BoolValue::outData(QtNodes::PortIndex port)
|
||||
float c = (m_value) ? 1.f : 0.f;
|
||||
|
||||
auto out = std::make_shared<BoolData>();
|
||||
out->preview(0, 0) = nzsl::Vector4f(c, c, c, 1.f);
|
||||
out->preview(0, 0) = nzsl::Vector4f32(c, c, c, 1.f);
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ nzsl::Ast::NodePtr BoolValue::BuildNode(nzsl::Ast::ExpressionPtr* /*expressions*
|
||||
assert(count == 0);
|
||||
assert(outputIndex == 0);
|
||||
|
||||
return nzsl::ShaderBuilder::Constant(m_value);
|
||||
return nzsl::ShaderBuilder::ConstantValue(m_value);
|
||||
}
|
||||
|
||||
bool BoolValue::ComputePreview(QPixmap& pixmap)
|
||||
|
||||
@@ -33,7 +33,7 @@ nzsl::Ast::NodePtr CastVec<ToComponentCount>::BuildNode(nzsl::Ast::ExpressionPtr
|
||||
std::vector<nzsl::Ast::ExpressionPtr> params;
|
||||
params.emplace_back(std::move(expressions[0]));
|
||||
for (std::size_t i = 0; i < overflowComponentCount; ++i)
|
||||
params.emplace_back(nzsl::ShaderBuilder::Constant(m_overflowComponents[i]));
|
||||
params.emplace_back(nzsl::ShaderBuilder::ConstantValue(m_overflowComponents[i]));
|
||||
|
||||
return nzsl::ShaderBuilder::Cast(nzsl::Ast::ExpressionType{ nzsl::Ast::VectorType{ ToComponentCount, nzsl::Ast::PrimitiveType::Float32 } }, std::move(params));
|
||||
}
|
||||
@@ -187,7 +187,7 @@ void CastVec<ToComponentCount>::UpdateOutput()
|
||||
if (!m_input)
|
||||
{
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview(0, 0) = nzsl::Vector4f(0.f, 0.f, 0.f, 0.f);
|
||||
m_output->preview(0, 0) = nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ void CastVec<ToComponentCount>::UpdateOutput()
|
||||
{
|
||||
for (std::size_t x = 0; x < inputWidth; ++x)
|
||||
{
|
||||
nzsl::Vector4f color = input(x, y);
|
||||
nzsl::Vector4f32 color = input(x, y);
|
||||
|
||||
float* colorPtr = &color[0];
|
||||
for (std::size_t i = 0; i < overflowComponentCount; ++i)
|
||||
|
||||
@@ -34,7 +34,7 @@ class CompOp : public ShaderNode
|
||||
QString validationMessage() const override;
|
||||
|
||||
private:
|
||||
virtual void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) = 0;
|
||||
virtual void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) = 0;
|
||||
|
||||
bool ComputePreview(QPixmap& pixmap) override;
|
||||
void UpdateOutput();
|
||||
@@ -51,7 +51,7 @@ class CompEq : public CompOp<DataType, nzsl::Ast::BinaryType::CompEq>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompEq>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ class CompGe : public CompOp<DataType, nzsl::Ast::BinaryType::CompGe>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompGe>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ class CompGt : public CompOp<DataType, nzsl::Ast::BinaryType::CompGt>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompGt>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ class CompLe : public CompOp<DataType, nzsl::Ast::BinaryType::CompLe>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompLe>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -91,7 +91,7 @@ class CompLt : public CompOp<DataType, nzsl::Ast::BinaryType::CompLt>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompLt>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ class CompNe : public CompOp<DataType, nzsl::Ast::BinaryType::CompNe>
|
||||
public:
|
||||
using CompOp<DataType, nzsl::Ast::BinaryType::CompNe>::CompOp;
|
||||
|
||||
void ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount) override;
|
||||
void ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount) override;
|
||||
QString GetOperationString() const final;
|
||||
};
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ void CompOp<DataType, Op>::UpdateOutput()
|
||||
{
|
||||
m_output = std::make_shared<BoolData>();
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,12 +195,12 @@ void CompOp<DataType, Op>::UpdateOutput()
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompEq<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompEq<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i] == right[i]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,12 +211,12 @@ QString CompEq<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompGe<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompGe<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i][0] >= right[i][0]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,12 +227,12 @@ QString CompGe<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompGt<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompGt<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i][0] > right[i][0]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,12 +243,12 @@ QString CompGt<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompLe<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompLe<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i][0] <= right[i][0]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,12 +259,12 @@ QString CompLe<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompLt<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompLt<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i][0] < right[i][0]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,12 +275,12 @@ QString CompLt<DataType>::GetOperationString() const
|
||||
}
|
||||
|
||||
template<typename DataType>
|
||||
void CompNe<DataType>::ApplyOp(const nzsl::Vector4f* left, const nzsl::Vector4f* right, nzsl::Vector4f* output, std::size_t pixelCount)
|
||||
void CompNe<DataType>::ApplyOp(const nzsl::Vector4f32* left, const nzsl::Vector4f32* right, nzsl::Vector4f32* output, std::size_t pixelCount)
|
||||
{
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
{
|
||||
float r = (left[i] != right[i]) ? 1.f : 0.f;
|
||||
output[i] = nzsl::Vector4f(r, r, r, r);
|
||||
output[i] = nzsl::Vector4f32(r, r, r, r);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ nzsl::Ast::NodePtr Discard::BuildNode(nzsl::Ast::ExpressionPtr* expressions, std
|
||||
|
||||
using namespace nzsl;
|
||||
|
||||
auto condition = ShaderBuilder::Binary(nzsl::Ast::BinaryType::CompEq, std::move(expressions[0]), ShaderBuilder::Constant(true));
|
||||
auto condition = ShaderBuilder::Binary(nzsl::Ast::BinaryType::CompEq, std::move(expressions[0]), ShaderBuilder::ConstantValue(true));
|
||||
return ShaderBuilder::Branch(std::move(condition), ShaderBuilder::Discard());
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ std::shared_ptr<QtNodes::NodeData> FloatValue::outData(QtNodes::PortIndex port)
|
||||
assert(port == 0);
|
||||
|
||||
auto out = std::make_shared<FloatData>();
|
||||
out->preview(0, 0) = nzsl::Vector4f(m_value, m_value, m_value, 1.f);
|
||||
out->preview(0, 0) = nzsl::Vector4f32(m_value, m_value, m_value, 1.f);
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ nzsl::Ast::NodePtr FloatValue::BuildNode(nzsl::Ast::ExpressionPtr* expressions,
|
||||
assert(count == 0);
|
||||
assert(outputIndex == 0);
|
||||
|
||||
return nzsl::ShaderBuilder::Constant(m_value);
|
||||
return nzsl::ShaderBuilder::ConstantValue(m_value);
|
||||
}
|
||||
|
||||
bool FloatValue::ComputePreview(QPixmap& pixmap)
|
||||
|
||||
@@ -148,13 +148,13 @@ void Mat4VecMul::UpdateOutput()
|
||||
{
|
||||
m_output = std::make_shared<VecData>(4);
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
m_output = std::make_shared<VecData>(4);
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
|
||||
/*m_output = std::make_shared<VecData>(m_rhs->componentCount);
|
||||
|
||||
@@ -174,9 +174,9 @@ void Mat4VecMul::UpdateOutput()
|
||||
|
||||
m_output->preview = PreviewValues(maxWidth, maxHeight);
|
||||
|
||||
const nzsl::Vector4f* left = leftResized.GetData();
|
||||
const nzsl::Vector4f* right = rightPreview.GetData();
|
||||
nzsl::Vector4f* output = m_output->preview.GetData();
|
||||
const nzsl::Vector4f32* left = leftResized.GetData();
|
||||
const nzsl::Vector4f32* right = rightPreview.GetData();
|
||||
nzsl::Vector4f32* output = m_output->preview.GetData();
|
||||
|
||||
std::size_t pixelCount = maxWidth * maxHeight;
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
|
||||
@@ -28,7 +28,7 @@ void SampleTexture::UpdateOutput()
|
||||
if (!m_texture || !m_uv)
|
||||
{
|
||||
output = PreviewValues(1, 1);
|
||||
output.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
output.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,12 +48,12 @@ void SampleTexture::UpdateOutput()
|
||||
{
|
||||
for (std::size_t x = 0; x < uvWidth; ++x)
|
||||
{
|
||||
nzsl::Vector4f uvValue = uv(x, y);
|
||||
nzsl::Vector4f32 uvValue = uv(x, y);
|
||||
|
||||
if (textureWidth > 0 && textureHeight > 0)
|
||||
output(x, y) = texturePreview.Sample(uvValue.x(), uvValue.y());
|
||||
else
|
||||
output(x, y) = nzsl::Vector4f(0.f, 0.f, 0.f, 1.f);
|
||||
output(x, y) = nzsl::Vector4f32(0.f, 0.f, 0.f, 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ std::shared_ptr<QtNodes::NodeData> TextureValue::outData(QtNodes::PortIndex port
|
||||
{
|
||||
QColor pixelColor = previewImage.pixelColor(int(x), int(y));
|
||||
|
||||
textureData->preview(x, y) = nzsl::Vector4f(pixelColor.redF(), pixelColor.greenF(), pixelColor.blueF(), pixelColor.alphaF());
|
||||
textureData->preview(x, y) = nzsl::Vector4f32(pixelColor.redF(), pixelColor.greenF(), pixelColor.blueF(), pixelColor.alphaF());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ void VecComposition<ComponentCount>::UpdateOutput()
|
||||
if (validationState() != QtNodes::NodeValidationState::Valid)
|
||||
{
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview(0, 0) = nzsl::Vector4f(0.f, 0.f, 0.f, 0.f);
|
||||
m_output->preview(0, 0) = nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ void VecComposition<ComponentCount>::UpdateOutput()
|
||||
{
|
||||
for (std::size_t x = 0; x < maxInputWidth; ++x)
|
||||
{
|
||||
nzsl::Vector4f color(0.f, 0.f, 0.f, 1.f);
|
||||
nzsl::Vector4f32 color(0.f, 0.f, 0.f, 1.f);
|
||||
for (std::size_t i = 0; i < ComponentCount; ++i)
|
||||
color[i] = previewResized[i](x, y)[0];
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ void VecDecomposition::UpdateOutputs()
|
||||
{
|
||||
auto dummy = std::make_shared<FloatData>();
|
||||
dummy->preview = PreviewValues(1, 1);
|
||||
dummy->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
dummy->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
|
||||
m_outputs.fill(dummy);
|
||||
return;
|
||||
@@ -154,13 +154,13 @@ void VecDecomposition::UpdateOutputs()
|
||||
m_outputs[i] = std::make_shared<FloatData>();
|
||||
m_outputs[i]->preview = PreviewValues(previewWidth, previewHeight);
|
||||
|
||||
const nzsl::Vector4f* inputData = m_input->preview.GetData();
|
||||
nzsl::Vector4f* outputData = m_outputs[i]->preview.GetData();
|
||||
const nzsl::Vector4f32* inputData = m_input->preview.GetData();
|
||||
nzsl::Vector4f32* outputData = m_outputs[i]->preview.GetData();
|
||||
for (std::size_t j = 0; j < pixelCount; ++j)
|
||||
{
|
||||
const nzsl::Vector4f& input = *inputData++;
|
||||
const nzsl::Vector4f32& input = *inputData++;
|
||||
|
||||
*outputData++ = nzsl::Vector4f(input[i], input[i], input[i], input[i]);
|
||||
*outputData++ = nzsl::Vector4f32(input[i], input[i], input[i], input[i]);
|
||||
}
|
||||
|
||||
Q_EMIT dataUpdated(i);
|
||||
|
||||
@@ -126,7 +126,7 @@ void VecDot::UpdateOutput()
|
||||
if (validationState() != QtNodes::NodeValidationState::Valid)
|
||||
{
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ void VecDot::UpdateOutput()
|
||||
|
||||
m_output->preview = PreviewValues(maxWidth, maxHeight);
|
||||
|
||||
const nzsl::Vector4f* left = leftResized.GetData();
|
||||
const nzsl::Vector4f* right = rightPreview.GetData();
|
||||
nzsl::Vector4f* output = m_output->preview.GetData();
|
||||
const nzsl::Vector4f32* left = leftResized.GetData();
|
||||
const nzsl::Vector4f32* right = rightPreview.GetData();
|
||||
nzsl::Vector4f32* output = m_output->preview.GetData();
|
||||
|
||||
std::size_t pixelCount = maxWidth * maxHeight;
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
|
||||
@@ -142,7 +142,7 @@ void VecFloatMul::UpdateOutput()
|
||||
{
|
||||
m_output = std::make_shared<VecData>(4);
|
||||
m_output->preview = PreviewValues(1, 1);
|
||||
m_output->preview.Fill(nzsl::Vector4f(0.f, 0.f, 0.f, 0.f));
|
||||
m_output->preview.Fill(nzsl::Vector4f32(0.f, 0.f, 0.f, 0.f));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,9 +164,9 @@ void VecFloatMul::UpdateOutput()
|
||||
|
||||
m_output->preview = PreviewValues(maxWidth, maxHeight);
|
||||
|
||||
const nzsl::Vector4f* left = leftResized.GetData();
|
||||
const nzsl::Vector4f* right = rightPreview.GetData();
|
||||
nzsl::Vector4f* output = m_output->preview.GetData();
|
||||
const nzsl::Vector4f32* left = leftResized.GetData();
|
||||
const nzsl::Vector4f32* right = rightPreview.GetData();
|
||||
nzsl::Vector4f32* output = m_output->preview.GetData();
|
||||
|
||||
std::size_t pixelCount = maxWidth * maxHeight;
|
||||
for (std::size_t i = 0; i < pixelCount; ++i)
|
||||
|
||||
@@ -66,7 +66,7 @@ std::shared_ptr<QtNodes::NodeData> VecValue<ComponentCount>::outData(QtNodes::Po
|
||||
values[i] = m_value[i];
|
||||
|
||||
out->preview = PreviewValues(1, 1);
|
||||
out->preview(0, 0) = nzsl::Vector4f(values[0], values[1], values[2], values[3]);
|
||||
out->preview(0, 0) = nzsl::Vector4f32(values[0], values[1], values[2], values[3]);
|
||||
|
||||
return out;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ nzsl::Ast::NodePtr VecValue<ComponentCount>::BuildNode(nzsl::Ast::ExpressionPtr*
|
||||
assert(count == 0);
|
||||
assert(outputIndex == 0);
|
||||
|
||||
return nzsl::ShaderBuilder::Constant(m_value);
|
||||
return nzsl::ShaderBuilder::ConstantValue(m_value);
|
||||
}
|
||||
|
||||
template<std::size_t ComponentCount>
|
||||
|
||||
Reference in New Issue
Block a user