//----------------------------------------------------------------------
        #region ** CustomEffect

        /// <summary>
        /// Creates any resources used repeatedly during subsequent rendering calls.
        /// </summary>
        public void Initialize(D2D.EffectContext effectContext, D2D.TransformGraph transformGraph)
        {
            if (_shaderBuffer == null)
            {
                Assembly asm = typeof(WarpEffect).Assembly;
                using (Stream stream = asm.GetManifestResourceStream("BitmapSamples.Resources.WarpEffect.cso"))
                {
                    int length = (int)stream.Length;
                    _shaderBuffer = new byte[length];
                    stream.Read(_shaderBuffer, 0, length);
                }
            }
            effectContext.LoadVertexShader(GUID_WarpVertexShader, _shaderBuffer);

            _vertexBuffer = effectContext.FindVertexBuffer(GUID_WarpVertexBuffer);
            if (_vertexBuffer == null)
            {
                using (var meshStream = GenerateMesh())
                {
                    var props     = new D2D.VertexBufferProperties(1, D2D.VertexUsage.Static, meshStream);
                    var desc      = new D2D.InputElement("MESH_POSITION", 0, DXGI.Format.R32G32_Float, 0, 0);
                    var custProps = new D2D.CustomVertexBufferProperties(_shaderBuffer, new D2D.InputElement[] { desc }, DXUtil.SizeOf <Vector2>());
                    _vertexBuffer = D2D.VertexBuffer.Create(effectContext, GUID_WarpVertexShader, props, custProps);
                }
            }

            transformGraph.SetSingleTransformNode(this);
        }
 /// <summary>
 /// The renderer calls this method to provide the effect implementation with a way to specify its transform graph and transform graph changes.
 /// It is executed when: 1) When the effect is first initialized. 2) If the number of inputs to the effect changes.
 /// </summary>
 public int SetGraph(D2D.TransformGraph transformGraph)
 {
     return(HResult.NotImplemented.Code);
 }