mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-26 15:09:17 +00:00
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user