aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs')
-rw-r--r--Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs22
1 files changed, 22 insertions, 0 deletions
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)