From 1448136c3d03f9e4e7db48bfae64f594b9abbeb8 Mon Sep 17 00:00:00 2001 From: gdk Date: Thu, 7 Apr 2022 10:59:31 -0300 Subject: [PATCH] SPIR-V: Implement LogicalExclusiveOr --- Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs | 6 ++++++ Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvDelegates.cs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs index db1bdd49f..da7f17d0c 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs @@ -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); diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvDelegates.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvDelegates.cs index 89e1f73a7..fa0341ee9 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvDelegates.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvDelegates.cs @@ -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