diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-04-08 07:42:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 12:42:39 +0200 |
commit | e44a43c7e1ee0b25ef93a9419dbd6ac2eb7665b5 (patch) | |
tree | d0587a15710c0d7a525117c22304e717b7fea2ec /Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | |
parent | 3139a85a2b8e83aa6babfbc683bd46ca1d75e448 (diff) |
Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling (#3251)1.1.99
* Implement VMAD shader instruction and improve InvocationInfo and ISBERD handling
* Shader cache version bump
* Fix typo
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs index 51b70601..16b02f97 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs @@ -94,31 +94,19 @@ namespace Ryujinx.Graphics.Shader.Instructions case SReg.InvocationInfo: if (context.Config.Stage != ShaderStage.Compute && context.Config.Stage != ShaderStage.Fragment) { - Operand primitiveId = Attribute(AttributeConsts.PrimitiveId); - Operand patchVerticesIn; + // Note: Lowest 8-bits seems to contain some primitive index, + // but it seems to be NVIDIA implementation specific as it's only used + // to calculate ISBE offsets, so we can just keep it as zero. - if (context.Config.Stage == ShaderStage.TessellationEvaluation) + if (context.Config.Stage == ShaderStage.TessellationControl || + context.Config.Stage == ShaderStage.TessellationEvaluation) { - patchVerticesIn = context.ShiftLeft(Attribute(AttributeConsts.PatchVerticesIn), Const(16)); + src = 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 = Const(context.Config.GpuAccessor.QueryPrimitiveTopology().ToInputVertices() << 16); } - - src = context.BitwiseOr(primitiveId, patchVerticesIn); } else { |