From 65fee49e8a6fd6dcc058e3cfd52b2c26f038eced Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 20 Jun 2021 15:48:12 -0300 Subject: [PATCH] Fix separate bindless sampler at offset 0 (#2360) --- Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | 2 +- .../Translation/Optimizations/BindlessElimination.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index 1989131e..d96d2b2a 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -473,7 +473,7 @@ namespace Ryujinx.Graphics.Gpu.Image ? bufferManager.GetComputeUniformBufferAddress(samplerBufferIndex) : bufferManager.GetGraphicsUniformBufferAddress(stageIndex, samplerBufferIndex); - handle |= _context.PhysicalMemory.Read(samplerBufferAddress + (ulong)((uint)wordOffset >> HandleHigh) * 4); + handle |= _context.PhysicalMemory.Read(samplerBufferAddress + (ulong)((wordOffset >> HandleHigh) - 1) * 4); } return handle; diff --git a/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs b/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs index 6156a6f4..e66bde0a 100644 --- a/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs +++ b/Ryujinx.Graphics.Shader/Translation/Optimizations/BindlessElimination.cs @@ -58,7 +58,7 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations SetHandle( config, texOp, - src0.GetCbufOffset() | (src1.GetCbufOffset() << 16), + src0.GetCbufOffset() | ((src1.GetCbufOffset() + 1) << 16), src0.GetCbufSlot() | ((src1.GetCbufSlot() + 1) << 16)); } else if (texOp.Inst == Instruction.ImageLoad || texOp.Inst == Instruction.ImageStore)