mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 03:39:57 -04:00
Import the base tree (MIT, see LICENSE)
This commit is contained in:
32
tools/vendor/ryujinx/src/Ryujinx.Graphics.Shader/StructuredIr/OperandInfo.cs
vendored
Normal file
32
tools/vendor/ryujinx/src/Ryujinx.Graphics.Shader/StructuredIr/OperandInfo.cs
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
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.Undefined => AggregateType.S32,
|
||||
_ => throw new ArgumentException($"Invalid operand type \"{type}\"."),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user