From 43081c16c48d73dfd585d951281fcbd60bebccbc Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Sun, 5 Feb 2023 18:52:57 -0300
Subject: Insert bitcast for assignment of fragment integer outputs on GLSL
 (#4369)

* Insert bitcast for assignment of fragment integer outputs on GLSL

* Shader cache version bump
---
 Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs')

diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
index 080f1708..ce1ab50e 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/OperandManager.cs
@@ -485,6 +485,16 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl
 
                     AttributeType type = context.Config.GpuAccessor.QueryAttributeType(location);
 
+                    return type.ToAggregateType();
+                }
+                else if (context.Config.Stage == ShaderStage.Fragment && isAsgDest &&
+                    operand.Value >= AttributeConsts.FragmentOutputColorBase &&
+                    operand.Value < AttributeConsts.FragmentOutputColorEnd)
+                {
+                    int location = (operand.Value - AttributeConsts.FragmentOutputColorBase) / 16;
+
+                    AttributeType type = context.Config.GpuAccessor.QueryFragmentOutputType(location);
+
                     return type.ToAggregateType();
                 }
             }
-- 
cgit v1.2.3-70-g09d2