From 973a615d405a83d5fc2f6a11ad12ba63c2a76465 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Sun, 25 Oct 2020 14:51:26 -0300
Subject: [PATCH] Fix shader image load/store array index register (#1637)

* Fix shader image load/store array index register

* Y should come before the array index
---
 Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
index eaae993bbe..49e6cf5d34 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs
@@ -40,8 +40,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
                 return context.Copy(Register(raIndex++, RegisterType.Gpr));
             }
 
-            Operand arrayIndex = type.HasFlag(SamplerType.Array) ? Ra() : null;
-
             List<Operand> sourcesList = new List<Operand>();
 
             if (op.IsBindless)
@@ -66,7 +64,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
 
             if (type.HasFlag(SamplerType.Array))
             {
-                sourcesList.Add(arrayIndex);
+                sourcesList.Add(Ra());
 
                 type |= SamplerType.Array;
             }
@@ -193,8 +191,6 @@ namespace Ryujinx.Graphics.Shader.Instructions
                 return context.Copy(Register(rbIndex++, RegisterType.Gpr));
             }
 
-            Operand arrayIndex = type.HasFlag(SamplerType.Array) ? Ra() : null;
-
             List<Operand> sourcesList = new List<Operand>();
 
             if (op.IsBindless)
@@ -219,7 +215,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
 
             if (type.HasFlag(SamplerType.Array))
             {
-                sourcesList.Add(arrayIndex);
+                sourcesList.Add(Ra());
 
                 type |= SamplerType.Array;
             }