mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 14:29:58 -04:00
Import the base tree (MIT, see LICENSE)
This commit is contained in:
26
tools/xlate/patches/0004-no-else-if-flattening.patch
Normal file
26
tools/xlate/patches/0004-no-else-if-flattening.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
--- a/src/Ryujinx.Graphics.Shader/StructuredIr/AstOptimizer.cs
|
||||
+++ b/src/Ryujinx.Graphics.Shader/StructuredIr/AstOptimizer.cs
|
||||
@@ -118,6 +118,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ private const bool ElseIfFlattening = false;
|
||||
+
|
||||
private static void RemoveEmptyBlocks(AstBlock mainBlock)
|
||||
{
|
||||
Queue<AstBlock> pending = new();
|
||||
@@ -163,7 +165,13 @@
|
||||
parent.Remove(block);
|
||||
}
|
||||
}
|
||||
- else if (isIf && parent.Type == AstBlockType.Else && parent.Count == (hasElse ? 2 : 1))
|
||||
+ // NX2NAVI (2026-10-16): the else-if flattening (`else { if (c) A else B }` -> `else if (c) A else B`) is
|
||||
+ // disabled. The SPIR-V backend gives the else-if the same merge block as the if before it, and
|
||||
+ // SPIRV-Cross then drops the trailing else of the chain: NX2NAVI's fragment shader 1870878a lost three
|
||||
+ // loops with an atomic max (a feedback write) and a discard (scripts/diag/msl_invariants.py found 12
|
||||
+ // variants losing atomics and 83 changing discards). The nested form is what DebugMode always produced,
|
||||
+ // because its comment nodes keep every block non-empty and this branch never ran.
|
||||
+ else if (ElseIfFlattening && isIf && parent.Type == AstBlockType.Else && parent.Count == (hasElse ? 2 : 1))
|
||||
{
|
||||
AstBlock parentOfParent = parent.Parent;
|
||||
|
||||
Reference in New Issue
Block a user