aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2022-05-12 14:47:13 +0100
committerGitHub <noreply@github.com>2022-05-12 10:47:13 -0300
commit43b4b34376cdea486906f8bb4058dda3be7e1bd8 (patch)
tree66e11982136335f0d7b180f9234b326ee5b3bf10 /Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs
parent92ca1cb0cbab228e5ef22645cd4f9d06b1da4766 (diff)
Implement Viewport Transform Disable (#3328)1.1.120
* Initial implementation (no specialization) * Use specialization * Fix render scale, increase code gen version * Revert accidental change * Address Feedback
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs28
1 files changed, 27 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs
index 1cdb3842..6ce2e537 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAttribute.cs
@@ -206,7 +206,33 @@ namespace Ryujinx.Graphics.Shader.Instructions
if (emit)
{
- context.EmitVertex();
+ if (context.Config.LastInVertexPipeline)
+ {
+ context.PrepareForVertexReturn(out var tempXLocal, out var tempYLocal, out var tempZLocal);
+
+ context.EmitVertex();
+
+ // Restore output position value before transformation.
+
+ if (tempXLocal != null)
+ {
+ context.Copy(Attribute(AttributeConsts.PositionX), tempXLocal);
+ }
+
+ if (tempYLocal != null)
+ {
+ context.Copy(Attribute(AttributeConsts.PositionY), tempYLocal);
+ }
+
+ if (tempZLocal != null)
+ {
+ context.Copy(Attribute(AttributeConsts.PositionZ), tempZLocal);
+ }
+ }
+ else
+ {
+ context.EmitVertex();
+ }
}
if (cut)