Make the shader translator more error resilient
This commit is contained in:
parent
eea73bc421
commit
04102e5c9d
3 changed files with 49 additions and 19 deletions
|
@ -105,13 +105,16 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
{
|
||||
BasicBlock[] irBlocks = ControlFlowGraph.MakeCfg(ops);
|
||||
|
||||
Dominance.FindDominators(irBlocks[0], irBlocks.Length);
|
||||
if (irBlocks.Length > 0)
|
||||
{
|
||||
Dominance.FindDominators(irBlocks[0], irBlocks.Length);
|
||||
|
||||
Dominance.FindDominanceFrontiers(irBlocks);
|
||||
Dominance.FindDominanceFrontiers(irBlocks);
|
||||
|
||||
Ssa.Rename(irBlocks);
|
||||
Ssa.Rename(irBlocks);
|
||||
|
||||
Optimizer.Optimize(irBlocks, config.Stage);
|
||||
Optimizer.Optimize(irBlocks, config.Stage);
|
||||
}
|
||||
|
||||
StructuredProgramInfo sInfo = StructuredProgram.MakeStructuredProgram(irBlocks, config);
|
||||
|
||||
|
@ -158,6 +161,13 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
context = new EmitterContext(header.Stage, header);
|
||||
}
|
||||
|
||||
if (cfg == null)
|
||||
{
|
||||
size = 0;
|
||||
|
||||
return new Operation[0];
|
||||
}
|
||||
|
||||
ulong maxEndAddress = 0;
|
||||
|
||||
for (int blkIndex = 0; blkIndex < cfg.Length; blkIndex++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue