public bool Equals(PipelineStateDescription other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (!(RootSignature == other.RootSignature &&
                  EffectBytecode == other.EffectBytecode &&
                  BlendState.Equals(other.BlendState) &&
                  SampleMask == other.SampleMask &&
                  RasterizerState.Equals(other.RasterizerState) &&
                  DepthStencilState.Equals(other.DepthStencilState) &&
                  PrimitiveType == other.PrimitiveType &&
                  Output == other.Output))
            {
                return(false);
            }

            recheck : if (InputElements != null && other.InputElements != null)
            {
                if (InputElements.Length != other.InputElements.Length)
                {
                    return(false);
                }
                try
                {
                    for (int i = 0; i < InputElements.Length && i < other.InputElements.Length; i++)
                    {
                        if (!InputElements[i].Equals(other.InputElements[i]))
                        {
                            return(false);
                        }
                    }
                } catch (Exception e)
                {
                    // input elements changed during processing, which should be extremely rare
                    // but we don't want the engine to die, so lets just recheck
                    goto recheck;
                }
            }
            else if ((InputElements != null) != (other.InputElements != null))
            {
                return(false);
            }

            return(true);
        }
        public bool Equals(PipelineStateDescription other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (!(RootSignature == other.RootSignature &&
                  EffectBytecode == other.EffectBytecode &&
                  BlendState.Equals(other.BlendState) &&
                  SampleMask == other.SampleMask &&
                  RasterizerState.Equals(other.RasterizerState) &&
                  DepthStencilState.Equals(other.DepthStencilState) &&
                  PrimitiveType == other.PrimitiveType &&
                  Output == other.Output))
            {
                return(false);
            }

            if ((InputElements != null) != (other.InputElements != null))
            {
                return(false);
            }
            if (InputElements != null)
            {
                if (InputElements.Length != other.InputElements.Length)
                {
                    return(false);
                }
                for (int i = 0; i < InputElements.Length; ++i)
                {
                    if (!InputElements[i].Equals(other.InputElements[i]))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }