mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-24 05:54:56 +03:00
Handle stride 0 on regular buffers
This commit is contained in:
parent
d811532a9f
commit
65da0569a3
@ -739,8 +739,19 @@ namespace Ryujinx.Graphics.Metal
|
|||||||
for (int i = 0; i < bufferDescriptors.Length; i++)
|
for (int i = 0; i < bufferDescriptors.Length; i++)
|
||||||
{
|
{
|
||||||
var layout = vertexDescriptor.Layouts.Object((ulong)i);
|
var layout = vertexDescriptor.Layouts.Object((ulong)i);
|
||||||
layout.Stride = (indexMask & (1u << i)) != 0 ? (ulong)bufferDescriptors[i].Stride : 0;
|
|
||||||
|
|
||||||
|
if ((indexMask & (1u << i)) != 0)
|
||||||
|
{
|
||||||
|
layout.Stride = (ulong)bufferDescriptors[i].Stride;
|
||||||
|
|
||||||
|
if (layout.Stride == 0)
|
||||||
|
{
|
||||||
|
layout.Stride = 1;
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.Constant;
|
||||||
|
layout.StepRate = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (bufferDescriptors[i].Divisor > 0)
|
if (bufferDescriptors[i].Divisor > 0)
|
||||||
{
|
{
|
||||||
layout.StepFunction = MTLVertexStepFunction.PerInstance;
|
layout.StepFunction = MTLVertexStepFunction.PerInstance;
|
||||||
@ -752,6 +763,12 @@ namespace Ryujinx.Graphics.Metal
|
|||||||
layout.StepRate = 1;
|
layout.StepRate = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
layout.Stride = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Zero buffer
|
// Zero buffer
|
||||||
if ((indexMask & (1u << bufferDescriptors.Length)) != 0)
|
if ((indexMask & (1u << bufferDescriptors.Length)) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user