Handle stride 0 on regular buffers
This commit is contained in:
parent
65149cfe9f
commit
131ab75d55
1 changed files with 23 additions and 6 deletions
|
@ -739,17 +739,34 @@ 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 (bufferDescriptors[i].Divisor > 0)
|
if ((indexMask & (1u << i)) != 0)
|
||||||
{
|
{
|
||||||
layout.StepFunction = MTLVertexStepFunction.PerInstance;
|
layout.Stride = (ulong)bufferDescriptors[i].Stride;
|
||||||
layout.StepRate = (ulong)bufferDescriptors[i].Divisor;
|
|
||||||
|
if (layout.Stride == 0)
|
||||||
|
{
|
||||||
|
layout.Stride = 1;
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.Constant;
|
||||||
|
layout.StepRate = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (bufferDescriptors[i].Divisor > 0)
|
||||||
|
{
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.PerInstance;
|
||||||
|
layout.StepRate = (ulong)bufferDescriptors[i].Divisor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.PerVertex;
|
||||||
|
layout.StepRate = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
layout.StepFunction = MTLVertexStepFunction.PerVertex;
|
layout.Stride = 0;
|
||||||
layout.StepRate = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue