SPIR-V: Only add FSI exec mode if used.

This commit is contained in:
riperiperi 2022-02-27 23:00:04 +00:00
parent 51d986da35
commit 2d6642d605
3 changed files with 8 additions and 2 deletions

View file

@ -199,7 +199,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
context.AddExecutionMode(spvFunc, ExecutionMode.EarlyFragmentTests);
}
if (context.Config.GpuAccessor.QueryHostSupportsFragmentShaderInterlock())
if ((info.HelperFunctionsMask & HelperFunctionsMask.FSI) != 0 &&
context.Config.GpuAccessor.QueryHostSupportsFragmentShaderInterlock())
{
context.AddExecutionMode(spvFunc, ExecutionMode.PixelInterlockOrderedEXT);
}

View file

@ -15,6 +15,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
ShuffleXor = 1 << 7,
StoreSharedSmallInt = 1 << 8,
StoreStorageSmallInt = 1 << 9,
SwizzleAdd = 1 << 10
SwizzleAdd = 1 << 10,
FSI = 1 << 11
}
}

View file

@ -244,6 +244,10 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
case Instruction.SwizzleAdd:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.SwizzleAdd;
break;
case Instruction.FSIBegin:
case Instruction.FSIEnd:
context.Info.HelperFunctionsMask |= HelperFunctionsMask.FSI;
break;
}
}