SPIR-V: Implement LogicalExclusiveOr

This commit is contained in:
gdk 2022-04-07 10:59:31 -03:00 committed by riperiperi
parent fbfaf63940
commit 1448136c3d
2 changed files with 8 additions and 0 deletions

View file

@ -96,6 +96,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
Add(Instruction.Lod, GenerateLod);
Add(Instruction.LogarithmB2, GenerateLogarithmB2);
Add(Instruction.LogicalAnd, GenerateLogicalAnd);
Add(Instruction.LogicalExclusiveOr, GenerateLogicalExclusiveOr);
Add(Instruction.LogicalNot, GenerateLogicalNot);
Add(Instruction.LogicalOr, GenerateLogicalOr);
Add(Instruction.LoopBreak, GenerateLoopBreak);
@ -994,6 +995,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
return GenerateBinaryBool(context, operation, context.Delegates.LogicalAnd);
}
private static OperationResult GenerateLogicalExclusiveOr(CodeGenContext context, AstOperation operation)
{
return GenerateBinaryBool(context, operation, context.Delegates.LogicalNotEqual);
}
private static OperationResult GenerateLogicalNot(CodeGenContext context, AstOperation operation)
{
return GenerateUnaryBool(context, operation, context.Delegates.LogicalNot);

View file

@ -74,6 +74,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
// BinaryBool
public readonly FuncBinaryInstruction LogicalAnd;
public readonly FuncBinaryInstruction LogicalNotEqual;
public readonly FuncBinaryInstruction LogicalOr;
// BinaryS32
@ -180,6 +181,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
// BinaryBool
LogicalAnd = context.LogicalAnd;
LogicalNotEqual = context.LogicalNotEqual;
LogicalOr = context.LogicalOr;
// BinaryS32