Initial work
This commit is contained in:
parent
f617fb542a
commit
1876b346fe
518 changed files with 15170 additions and 12486 deletions
|
@ -0,0 +1,62 @@
|
|||
using Ryujinx.Graphics.Shader.Decoders;
|
||||
using System;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
|
||||
{
|
||||
static class OperandHelper
|
||||
{
|
||||
public static Operand Attribute(int value, InterpolationQualifier iq = InterpolationQualifier.None)
|
||||
{
|
||||
return new Operand(OperandType.Attribute, value, iq);
|
||||
}
|
||||
|
||||
public static Operand Cbuf(int slot, int offset)
|
||||
{
|
||||
return new Operand(slot, offset);
|
||||
}
|
||||
|
||||
public static Operand Const(int value)
|
||||
{
|
||||
return new Operand(OperandType.Constant, value);
|
||||
}
|
||||
|
||||
public static Operand ConstF(float value)
|
||||
{
|
||||
return new Operand(OperandType.Constant, BitConverter.SingleToInt32Bits(value));
|
||||
}
|
||||
|
||||
public static Operand Label()
|
||||
{
|
||||
return new Operand(OperandType.Label);
|
||||
}
|
||||
|
||||
public static Operand Local()
|
||||
{
|
||||
return new Operand(OperandType.LocalVariable);
|
||||
}
|
||||
|
||||
public static Operand Register(int index, RegisterType type)
|
||||
{
|
||||
return Register(new Register(index, type));
|
||||
}
|
||||
|
||||
public static Operand Register(Register reg)
|
||||
{
|
||||
if (reg.IsRZ)
|
||||
{
|
||||
return Const(0);
|
||||
}
|
||||
else if (reg.IsPT)
|
||||
{
|
||||
return Const(IrConsts.True);
|
||||
}
|
||||
|
||||
return new Operand(reg);
|
||||
}
|
||||
|
||||
public static Operand Undef()
|
||||
{
|
||||
return new Operand(OperandType.Undefined);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue