forked from Mirror/Ryujinx
End shader decoding when reaching a block that starts with an infinite loop (after BRX) (#2367)
* End shader decoding when reaching an infinite loop The NV shader compiler puts these at the end of shaders. * Update shader cache version
This commit is contained in:
parent
bfcc6a8ad6
commit
7ff1f9aa12
2 changed files with 5 additions and 3 deletions
|
@ -36,7 +36,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the codegen (to be changed when codegen or guest format change).
|
/// Version of the codegen (to be changed when codegen or guest format change).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const ulong ShaderCodeGenVersion = 2329;
|
private const ulong ShaderCodeGenVersion = 2367;
|
||||||
|
|
||||||
// Progress reporting helpers
|
// Progress reporting helpers
|
||||||
private volatile int _shaderCount;
|
private volatile int _shaderCount;
|
||||||
|
|
|
@ -9,6 +9,8 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
{
|
{
|
||||||
static class Decoder
|
static class Decoder
|
||||||
{
|
{
|
||||||
|
public const ulong ShaderEndDelimiter = 0xe2400fffff87000f;
|
||||||
|
|
||||||
public static Block[][] Decode(IGpuAccessor gpuAccessor, ulong startAddress, out bool hasBindless)
|
public static Block[][] Decode(IGpuAccessor gpuAccessor, ulong startAddress, out bool hasBindless)
|
||||||
{
|
{
|
||||||
hasBindless = false;
|
hasBindless = false;
|
||||||
|
@ -190,7 +192,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||||
|
|
||||||
ulong inst = gpuAccessor.MemoryRead<ulong>(startAdddress + currBlock.EndAddress);
|
ulong inst = gpuAccessor.MemoryRead<ulong>(startAdddress + currBlock.EndAddress);
|
||||||
|
|
||||||
return inst != 0UL;
|
return inst != 0UL && inst != ShaderEndDelimiter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool BinarySearch(List<Block> blocks, ulong address, out int index)
|
private static bool BinarySearch(List<Block> blocks, ulong address, out int index)
|
||||||
|
|
Loading…
Reference in a new issue