From c58cc76b394c57a97b7691e087a079f7dc421e52 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 10 Oct 2023 18:04:26 -0400 Subject: [PATCH] Dont set 0 attributes --- src/Ryujinx.Graphics.Metal/RenderEncoderState.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/RenderEncoderState.cs b/src/Ryujinx.Graphics.Metal/RenderEncoderState.cs index c712c96f3..82a2b1e42 100644 --- a/src/Ryujinx.Graphics.Metal/RenderEncoderState.cs +++ b/src/Ryujinx.Graphics.Metal/RenderEncoderState.cs @@ -105,15 +105,15 @@ namespace Ryujinx.Graphics.Metal public void UpdateVertexAttributes(ReadOnlySpan vertexAttribs) { - // Reset Vertex Descriptor - _vertexDescriptor.Reset(); - for (int i = 0; i < vertexAttribs.Length; i++) { - // TODO: Format should not be hardcoded - _vertexDescriptor.Attributes.Object((ulong)i).Format = MTLVertexFormat.Float4; - _vertexDescriptor.Attributes.Object((ulong)i).BufferIndex = (ulong)vertexAttribs[i].BufferIndex; - _vertexDescriptor.Attributes.Object((ulong)i).Offset = (ulong)vertexAttribs[i].Offset; + if (!vertexAttribs[i].IsZero) + { + // TODO: Format should not be hardcoded + _vertexDescriptor.Attributes.Object((ulong)i).Format = MTLVertexFormat.Float4; + _vertexDescriptor.Attributes.Object((ulong)i).BufferIndex = (ulong)vertexAttribs[i].BufferIndex; + _vertexDescriptor.Attributes.Object((ulong)i).Offset = (ulong)vertexAttribs[i].Offset; + } } }