From 278a4c317c0b87add67cc9ebc904afe1db23a031 Mon Sep 17 00:00:00 2001 From: gdk Date: Thu, 31 Oct 2019 00:29:22 -0300 Subject: Implement BFI, BRK, FLO, FSWZADD, PBK, SHFL and TXD shader instructions, misc. fixes --- .../IntermediateRepresentation/Instruction.cs | 10 ++++++++++ .../IntermediateRepresentation/Operation.cs | 7 ++++++- .../IntermediateRepresentation/TextureFlags.cs | 17 +++++++++-------- 3 files changed, 25 insertions(+), 9 deletions(-) (limited to 'Ryujinx.Graphics.Shader/IntermediateRepresentation') diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs index 88918f3f..46c6b57f 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs @@ -7,6 +7,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation { Absolute = 1, Add, + BitCount, BitfieldExtractS32, BitfieldExtractU32, BitfieldInsert, @@ -38,11 +39,15 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation ConvertU32ToFP, Copy, Cosine, + Ddx, + Ddy, Discard, Divide, EmitVertex, EndPrimitive, ExponentB2, + FindFirstSetS32, + FindFirstSetU32, Floor, FusedMultiplyAdd, ImageLoad, @@ -75,12 +80,17 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation ShiftLeft, ShiftRightS32, ShiftRightU32, + Shuffle, + ShuffleDown, + ShuffleUp, + ShuffleXor, Sine, SquareRoot, StoreGlobal, StoreLocal, StoreStorage, Subtract, + SwizzleAdd, TextureSample, TextureSize, Truncate, diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs index fc01d47e..0d7379a8 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs @@ -80,7 +80,12 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation public void TurnIntoCopy(Operand source) { - Inst = Instruction.Copy; + TurnInto(Instruction.Copy, source); + } + + public void TurnInto(Instruction newInst, Operand source) + { + Inst = newInst; foreach (Operand oldSrc in _sources) { diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureFlags.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureFlags.cs index 5f0a8427..5334afac 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureFlags.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureFlags.cs @@ -5,13 +5,14 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation [Flags] enum TextureFlags { - None = 0, - Bindless = 1 << 0, - Gather = 1 << 1, - IntCoords = 1 << 2, - LodBias = 1 << 3, - LodLevel = 1 << 4, - Offset = 1 << 5, - Offsets = 1 << 6 + None = 0, + Bindless = 1 << 0, + Gather = 1 << 1, + Derivatives = 1 << 2, + IntCoords = 1 << 3, + LodBias = 1 << 4, + LodLevel = 1 << 5, + Offset = 1 << 6, + Offsets = 1 << 7 } } \ No newline at end of file -- cgit v1.2.3