示例#1
0
        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);
        }
示例#2
0
 /// <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)));
 }
示例#3
0
 public void SetVertexAttribs(ReadOnlySpan <VertexAttribDescriptor> vertexAttribs)
 {
     VertexAttribCount = vertexAttribs.Length;
     vertexAttribs.CopyTo(VertexAttribs.AsSpan());
 }