aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader')
-rw-r--r--Ryujinx.Graphics.Shader/IGpuAccessor.cs9
-rw-r--r--Ryujinx.Graphics.Shader/Translation/AttributeInfo.cs5
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;
}