blob: 34428815ec40f8c6d405dbb4b5601dc09da7860d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
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)
{
return type switch
{
OperandType.Argument => VariableType.S32,
OperandType.Attribute => VariableType.F32,
OperandType.AttributePerPatch => VariableType.F32,
OperandType.Constant => VariableType.S32,
OperandType.ConstantBuffer => VariableType.F32,
OperandType.Undefined => VariableType.S32,
_ => throw new ArgumentException($"Invalid operand type \"{type}\".")
};
}
}
}
|