Generate scaling helper functions on IR (#4714)
* 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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user