From 408bd63b08cbde8ba55bb05a39868271a9e40ba4 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 7 Sep 2022 20:25:22 -0300 Subject: Transform shader LDC into constant buffer access if offset is constant (#3672) * Transform shader LDC into constant buffer access if offset is constant * Shader cache version bump --- Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Ryujinx.Graphics.Shader/Translation/Optimizations') diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs index 856a5598..092e52a9 100644 --- a/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs +++ b/Ryujinx.Graphics.Shader/Translation/Optimizations/ConstantFolding.cs @@ -153,6 +153,10 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations EvaluateFPUnary(operation, (x) => float.IsNaN(x)); break; + case Instruction.LoadConstant: + operation.TurnIntoCopy(Cbuf(operation.GetSource(0).Value, operation.GetSource(1).Value)); + break; + case Instruction.Maximum: EvaluateBinary(operation, (x, y) => Math.Max(x, y)); break; -- cgit v1.2.3