diff options
author | riperiperi <rhy3756547@hotmail.com> | 2022-10-16 23:25:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-16 19:25:40 -0300 |
commit | 2b50e52e4815f5dc2306ebfec6b15625ff864839 (patch) | |
tree | 67fd736f4cad9433d80fb2a8ef3071b8d4688578 | |
parent | 49eadbc209fa27271eb6110b85776fdfd54a445c (diff) |
Fix primitive count calculation for topology conversion (#3763)1.1.303
Luigi's Mansion 3 performs a non-index quads draw with 6 vertices. It's meant to ignore the last two, but the index pattern's primitive count calculation was rounding up.
No idea why the game does this but this should fix random triangles in the map.
-rw-r--r-- | Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs b/Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs index 8439e79d..90774293 100644 --- a/Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs +++ b/Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs @@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Vulkan public int GetPrimitiveCount(int vertexCount) { - return Math.Max(0, ((vertexCount - BaseIndex) + IndexStride - 1) / IndexStride); + return Math.Max(0, (vertexCount - BaseIndex) / IndexStride); } public int GetConvertedCount(int indexCount) |