aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-03-10 21:16:40 -0300
committerGitHub <noreply@github.com>2024-03-10 21:16:40 -0300
commit5a900f38c52269ee1282695e5e62a05269d0a478 (patch)
tree430e786c467135efd18934660dbd7b8c48ea6ee4 /src/Ryujinx.Graphics.Shader
parenta3a63d43948b79450d1a0ee963ea4796cb3532a0 (diff)
Fix lost copy and swap problem on shader SSA deconstruction (#6455)
* Fix lost copy on shader SSA deconstruction * Shader cache version bump
Diffstat (limited to 'src/Ryujinx.Graphics.Shader')
-rw-r--r--src/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs
index 8b1cb9c5..90f1f2f6 100644
--- a/src/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs
+++ b/src/Ryujinx.Graphics.Shader/StructuredIr/PhiFunctions.cs
@@ -24,17 +24,21 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
continue;
}
+ Operand temp = OperandHelper.Local();
+
for (int index = 0; index < phi.SourcesCount; index++)
{
Operand src = phi.GetSource(index);
-
BasicBlock srcBlock = phi.GetBlock(index);
- Operation copyOp = new(Instruction.Copy, phi.Dest, src);
+ Operation copyOp = new(Instruction.Copy, temp, src);
srcBlock.Append(copyOp);
}
+ Operation copyOp2 = new(Instruction.Copy, phi.Dest, temp);
+
+ nextNode = block.Operations.AddAfter(node, copyOp2).Next;
block.Operations.Remove(node);
node = nextNode;