aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/Translation/Translator.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-05-25 17:46:58 -0300
committerGitHub <noreply@github.com>2023-05-25 17:46:58 -0300
commit8f0c89ffd65eb2b979b24d457708218050fec6ae (patch)
tree5657b8a7f6246659d97f0f574f3f1829d65a235e /src/Ryujinx.Graphics.Shader/Translation/Translator.cs
parent2c9715acf6cb9ae8bceabec5e81602c7d64c7192 (diff)
Generate scaling helper functions on IR (#4714)1.1.822
* Generate scaling helper functions on IR * Delete unused code * Split RewriteTextureSample and move gather bias add to an earlier pass * Remove using * Shader cache version bump
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/Translation/Translator.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/Translation/Translator.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Shader/Translation/Translator.cs b/src/Ryujinx.Graphics.Shader/Translation/Translator.cs
index 87d97e52..5bbc0009 100644
--- a/src/Ryujinx.Graphics.Shader/Translation/Translator.cs
+++ b/src/Ryujinx.Graphics.Shader/Translation/Translator.cs
@@ -5,6 +5,7 @@ using Ryujinx.Graphics.Shader.IntermediateRepresentation;
using Ryujinx.Graphics.Shader.StructuredIr;
using Ryujinx.Graphics.Shader.Translation.Optimizations;
using System;
+using System.Collections.Generic;
using System.Linq;
using static Ryujinx.Graphics.Shader.IntermediateRepresentation.OperandHelper;
@@ -44,7 +45,14 @@ namespace Ryujinx.Graphics.Shader.Translation
}
}
- Function[] funcs = new Function[functions.Length];
+ List<Function> funcs = new List<Function>(functions.Length);
+
+ for (int i = 0; i < functions.Length; i++)
+ {
+ funcs.Add(null);
+ }
+
+ HelperFunctionManager hfm = new HelperFunctionManager(funcs, config.Stage);
for (int i = 0; i < functions.Length; i++)
{
@@ -71,7 +79,7 @@ namespace Ryujinx.Graphics.Shader.Translation
Ssa.Rename(cfg.Blocks);
Optimizer.RunPass(cfg.Blocks, config);
- Rewriter.RunPass(cfg.Blocks, config);
+ Rewriter.RunPass(hfm, cfg.Blocks, config);
}
funcs[i] = new Function(cfg.Blocks, $"fun{i}", false, inArgumentsCount, outArgumentsCount);