Import the base tree (MIT, see LICENSE)

This commit is contained in:
Valiantsin Dzerakh
2026-11-04 22:16:41 +03:00
committed by chrg6
commit 0478c13e45
734 changed files with 233953 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
--- a/src/Ryujinx.Graphics.Shader/StructuredIr/AstOptimizer.cs
+++ b/src/Ryujinx.Graphics.Shader/StructuredIr/AstOptimizer.cs
@@ -24,7 +24,11 @@
{
bool isWorthPropagating = propVar.Uses.Count == 1 || IsWorthPropagating(assignment.Source);
- if (propVar.Defs.Count == 1 && isWorthPropagating)
+ // NX2NAVI: SPIR-V passes call arguments by pointer to a variable (StructuredProgram copies them
+ // into temporaries); folding an expression into a call argument breaks GenerateCall.
+ bool usedByCall = propVar.Uses.Any(u => u is AstOperation op && op.Inst == Instruction.Call);
+
+ if (propVar.Defs.Count == 1 && isWorthPropagating && !usedByCall)
{
PropagateExpression(propVar, assignment.Source);
}