Archived
1
0
Fork 0
forked from Mirror/Ryujinx
This repository has been archived on 2024-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
jinx/Ryujinx.Graphics.Shader/StructuredIr/OperandInfo.cs
2020-01-09 02:13:00 +01:00

33 lines
No EOL
985 B
C#

using Ryujinx.Graphics.Shader.IntermediateRepresentation;
using System;
namespace Ryujinx.Graphics.Shader.StructuredIr
{
static class OperandInfo
{
public static VariableType GetVarType(AstOperand operand)
{
if (operand.Type == OperandType.LocalVariable)
{
return operand.VarType;
}
else
{
return GetVarType(operand.Type);
}
}
public static VariableType GetVarType(OperandType type)
{
switch (type)
{
case OperandType.Attribute: return VariableType.F32;
case OperandType.Constant: return VariableType.S32;
case OperandType.ConstantBuffer: return VariableType.F32;
case OperandType.Undefined: return VariableType.S32;
}
throw new ArgumentException($"Invalid operand type \"{type}\".");
}
}
}