diff options
| author | mageven <62494521+mageven@users.noreply.github.com> | 2021-03-27 05:20:26 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-27 00:50:26 +0100 |
| commit | a5d5ca06357e2fe1ee2cf880460109ce9da5fe4e (patch) | |
| tree | 2940071364e1a72972c2085d0ef812913b9f90ae /Ryujinx.Graphics.Shader/Decoders/Decoder.cs | |
| parent | 32be8caa9d37471947e5d75f953f8fda7a3e1943 (diff) | |
Shader Cache: Move bindless checking from translation to decode (#2145)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Decoders/Decoder.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Decoders/Decoder.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Decoders/Decoder.cs b/Ryujinx.Graphics.Shader/Decoders/Decoder.cs index ca45aab5..795a26cc 100644 --- a/Ryujinx.Graphics.Shader/Decoders/Decoder.cs +++ b/Ryujinx.Graphics.Shader/Decoders/Decoder.cs @@ -9,8 +9,10 @@ namespace Ryujinx.Graphics.Shader.Decoders { static class Decoder { - public static Block[][] Decode(IGpuAccessor gpuAccessor, ulong startAddress) + public static Block[][] Decode(IGpuAccessor gpuAccessor, ulong startAddress, out bool hasBindless) { + hasBindless = false; + List<Block[]> funcs = new List<Block[]>(); Queue<ulong> funcQueue = new Queue<ulong>(); @@ -84,7 +86,8 @@ namespace Ryujinx.Graphics.Shader.Decoders } } - FillBlock(gpuAccessor, currBlock, limitAddress, startAddress); + FillBlock(gpuAccessor, currBlock, limitAddress, startAddress, out bool blockHasBindless); + hasBindless |= blockHasBindless; if (currBlock.OpCodes.Count != 0) { @@ -229,9 +232,11 @@ namespace Ryujinx.Graphics.Shader.Decoders IGpuAccessor gpuAccessor, Block block, ulong limitAddress, - ulong startAddress) + ulong startAddress, + out bool hasBindless) { ulong address = block.Address; + hasBindless = false; do { @@ -272,6 +277,15 @@ namespace Ryujinx.Graphics.Shader.Decoders OpCode op = makeOp(emitter, opAddress, opCode); + // We check these patterns to figure out the presence of bindless access + hasBindless |= (op is OpCodeImage image && image.IsBindless) || + (op is OpCodeTxd txd && txd.IsBindless) || + (op is OpCodeTld4B) || + (emitter == InstEmit.TexB) || + (emitter == InstEmit.TldB) || + (emitter == InstEmit.TmmlB) || + (emitter == InstEmit.TxqB); + block.OpCodes.Add(op); } while (!IsControlFlowChange(block.GetLastOp())); |
