diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-09-10 10:20:23 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-10 13:20:23 +0000 |
| commit | 619ac86bd03fcafdcae19f8fc5ad7d90780c194b (patch) | |
| tree | 81638c9e0d617d7139c9924d9a5de3fa4bf1c33e /Ryujinx.Graphics.Shader | |
| parent | 7a1ab71c7376bcc3d043c09c9ac1172637955e54 (diff) | |
Do not output ViewportIndex on SPIR-V if GPU does not support it (#3644)
* Do not output ViewportIndex on SPIR-V if GPU does not support it
* Bump shader cache version
Diffstat (limited to 'Ryujinx.Graphics.Shader')
| -rw-r--r-- | Ryujinx.Graphics.Shader/IGpuAccessor.cs | 9 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/IGpuAccessor.cs b/Ryujinx.Graphics.Shader/IGpuAccessor.cs index 7951e71b..2cdc81fb 100644 --- a/Ryujinx.Graphics.Shader/IGpuAccessor.cs +++ b/Ryujinx.Graphics.Shader/IGpuAccessor.cs @@ -268,6 +268,15 @@ namespace Ryujinx.Graphics.Shader } /// <summary> + /// Queries host GPU shader viewport index output support. + /// </summary> + /// <returns>True if the GPU and driver supports shader viewport index output, false otherwise</returns> + bool QueryHostSupportsViewportIndex() + { + return true; + } + + /// <summary> /// Queries the point size from the GPU state, used when it is not explicitly set on the shader. /// </summary> /// <returns>Current point size</returns> diff --git a/Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs b/Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs index 2a97ee52..6680a332 100644 --- a/Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs +++ b/Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs @@ -78,6 +78,11 @@ namespace Ryujinx.Graphics.Shader.Translation public static bool Validate(ShaderConfig config, int value, bool isOutAttr) { + if (value == AttributeConsts.ViewportIndex && !config.GpuAccessor.QueryHostSupportsViewportIndex()) + { + return false; + } + return From(config, value, isOutAttr).IsValid; } |
