From d512ce122cb1c9a7fe7cb40d3f85d642ee37f897 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Mon, 18 Oct 2021 18:38:04 -0300
Subject: Initial tessellation shader support (#2534)

* Initial tessellation shader support

* Nits

* Re-arrange built-in table

* This is not needed anymore

* PR feedback
---
 Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs')

diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs
index a9e44175..2a39d021 100644
--- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs
+++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramContext.cs
@@ -282,6 +282,12 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
 
         public AstOperand GetOperandUse(Operand operand)
         {
+            // If this flag is set, we're reading from an output attribute instead.
+            if (operand.Type.IsAttribute() && (operand.Value & AttributeConsts.LoadOutputMask) != 0)
+            {
+                return GetOperandDef(operand);
+            }
+
             return GetOperand(operand);
         }
 
-- 
cgit v1.2.3-70-g09d2