aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-02-13 21:48:07 -0300
committerGitHub <noreply@github.com>2020-02-14 01:48:07 +0100
commit5a9dba0756e3173e3983cad3626e8e876b3c3041 (patch)
treead89503d9e73008327c62a207cec79ef82454ded /Ryujinx.Graphics.Shader/Instructions
parent416ddd0f6e9b5c9e9b3da627cc90c98bb5a3a56b (diff)
Sign-extend shader memory instruction offsets (#934)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
index 664c798b..1fddcc8c 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
@@ -138,11 +138,11 @@ namespace Ryujinx.Graphics.Shader.Instructions
int count = op.Size == IntegerSize.B64 ? 2 : 1;
- Operand wordOffset = context.ShiftRightU32(GetSrcA(context), Const(2));
+ Operand addr = context.IAdd(GetSrcA(context), Const(op.Offset));
- wordOffset = context.IAdd(wordOffset, Const(op.Offset));
+ Operand wordOffset = context.ShiftRightU32(addr, Const(2));
- Operand bitOffset = GetBitOffset(context, GetSrcA(context));
+ Operand bitOffset = GetBitOffset(context, addr);
for (int index = 0; index < count; index++)
{