diff --git a/Ryujinx.Graphics.Gpu/Engine/Compute.cs b/Ryujinx.Graphics.Gpu/Engine/Compute.cs index 9178cfb0d8..d712e68914 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Compute.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Compute.cs @@ -77,7 +77,7 @@ namespace Ryujinx.Graphics.Gpu.Engine ulong sbDescAddress = BufferManager.GetComputeUniformBufferAddress(0); - int sbDescOffset = 0x310 + sb.Slot * 0x10; + int sbDescOffset = 0x210 + sb.Slot * 0x10; sbDescAddress += (ulong)sbDescOffset; diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 0acbd94ad0..551fe93b60 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -393,7 +393,7 @@ namespace Ryujinx.Graphics.Gpu.Memory { uint enableMask = _cpStorageBuffers.EnableMask; - for (int index = 0; (enableMask >> index) != 0; index++) + for (int index = 0; (enableMask >> index) != 0 && index < 32; index++) { if ((enableMask & (1u << index)) == 0) { @@ -414,7 +414,7 @@ namespace Ryujinx.Graphics.Gpu.Memory enableMask = _cpUniformBuffers.EnableMask; - for (int index = 0; (enableMask >> index) != 0; index++) + for (int index = 0; (enableMask >> index) != 0 && index < 32; index++) { if ((enableMask & (1u << index)) == 0) { @@ -467,7 +467,7 @@ namespace Ryujinx.Graphics.Gpu.Memory VertexBufferDescriptor[] vertexBuffers = new VertexBufferDescriptor[Constants.TotalVertexBuffers]; - for (int index = 0; (vbEnableMask >> index) != 0; index++) + for (int index = 0; (vbEnableMask >> index) != 0 && index < 32; index++) { VertexBuffer vb = _vertexBuffers[index]; @@ -485,7 +485,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } else { - for (int index = 0; (vbEnableMask >> index) != 0; index++) + for (int index = 0; (vbEnableMask >> index) != 0 && index < 32; index++) { VertexBuffer vb = _vertexBuffers[index];