1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-14 17:36:42 +00:00
Ryujinx/Ryujinx.Graphics.Shader/StructuredIr/OperandInfo.cs
gdkchan 99445dd0a6
Add support for fragment shader interlock (#2768)
* Support coherent images

* Add support for fragment shader interlock

* Change to tree based match approach

* Refactor + check for branch targets and external registers

* Make detection more robust

* Use Intel fragment shader ordering if interlock is not available, use nothing if both are not available

* Remove unused field
2021-10-28 19:53:12 -03:00

34 lines
No EOL
1 KiB
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)
{
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}\".")
};
}
}
}