From 1876b346fea647e8284a66bb6d62c38801035cff Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 13 Oct 2019 03:02:07 -0300 Subject: Initial work --- .../Shader/IntermediateRepresentation/Operand.cs | 79 ---------------------- 1 file changed, 79 deletions(-) delete mode 100644 Ryujinx.Graphics/Shader/IntermediateRepresentation/Operand.cs (limited to 'Ryujinx.Graphics/Shader/IntermediateRepresentation/Operand.cs') diff --git a/Ryujinx.Graphics/Shader/IntermediateRepresentation/Operand.cs b/Ryujinx.Graphics/Shader/IntermediateRepresentation/Operand.cs deleted file mode 100644 index 1df88a3d..00000000 --- a/Ryujinx.Graphics/Shader/IntermediateRepresentation/Operand.cs +++ /dev/null @@ -1,79 +0,0 @@ -using Ryujinx.Graphics.Shader.Decoders; -using System; -using System.Collections.Generic; - -namespace Ryujinx.Graphics.Shader.IntermediateRepresentation -{ - class Operand - { - private const int CbufSlotBits = 5; - private const int CbufSlotLsb = 32 - CbufSlotBits; - private const int CbufSlotMask = (1 << CbufSlotBits) - 1; - - public OperandType Type { get; } - - public int Value { get; } - - public INode AsgOp { get; set; } - - public HashSet UseOps { get; } - - private Operand() - { - UseOps = new HashSet(); - } - - public Operand(OperandType type) : this() - { - Type = type; - } - - public Operand(OperandType type, int value) : this() - { - Type = type; - Value = value; - } - - public Operand(Register reg) : this() - { - Type = OperandType.Register; - Value = PackRegInfo(reg.Index, reg.Type); - } - - public Operand(int slot, int offset) : this() - { - Type = OperandType.ConstantBuffer; - Value = PackCbufInfo(slot, offset); - } - - private static int PackCbufInfo(int slot, int offset) - { - return (slot << CbufSlotLsb) | offset; - } - - private static int PackRegInfo(int index, RegisterType type) - { - return ((int)type << 24) | index; - } - - public int GetCbufSlot() - { - return (Value >> CbufSlotLsb) & CbufSlotMask; - } - - public int GetCbufOffset() - { - return Value & ~(CbufSlotMask << CbufSlotLsb); - } - - public Register GetRegister() - { - return new Register(Value & 0xffffff, (RegisterType)(Value >> 24)); - } - - public float AsFloat() - { - return BitConverter.Int32BitsToSingle(Value); - } - } -} \ No newline at end of file -- cgit v1.2.3