From 2d6642d605e31a9d8e84d15f9c6c095bc8d22eec Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sun, 27 Feb 2022 23:00:04 +0000 Subject: [PATCH] SPIR-V: Only add FSI exec mode if used. --- Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs | 3 ++- Ryujinx.Graphics.Shader/StructuredIr/HelperFunctionsMask.cs | 3 ++- Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs index 37b6be7f5..895b37b53 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs @@ -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); } diff --git a/Ryujinx.Graphics.Shader/StructuredIr/HelperFunctionsMask.cs b/Ryujinx.Graphics.Shader/StructuredIr/HelperFunctionsMask.cs index 3dfd025b5..d45f8d4ee 100644 --- a/Ryujinx.Graphics.Shader/StructuredIr/HelperFunctionsMask.cs +++ b/Ryujinx.Graphics.Shader/StructuredIr/HelperFunctionsMask.cs @@ -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 } } \ No newline at end of file diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs index 0ec56441c..7e15384b2 100644 --- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs +++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs @@ -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; } }