20 extra brackets...

This commit is contained in:
Andy Adshead 2018-12-30 18:39:09 +00:00
commit fe7308de89

View file

@ -803,10 +803,14 @@ namespace Ryujinx.Graphics.Graphics3d
if (Stride == 0) if (Stride == 0)
{ {
if (PrimType == GalPrimitiveType.Quads) if (PrimType == GalPrimitiveType.Quads)
{
ModifiedVbSize = QuadHelper.ConvertSizeQuadsToTris(ModifiedVbSize); ModifiedVbSize = QuadHelper.ConvertSizeQuadsToTris(ModifiedVbSize);
}
else if (PrimType == GalPrimitiveType.QuadStrip) else if (PrimType == GalPrimitiveType.QuadStrip)
{
ModifiedVbSize = QuadHelper.ConvertSizeQuadStripToTris(ModifiedVbSize); ModifiedVbSize = QuadHelper.ConvertSizeQuadStripToTris(ModifiedVbSize);
} }
}
bool VboCached = Gpu.Renderer.Rasterizer.IsVboCached(VboKey, ModifiedVbSize); bool VboCached = Gpu.Renderer.Rasterizer.IsVboCached(VboKey, ModifiedVbSize);
@ -818,16 +822,24 @@ namespace Ryujinx.Graphics.Graphics3d
byte[] data = Vmm.ReadBytes(VbPosition, VbSize); byte[] data = Vmm.ReadBytes(VbPosition, VbSize);
if (PrimType == GalPrimitiveType.Quads) if (PrimType == GalPrimitiveType.Quads)
{
data = QuadHelper.ConvertQuadsToTris(data, Stride, (int)(VbSize / Stride)); data = QuadHelper.ConvertQuadsToTris(data, Stride, (int)(VbSize / Stride));
}
else else
{
data = QuadHelper.ConvertQuadStripToTris(data, Stride, (int)(VbSize / Stride)); data = QuadHelper.ConvertQuadStripToTris(data, Stride, (int)(VbSize / Stride));
}
Gpu.Renderer.Rasterizer.CreateVbo(VboKey, data); Gpu.Renderer.Rasterizer.CreateVbo(VboKey, data);
} }
else if (Vmm.TryGetHostAddress(VbPosition, VbSize, out IntPtr VbPtr)) else if (Vmm.TryGetHostAddress(VbPosition, VbSize, out IntPtr VbPtr))
{
Gpu.Renderer.Rasterizer.CreateVbo(VboKey, (int)VbSize, VbPtr); Gpu.Renderer.Rasterizer.CreateVbo(VboKey, (int)VbSize, VbPtr);
}
else else
{
Gpu.Renderer.Rasterizer.CreateVbo(VboKey, Vmm.ReadBytes(VbPosition, VbSize)); Gpu.Renderer.Rasterizer.CreateVbo(VboKey, Vmm.ReadBytes(VbPosition, VbSize));
} }
}
State.VertexBindings[Index].Enabled = true; State.VertexBindings[Index].Enabled = true;
State.VertexBindings[Index].Stride = Stride; State.VertexBindings[Index].Stride = Stride;
@ -887,9 +899,13 @@ namespace Ryujinx.Graphics.Graphics3d
//vertex of a quad, if it points to the middle of a //vertex of a quad, if it points to the middle of a
//quad (First % 4 != 0 for Quads) then it will not work properly. //quad (First % 4 != 0 for Quads) then it will not work properly.
if (PrimType == GalPrimitiveType.Quads) if (PrimType == GalPrimitiveType.Quads)
{
IndexFirst = QuadHelper.ConvertSizeQuadsToTris(IndexFirst); IndexFirst = QuadHelper.ConvertSizeQuadsToTris(IndexFirst);
}
else // QuadStrip else // QuadStrip
{
IndexFirst = QuadHelper.ConvertSizeQuadStripToTris(IndexFirst); IndexFirst = QuadHelper.ConvertSizeQuadStripToTris(IndexFirst);
}
PrimType = GalPrimitiveType.Triangles; PrimType = GalPrimitiveType.Triangles;
} }
@ -910,9 +926,13 @@ namespace Ryujinx.Graphics.Graphics3d
//vertex of a quad, if it points to the middle of a //vertex of a quad, if it points to the middle of a
//quad (First % 4 != 0 for Quads) then it will not work properly. //quad (First % 4 != 0 for Quads) then it will not work properly.
if (PrimType == GalPrimitiveType.Quads) if (PrimType == GalPrimitiveType.Quads)
{
VertexFirst = QuadHelper.ConvertSizeQuadsToTris(VertexFirst); VertexFirst = QuadHelper.ConvertSizeQuadsToTris(VertexFirst);
}
else // QuadStrip else // QuadStrip
{
VertexFirst = QuadHelper.ConvertSizeQuadStripToTris(VertexFirst); VertexFirst = QuadHelper.ConvertSizeQuadStripToTris(VertexFirst);
}
PrimType = GalPrimitiveType.Triangles; PrimType = GalPrimitiveType.Triangles;
VertexCount = QuadHelper.ConvertSizeQuadsToTris(VertexCount); VertexCount = QuadHelper.ConvertSizeQuadsToTris(VertexCount);