aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-10-29 13:45:30 -0300
committerGitHub <noreply@github.com>2022-10-29 13:45:30 -0300
commit59cdf310bdc16d537ba5ff3813399c54abbce2b7 (patch)
tree4cd095f5b7dc3a18f53c9c94c9001a5f3fd5c268 /Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
parent4e34170a84fc1b2096ad4588dec9460a5f8c9870 (diff)
SPIR-V: Fix tessellation control shader output types (#3807)1.1.332
* SPIR-V: Fix tessellation control shader output types * Shader cache version bump
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
index 1a4decf5..9f8dd7df 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs
@@ -473,6 +473,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
var attrType = context.TypeVector(context.TypeFP32(), (LiteralInteger)4);
attrType = context.TypeArray(attrType, context.Constant(context.TypeU32(), (LiteralInteger)MaxAttributes));
+ if (context.Config.Stage == ShaderStage.TessellationControl)
+ {
+ attrType = context.TypeArray(attrType, context.Constant(context.TypeU32(), context.Config.ThreadsPerInputPrimitive));
+ }
+
var spvType = context.TypePointer(StorageClass.Output, attrType);
var spvVar = context.Variable(spvType, StorageClass.Output);
@@ -543,6 +548,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
}
}
+ if (context.Config.Stage == ShaderStage.TessellationControl && isOutAttr && !perPatch)
+ {
+ attrType = context.TypeArray(attrType, context.Constant(context.TypeU32(), context.Config.ThreadsPerInputPrimitive));
+ }
+
var spvType = context.TypePointer(storageClass, attrType);
var spvVar = context.Variable(spvType, storageClass);
@@ -634,6 +644,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
attrType = context.TypeArray(attrType, context.Constant(context.TypeU32(), (LiteralInteger)arraySize));
}
+ if (context.Config.Stage == ShaderStage.TessellationControl && isOutAttr)
+ {
+ attrType = context.TypeArray(attrType, context.Constant(context.TypeU32(), context.Config.ThreadsPerInputPrimitive));
+ }
+
var spvType = context.TypePointer(storageClass, attrType);
var spvVar = context.Variable(spvType, storageClass);