public bool Equals(ref PipelineUid other) { if (!Unsafe.As <ulong, Vector256 <byte> >(ref Id0).Equals(Unsafe.As <ulong, Vector256 <byte> >(ref other.Id0)) || !Unsafe.As <ulong, Vector256 <byte> >(ref Id4).Equals(Unsafe.As <ulong, Vector256 <byte> >(ref other.Id4)) || !Unsafe.As <ulong, Vector256 <byte> >(ref Id8).Equals(Unsafe.As <ulong, Vector256 <byte> >(ref other.Id8))) { return(false); } if (!SequenceEqual <VertexInputAttributeDescription>(VertexAttributeDescriptions.AsSpan(), other.VertexAttributeDescriptions.AsSpan(), VertexAttributeDescriptionsCount)) { return(false); } if (!SequenceEqual <VertexInputBindingDescription>(VertexBindingDescriptions.AsSpan(), other.VertexBindingDescriptions.AsSpan(), VertexBindingDescriptionsCount)) { return(false); } if (!SequenceEqual <PipelineColorBlendAttachmentState>(ColorBlendAttachmentState.AsSpan(), other.ColorBlendAttachmentState.AsSpan(), ColorBlendAttachmentStateCount)) { return(false); } if (!SequenceEqual <Format>(AttachmentFormats.AsSpan(), other.AttachmentFormats.AsSpan(), ColorBlendAttachmentStateCount + (HasDepthStencil ? 1u : 0u))) { return(false); } return(true); }
/// <summary> /// Gets a span of the <see cref="VaryingLocations"/>. /// </summary> /// <returns>Span of varying locations</returns> public ReadOnlySpan <byte> AsSpan() { return(MemoryMarshal.Cast <uint, byte>(VaryingLocations.AsSpan()).Slice(0, Math.Min(128, VaryingCount))); }
public void SetVertexAttribs(ReadOnlySpan <VertexAttribDescriptor> vertexAttribs) { VertexAttribCount = vertexAttribs.Length; vertexAttribs.CopyTo(VertexAttribs.AsSpan()); }