Renderer/ShaderAst: Minor fixes relative to float/vec multiplication
This commit is contained in:
parent
90abb52e4e
commit
9b911ac4bc
|
|
@ -122,12 +122,16 @@ namespace Nz::ShaderAst
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case ShaderAst::BinaryType::Add:
|
case ShaderAst::BinaryType::Add:
|
||||||
case ShaderAst::BinaryType::Divide:
|
|
||||||
case ShaderAst::BinaryType::Multiply:
|
|
||||||
case ShaderAst::BinaryType::Substract:
|
case ShaderAst::BinaryType::Substract:
|
||||||
exprType = left->GetExpressionType();
|
exprType = left->GetExpressionType();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ShaderAst::BinaryType::Divide:
|
||||||
|
case ShaderAst::BinaryType::Multiply:
|
||||||
|
//FIXME
|
||||||
|
exprType = static_cast<ExpressionType>(std::max(UnderlyingCast(left->GetExpressionType()), UnderlyingCast(right->GetExpressionType())));
|
||||||
|
break;
|
||||||
|
|
||||||
case ShaderAst::BinaryType::Equality:
|
case ShaderAst::BinaryType::Equality:
|
||||||
exprType = ExpressionType::Boolean;
|
exprType = ExpressionType::Boolean;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,14 @@ namespace Nz::ShaderAst
|
||||||
{
|
{
|
||||||
switch (leftType)
|
switch (leftType)
|
||||||
{
|
{
|
||||||
|
case ExpressionType::Float1:
|
||||||
|
{
|
||||||
|
if (Node::GetComponentType(rightType) != ExpressionType::Float1)
|
||||||
|
throw AstError{ "Left expression type is not compatible with right expression type" };
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case ExpressionType::Float2:
|
case ExpressionType::Float2:
|
||||||
case ExpressionType::Float3:
|
case ExpressionType::Float3:
|
||||||
case ExpressionType::Float4:
|
case ExpressionType::Float4:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue