From 393d0a6134641c448cddc2ac692247a709ff9e52 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Wed, 8 Dec 2021 13:52:45 +0000 Subject: [PATCH] Update findMSB/findLSB to match master's instruction enum --- Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs index f00045942..23586e305 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs @@ -70,6 +70,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv Add(Instruction.Discard, GenerateDiscard); Add(Instruction.Divide, GenerateDivide); Add(Instruction.ExponentB2, GenerateExponentB2); + Add(Instruction.FindLSB, GenerateFindLSB); Add(Instruction.FindMSBS32, GenerateFindMSBS32); Add(Instruction.FindMSBU32, GenerateFindMSBU32); Add(Instruction.Floor, GenerateFloor); @@ -496,10 +497,16 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv return GenerateUnaryExtInst(context, operation, 29); } + private static OperationResult GenerateFindLSB(CodeGenContext context, AstOperation operation) + { + var source = context.GetU32(operation.GetSource(0)); + return new OperationResult(AggregateType.U32, context.ExtInst(context.TypeU32(), context.ExtSet, 74, source)); + } + private static OperationResult GenerateFindMSBS32(CodeGenContext context, AstOperation operation) { var source = context.GetS32(operation.GetSource(0)); - return new OperationResult(AggregateType.U32, context.ExtInst(context.TypeU32(), context.ExtSet, 74, source)); + return new OperationResult(AggregateType.U32, context.ExtInst(context.TypeU32(), context.ExtSet, 75, source)); } private static OperationResult GenerateFindMSBU32(CodeGenContext context, AstOperation operation)