Fix ~3500 analyser issues

See merge request ryubing/ryujinx!44
This commit is contained in:
MrKev
2025-05-30 17:08:34 -05:00
committed by LotP
parent 417df486b1
commit 361d0c5632
622 changed files with 3080 additions and 2652 deletions

View File

@@ -285,6 +285,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
{
data[index] = index;
}
break;
case PrimitiveTopology.LineLoop:
data[^1] = 0;
@@ -294,6 +295,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index] = index >> 1;
data[index + 1] = (index >> 1) + 1;
}
break;
case PrimitiveTopology.LineStrip:
for (int index = 0; index < ((data.Length - 1) & ~1); index += 2)
@@ -301,6 +303,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index] = index >> 1;
data[index + 1] = (index >> 1) + 1;
}
break;
case PrimitiveTopology.TriangleStrip:
int tsTrianglesCount = data.Length / 3;
@@ -330,6 +333,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[baseIndex + 2] = tsOutIndex++;
}
}
break;
case PrimitiveTopology.TriangleFan:
case PrimitiveTopology.Polygon:
@@ -342,6 +346,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index + 1] = tfOutIndex;
data[index + 2] = ++tfOutIndex;
}
break;
case PrimitiveTopology.Quads:
int qQuadsCount = data.Length / 6;
@@ -358,6 +363,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index + 4] = qIndex + 2;
data[index + 5] = qIndex + 3;
}
break;
case PrimitiveTopology.QuadStrip:
int qsQuadsCount = data.Length / 6;
@@ -384,6 +390,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index + 4] = qIndex + 2;
data[index + 5] = qIndex + 3;
}
break;
case PrimitiveTopology.LineStripAdjacency:
for (int index = 0; index < ((data.Length - 3) & ~3); index += 4)
@@ -395,6 +402,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[index + 2] = lIndex + 2;
data[index + 3] = lIndex + 3;
}
break;
case PrimitiveTopology.TriangleStripAdjacency:
int tsaTrianglesCount = data.Length / 6;
@@ -433,6 +441,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
data[baseIndex + 5] = tsaOutIndex++;
}
}
break;
}

View File

@@ -170,8 +170,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
int vbStride = vertexBuffer.UnpackStride();
ulong vbSize = GetVertexBufferSize(address, endAddress.Pack(), vbStride, _indexed, instanced, _firstVertex, _count);
ulong oldVbSize = vbSize;
ulong attributeOffset = (ulong)vertexAttrib.UnpackOffset();
int componentSize = format.GetScalarSize();
@@ -477,7 +475,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.ComputeDraw
private readonly ulong GetVertexBufferSize(ulong vbAddress, ulong vbEndAddress, int vbStride, bool indexed, bool instanced, int firstVertex, int vertexCount)
{
IndexType indexType = _state.State.IndexBufferState.Type;
bool indexTypeSmall = indexType == IndexType.UByte || indexType == IndexType.UShort;
bool indexTypeSmall = indexType is IndexType.UByte or IndexType.UShort;
ulong vbSize = vbEndAddress - vbAddress + 1;
ulong size;