mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-24 05:54:56 +03:00
Buffer Descriptor Step Functions
This commit is contained in:
parent
a42c66e6d5
commit
d811532a9f
@ -740,13 +740,26 @@ namespace Ryujinx.Graphics.Metal
|
|||||||
{
|
{
|
||||||
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;
|
layout.Stride = (indexMask & (1u << i)) != 0 ? (ulong)bufferDescriptors[i].Stride : 0;
|
||||||
|
|
||||||
|
if (bufferDescriptors[i].Divisor > 0)
|
||||||
|
{
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.PerInstance;
|
||||||
|
layout.StepRate = (ulong)bufferDescriptors[i].Divisor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.PerVertex;
|
||||||
|
layout.StepRate = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero buffer
|
// Zero buffer
|
||||||
if ((indexMask & (1u << bufferDescriptors.Length)) != 0)
|
if ((indexMask & (1u << bufferDescriptors.Length)) != 0)
|
||||||
{
|
{
|
||||||
var layout = vertexDescriptor.Layouts.Object((ulong)bufferDescriptors.Length);
|
var layout = vertexDescriptor.Layouts.Object((ulong)bufferDescriptors.Length);
|
||||||
layout.Stride = ZeroBufferSize;
|
layout.Stride = 1;
|
||||||
|
layout.StepFunction = MTLVertexStepFunction.Constant;
|
||||||
|
layout.StepRate = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return vertexDescriptor;
|
return vertexDescriptor;
|
||||||
|
Loading…
Reference in New Issue
Block a user