From 5fdc46ac7f6e0858c65bc6f30beb043faecccc05 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Fri, 21 Oct 2022 01:48:21 -0300 Subject: [PATCH] Vulkan: Fix vertex position Z conversion with geometry shader passthrough (#3781) * Vulkan: Fix vertex position Z conversion with geometry shader passthrough * Shader cache version bump --- .../Shader/DiskCache/DiskCacheHostStorage.cs | 2 +- Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs b/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs index 2168c185..86d453cc 100644 --- a/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs +++ b/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheHostStorage.cs @@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache private const ushort FileFormatVersionMajor = 1; private const ushort FileFormatVersionMinor = 2; private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor; - private const uint CodeGenVersion = 3759; + private const uint CodeGenVersion = 3781; private const string SharedTocFileName = "shared.toc"; private const string SharedDataFileName = "shared.data"; diff --git a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs index b18979d8..22747160 100644 --- a/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs +++ b/Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs @@ -306,7 +306,10 @@ namespace Ryujinx.Graphics.Shader.Translation config._perPatchAttributeLocations = locationsMap; } - if (config.Stage != ShaderStage.Fragment) + // We don't consider geometry shaders using the geometry shader passthrough feature + // as being the last because when this feature is used, it can't actually modify any of the outputs, + // so the stage that comes before it is the last one that can do modifications. + if (config.Stage != ShaderStage.Fragment && (config.Stage != ShaderStage.Geometry || !config.GpPassthrough)) { LastInVertexPipeline = false; }