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 --- .../StructuredIr/StructuredProgram.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs') diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs index 53ca6700..c4ffbe1a 100644 --- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs +++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs @@ -179,6 +179,28 @@ namespace Ryujinx.Graphics.Shader.StructuredIr context.AddNode(new AstOperation(inst, sources)); } + + // Those instructions needs to be emulated by using helper functions, + // because they are NVIDIA specific. Those flags helps the backend to + // decide which helper functions are needed on the final generated code. + switch (operation.Inst) + { + case Instruction.Shuffle: + context.Info.HelperFunctionsMask |= HelperFunctionsMask.Shuffle; + break; + case Instruction.ShuffleDown: + context.Info.HelperFunctionsMask |= HelperFunctionsMask.ShuffleDown; + break; + case Instruction.ShuffleUp: + context.Info.HelperFunctionsMask |= HelperFunctionsMask.ShuffleUp; + break; + case Instruction.ShuffleXor: + context.Info.HelperFunctionsMask |= HelperFunctionsMask.ShuffleXor; + break; + case Instruction.SwizzleAdd: + context.Info.HelperFunctionsMask |= HelperFunctionsMask.SwizzleAdd; + break; + } } private static VariableType GetVarTypeFromUses(Operand dest) -- cgit v1.2.3