فهرست منبع

Fix primitive count calculation for topology conversion (#3763)

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.
riperiperi 3 سال پیش
والد
کامیت
2b50e52e48
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs

+ 1 - 1
Ryujinx.Graphics.Vulkan/IndexBufferPattern.cs

@@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Vulkan
 
 
         public int GetPrimitiveCount(int vertexCount)
         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)
         public int GetConvertedCount(int indexCount)