From 711093b55309d59bc4daf797bdab469e17988ce1 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 28 Mar 2019 12:37:03 -0300 Subject: [PATCH] Fix shift instructions and a typo --- Ryujinx.Graphics/Shader/Instructions/InstEmitAlu.cs | 4 ++-- .../Shader/StructuredIr/StructuredProgramContext.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ryujinx.Graphics/Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics/Shader/Instructions/InstEmitAlu.cs index b535efdef3..9b7bb0d321 100644 --- a/Ryujinx.Graphics/Shader/Instructions/InstEmitAlu.cs +++ b/Ryujinx.Graphics/Shader/Instructions/InstEmitAlu.cs @@ -364,7 +364,7 @@ namespace Ryujinx.Graphics.Shader.Instructions if (!isMasked) { //Clamped shift value. - Operand isLessThan32 = context.ICompareLessUnsigned(res, Const(32)); + Operand isLessThan32 = context.ICompareLessUnsigned(srcB, Const(32)); res = context.ConditionalSelect(isLessThan32, res, Const(0)); } @@ -413,7 +413,7 @@ namespace Ryujinx.Graphics.Shader.Instructions resShiftBy32 = Const(0); } - Operand isLessThan32 = context.ICompareLessUnsigned(res, Const(32)); + Operand isLessThan32 = context.ICompareLessUnsigned(srcB, Const(32)); res = context.ConditionalSelect(isLessThan32, res, resShiftBy32); } diff --git a/Ryujinx.Graphics/Shader/StructuredIr/StructuredProgramContext.cs b/Ryujinx.Graphics/Shader/StructuredIr/StructuredProgramContext.cs index 863c2771bb..5741899e38 100644 --- a/Ryujinx.Graphics/Shader/StructuredIr/StructuredProgramContext.cs +++ b/Ryujinx.Graphics/Shader/StructuredIr/StructuredProgramContext.cs @@ -119,7 +119,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr //- The branch should be unconditional. //- This should be the last block on the current (if) statement. //- The statement before the else must be an if statement. - //- The branch target must be before or at (but not after) the end of the encloding block. + //- The branch target must be before or at (but not after) the end of the enclosing block. if (block.Branch == null || block.Next != null || block.Index + 1 != _currEndIndex) { return false;