Workaround undefined behavior in bad dual source blend states

See merge request ryubing/ryujinx!4
This commit is contained in:
KeatonTheBot
2025-05-28 05:59:16 -05:00
committed by GreemDev
parent 7157565665
commit a32a87e0c9
2 changed files with 21 additions and 9 deletions

View File

@@ -512,13 +512,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
if (context.Definitions.Stage == ShaderStage.Fragment && context.Definitions.DualSourceBlend)
{
IoDefinition firstOutput = outputs.ElementAtOrDefault(0);
IoDefinition secondOutput = outputs.ElementAtOrDefault(1);
if (firstOutput.Location + 1 == secondOutput.Location)
{
DeclareOutputDualSourceBlendAttribute(context, firstOutput.Location);
outputs = outputs.Skip(2);
}
DeclareOutputDualSourceBlendAttribute(context, firstOutput.Location);
outputs = outputs.Skip(2);
}
foreach (IoDefinition ioDefinition in outputs)