Use a new approach for shader BRX targets (#2532)
* Use a new approach for shader BRX targets * Make shader cache actually work * Improve the shader pattern matching a bit * Extend LDC search to predecessor blocks, catches more cases * Nit * Only save the amount of constant buffer data actually used. Avoids crashes on partially mapped buffers * Ignore Rd on predicate instructions, as they do not have a Rd register (catches more cases)
This commit is contained in:
parent
70f79e689b
commit
d9d18439f6
12 changed files with 472 additions and 149 deletions
|
@ -8,10 +8,38 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
public ulong Address { get; set; }
|
||||
public ulong EndAddress { get; set; }
|
||||
|
||||
public Block Next { get; set; }
|
||||
public Block Branch { get; set; }
|
||||
private Block _next;
|
||||
private Block _branch;
|
||||
|
||||
public OpCodeBranchIndir BrIndir { get; set; }
|
||||
public Block Next
|
||||
{
|
||||
get
|
||||
{
|
||||
return _next;
|
||||
}
|
||||
set
|
||||
{
|
||||
_next?.Predecessors.Remove(this);
|
||||
value?.Predecessors.Add(this);
|
||||
_next = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Block Branch
|
||||
{
|
||||
get
|
||||
{
|
||||
return _branch;
|
||||
}
|
||||
set
|
||||
{
|
||||
_branch?.Predecessors.Remove(this);
|
||||
value?.Predecessors.Add(this);
|
||||
_branch = value;
|
||||
}
|
||||
}
|
||||
|
||||
public HashSet<Block> Predecessors { get; }
|
||||
|
||||
public List<OpCode> OpCodes { get; }
|
||||
public List<OpCodePush> PushOpCodes { get; }
|
||||
|
@ -20,6 +48,8 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
|||
{
|
||||
Address = address;
|
||||
|
||||
Predecessors = new HashSet<Block>();
|
||||
|
||||
OpCodes = new List<OpCode>();
|
||||
PushOpCodes = new List<OpCodePush>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue