aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-09-10 22:22:18 -0300
committerGitHub <noreply@github.com>2023-09-11 01:22:18 +0000
commite2cfe6fe44b62d7aba1425ae2e621f50045f406c (patch)
tree991b3d4c833cce8e1ad82834a85f34744f95372f /src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
parent210f4754849bf147a584695c0cced9d14c905f8e (diff)
Fix shader GlobalToStorage pass when base address comes from local or shared memory (#5668)1.1.1011
* Fix shader GlobalToStorage pass when base address comes from local or shared memory * Shader cache version bump
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs b/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
index 0f043f77..e426d54d 100644
--- a/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
+++ b/src/Ryujinx.Graphics.Shader/Translation/Optimizations/GlobalToStorage.cs
@@ -1126,7 +1126,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
// so we want to get the byte offset back, since each one of those word
// offsets are a new "local variable" which will not match.
- if (operation.GetSource(0).AsgOp is Operation shiftRightOp &&
+ if (operation.GetSource(1).AsgOp is Operation shiftRightOp &&
shiftRightOp.Inst == Instruction.ShiftRightU32 &&
shiftRightOp.GetSource(1).Type == OperandType.Constant &&
shiftRightOp.GetSource(1).Value == 2)
@@ -1158,9 +1158,11 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
private static bool TryGetLocalMemoryOffset(Operation operation, out int constOffset)
{
- if (operation.GetSource(0).Type == OperandType.Constant)
+ Operand offset = operation.GetSource(1);
+
+ if (offset.Type == OperandType.Constant)
{
- constOffset = operation.GetSource(0).Value;
+ constOffset = offset.Value;
return true;
}