Пример #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();

                    for (int i = 0; i < swapChain.ImageCount; ++i)
                    {
                        frameBuffers[i]?.Dispose();
                    }

                    grPipeline.Dispose();
                    plCompute.Dispose();
                    plNormalize.Dispose();

                    dslCompute.Dispose();
                    dslImage.Dispose();

                    dsPool.Dispose();

                    inBuff.Dispose();
                    outBuff.Dispose();
                    stagingDataBuff.Dispose();

                    imgResult.Dispose();

                    dbgReport?.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Пример #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();
                    for (int i = 0; i < swapChain.ImageCount; ++i)
                    {
                        frameBuffers[i]?.Dispose();
                    }
                    model.Dispose();
                    pipeline.Dispose();
                    descLayoutMatrix.Dispose();
                    descLayoutTextures.Dispose();
                    descriptorPool.Dispose();

                    uboMats.Dispose();

                    vkvgSurf?.Dispose();
                    vkvgDev.Dispose();

                    timestampQPool.Dispose();
                    statPool.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Пример #3
0
        /// <summary>
        /// Release any resources used.
        /// </summary>
        protected override void dispose()
        {
            dispose(ref m_blobLocPred);
            dispose(ref m_blobLocGt);
            dispose(ref m_blobLocLoss);
            dispose(ref m_blobConfPred);
            dispose(ref m_blobConfGt);
            dispose(ref m_blobConfLoss);

            if (m_hSsd != 0)
            {
                m_cuda.FreeSSD(m_hSsd);
                m_hSsd = 0;
            }

            if (m_locLossLayer != null)
            {
                m_locLossLayer.Dispose();
                m_locLossLayer = null;
            }

            if (m_confLossLayer != null)
            {
                m_confLossLayer.Dispose();
                m_confLossLayer = null;
            }

            if (m_bboxUtil != null)
            {
                m_bboxUtil.Dispose();
                m_bboxUtil = null;
            }

            if (m_hostConf != null)
            {
                m_hostConf.Dispose();
                m_hostConf = null;
            }

            if (m_hostLoc != null)
            {
                m_hostLoc.Dispose();
                m_hostLoc = null;
            }

            if (m_hostGt != null)
            {
                m_hostGt.Dispose();
                m_hostGt = null;
            }

            if (m_hostPrio != null)
            {
                m_hostPrio.Dispose();
                m_hostPrio = null;
            }

            base.dispose();
        }
Пример #4
0
 public void EndStreaming()
 {
     if (Streamable && !isDirty)
     {
         Streamable = false;
         HostBuffer.Dispose();
         HostBuffer = null;
     }
 }
Пример #5
0
        protected override void Dispose(bool disposing)
        {
            model.Dispose();
            envCube.Dispose();

            descLayoutMain.Dispose();
            descLayoutTextures.Dispose();
            descriptorPool.Dispose();

            uboMats.Dispose();

            base.Dispose(disposing);
        }
Пример #6
0
        public void Dispose()
        {
            dev.WaitIdle();

            plCompute.Dispose();
            dsLayout.Dispose();
            dsPool.Dispose();

            inBuff.Dispose();
            outBuff.Dispose();

            dev.Dispose();
            instance.Dispose();
        }
Пример #7
0
        public void Dispose()
        {
            dev.WaitIdle();

            plCompute.Dispose();
            dsLayoutCompute.Dispose();
            dsPool.Dispose();

            inBuff.Dispose();
            outBuff.Dispose();

            dev.Dispose();

#if DEBUG
            dbgReport.Dispose();
#endif
            instance.Dispose();
        }
Пример #8
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();
                    pipeline.Dispose();
                    frameBuffers?.Dispose();
                    descriptorPool.Dispose();
                    texture.Dispose();
                    uboMats.Dispose();
                    vbo.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Пример #9
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();
                    for (int i = 0; i < swapChain.ImageCount; ++i)
                    {
                        frameBuffers[i]?.Dispose();
                    }

                    gbColorRough.Dispose();
                    gbEmitMetal.Dispose();
                    gbN.Dispose();
                    gbPos.Dispose();

                    gBuffPipeline.Dispose();
                    composePipeline.Dispose();

                    descLayoutMain.Dispose();
                    descLayoutModelTextures.Dispose();
                    descLayoutGBuff.Dispose();

                    uboMats.Dispose();
                    model.Dispose();
                    envCube.Dispose();

                    descriptorPool.Dispose();
#if DEBUG
                    foreach (Framebuffer fb in debugFB)
                    {
                        fb.Dispose();
                    }

                    debugDraw.Dispose();
                    timestampQPool?.Dispose();
                    statPool?.Dispose();
#endif
                }
            }

            base.Dispose(disposing);
        }
Пример #10
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();

                    for (int i = 0; i < swapChain.ImageCount; ++i)
                    {
                        frameBuffers[i]?.Dispose();
                    }

                    grPipeline.Dispose();
                    trianglesPipeline.Dispose();

                    plInit.Dispose();
                    plCompute.Dispose();
                    plNormalize.Dispose();

                    dslCompute.Dispose();
                    dslImage.Dispose();

                    dsPool.Dispose();

                    inBuff.Dispose();
                    outBuff.Dispose();
                    staggingVBO.Dispose();
                    vbo.Dispose();
                    ibo.Dispose();

                    imgResult.Dispose();

#if DEBUG
                    dbgReport.Dispose();
#endif
                }
            }

            base.Dispose(disposing);
        }
Пример #11
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (!isDisposed)
                {
                    dev.WaitIdle();
                    pipeline.Dispose();
                    dsLayout.Dispose();
                    for (int i = 0; i < swapChain.ImageCount; i++)
                    {
                        frameBuffers[i].Dispose();
                    }
                    descriptorPool.Dispose();
                    vbo.Dispose();
                    ibo.Dispose();
                    uboMats.Dispose();
                }
            }

            base.Dispose(disposing);
        }
Пример #12
0
        //clean up
        protected override void Dispose(bool disposing)
        {
            dev.WaitIdle();
            if (disposing)
            {
                if (!isDisposed)
                {
                    //pipeline clean up will dispose PipelineLayout, DescriptorSet layouts and render pass automatically. If their reference count is zero, their handles will be destroyed.
                    pipeline.Dispose();
                    //frame buffers are automatically activated on creation as for resources, so it requests an explicit call to dispose.
                    frameBuffers?.Dispose();
                    //the descriptor pool
                    descriptorPool.Dispose();
                    //resources have to be explicityly disposed.
                    vbo.Dispose();
                    ibo.Dispose();
                    uboMats.Dispose();
                }
            }

            base.Dispose(disposing);
        }