private void RunPendingDraws()
        {
            lock (PendingDrawQueue)
                if (PendingDrawQueue.Count == 0)
                {
                    return;
                }

            int        i  = 0;
            BatchGroup bg = null;

            while (true)
            {
                PendingDraw pd;
                lock (PendingDrawQueue) {
                    if (PendingDrawQueue.Count == 0)
                    {
                        return;
                    }
                    pd = PendingDrawQueue.DangerousGetItem(0);
                    PendingDrawQueue.DangerousRemoveAt(0);
                }

                ExceptionDispatchInfo excInfo = null;
                try {
                    if (!AutoRenderTarget.IsRenderTargetValid(pd.RenderTarget))
                    {
                        throw new Exception("Render target for pending draw was disposed between queue and prepare");
                    }

                    if (!DoSynchronousDrawToRenderTarget(pd.RenderTarget, pd.Materials, pd.Handler, pd.UserData, ref pd.ViewTransform, "Pending Draw"))
                    {
                        throw new Exception("Unknown failure performing pending draw");
                    }
                } catch (Exception exc) {
                    excInfo = ExceptionDispatchInfo.Capture(exc);
                }
                // throw new Exception("Unexpected error performing pending draw");

                if (pd.OnComplete != null)
                {
                    lock (CompletedPendingDrawQueue)
                        CompletedPendingDrawQueue.Add(new CompletedPendingDraw {
                            UserData     = pd.UserData,
                            Exception    = excInfo,
                            OnComplete   = pd.OnComplete,
                            RenderTarget = pd.RenderTarget
                        });
                }
                else if (excInfo != null)
                {
                }
                else
                {
                }
            }
        }