aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-11-08 11:39:30 -0300
committerGitHub <noreply@github.com>2021-11-08 11:39:30 -0300
commitb7a1544e8b4e538272c491a746bdd19ec188a0c3 (patch)
treeb325765ccd98613cb63350cb4d66bb19db38f0db /Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs
parent81e9b86cdb4b2a01cc41b8e8a4dff2c9e3c13843 (diff)
Fix InvocationInfo on geometry shader and bindless default integer const (#2822)
* Fix InvocationInfo on geometry shader and bindless default integer const * Shader cache version bump * Consistency for the default value
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs
index 240fd6b1..51b70601 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs
@@ -95,9 +95,28 @@ namespace Ryujinx.Graphics.Shader.Instructions
if (context.Config.Stage != ShaderStage.Compute && context.Config.Stage != ShaderStage.Fragment)
{
Operand primitiveId = Attribute(AttributeConsts.PrimitiveId);
- Operand patchVerticesIn = Attribute(AttributeConsts.PatchVerticesIn);
-
- patchVerticesIn = context.ShiftLeft(patchVerticesIn, Const(16));
+ Operand patchVerticesIn;
+
+ if (context.Config.Stage == ShaderStage.TessellationEvaluation)
+ {
+ patchVerticesIn = context.ShiftLeft(Attribute(AttributeConsts.PatchVerticesIn), Const(16));
+ }
+ else
+ {
+ InputTopology inputTopology = context.Config.GpuAccessor.QueryPrimitiveTopology();
+
+ int inputVertices = inputTopology switch
+ {
+ InputTopology.Points => 1,
+ InputTopology.Lines or
+ InputTopology.LinesAdjacency => 2,
+ InputTopology.Triangles or
+ InputTopology.TrianglesAdjacency => 3,
+ _ => 1
+ };
+
+ patchVerticesIn = Const(inputVertices << 16);
+ }
src = context.BitwiseOr(primitiveId, patchVerticesIn);
}