blob: 38ed1584b6e8924139c32a90655fcd7b39337874 (
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
|
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
using Ryujinx.Graphics.Shader.Translation;
using System;
namespace Ryujinx.Graphics.Shader.StructuredIr
{
static class OperandInfo
{
public static AggregateType GetVarType(AstOperand operand)
{
if (operand.Type == OperandType.LocalVariable)
{
return operand.VarType;
}
else
{
return GetVarType(operand.Type);
}
}
public static AggregateType GetVarType(OperandType type)
{
return type switch
{
OperandType.Argument => AggregateType.S32,
OperandType.Constant => AggregateType.S32,
OperandType.ConstantBuffer => AggregateType.FP32,
OperandType.Undefined => AggregateType.S32,
_ => throw new ArgumentException($"Invalid operand type \"{type}\".")
};
}
}
}
|