Exemplo n.º 1
0
        internal static void RemoveScreenResources()
        {
            if (m_resolvedLight != null)
            {
                m_resolvedLight.Release();
                m_reduce0.Release();
                m_reduce1.Release();
                m_uav3.Release();
                m_cloudLayerFogTargetUAV.Release();
                m_localLum.Release();
                m_div2.Release();
                m_div4.Release();
                m_div8.Release();
                m_div8_1.Release();
                m_rgba8_linear.Release();
                m_rgba8_0.Release();
                m_rgba8_1.Release();
                m_rgba8_2.Release();
                if (m_rgba8_ms != null)
                {
                    m_rgba8_ms.Release();
                    m_rgba8_ms = null;
                }
                m_prevLum.Release();

                MyRwTextures.Destroy(ref m_shadowsHelper);
                MyRwTextures.Destroy(ref m_shadowsHelper1);
                MyRwTextures.Destroy(ref m_gbuffer1Copy);
            }
        }
Exemplo n.º 2
0
        internal static void RemoveScreenResources()
        {
            if (m_reduce0 != null)
            {
                m_reduce0.Release();
                m_reduce1.Release();
                m_uav3.Release();
                HalfScreenUavHDR.Release();
                QuarterScreenUavHDR.Release();
                EighthScreenUavHDR.Release();
                EighthScreenUavHDRHelper.Release();
                m_rgba8_linear.Release();
                m_rgba8_0.Release();
                m_rgba8_1.Release();
                m_rgba8_2.Release();
                if (m_rgba8_ms != null)
                {
                    m_rgba8_ms.Release();
                    m_rgba8_ms = null;
                }
                m_prevLum.Release();
                m_transparencyAccum.Release();
                m_transparencyCoverage.Release();

                MyRwTextures.Destroy(ref PostProcessedShadows);
                MyRwTextures.Destroy(ref CascadesHelper);
                MyRwTextures.Destroy(ref m_gbuffer1Copy);
            }

            if (m_backbufferCopyResource != null)
            {
                m_backbufferCopyResource.Release();
                m_backbufferCopyResource = null;
            }

            if (m_lastScreenDataResource != null && m_lastScreenDataResource != Backbuffer)
            {
                m_lastScreenDataResource.Release();
                m_lastScreenDataResource = null;
            }

            if (m_lastDataStream != null)
            {
                m_lastDataStream.Dispose();
                m_lastDataStream = null;
            }
        }
Exemplo n.º 3
0
        internal static void RemoveScreenResources()
        {
            if (m_resolvedLight != null)
            {
                m_resolvedLight.Release();
                m_reduce0.Release();
                m_reduce1.Release();
                m_uav3.Release();
                m_localLum.Release();
                m_div2.Release();
                m_div4.Release();
                m_div8.Release();
                m_div8_1.Release();
                m_rgba8_linear.Release();
                m_rgba8_0.Release();
                m_rgba8_1.Release();
                m_prevLum.Release();

                MyRwTextures.Destroy(ref m_shadowsHelper);
                MyRwTextures.Destroy(ref m_shadowsHelper1);
            }
        }
Exemplo n.º 4
0
        internal static void Resize(int width, int height, int samplesNum, int samplesQuality)
        {
            if (m_resolvedDepth != null)
            {
                m_resolvedDepth.Release();
                m_particlesRT.Release();
                m_ambientOcclusion.Release();
                m_test.Release();
                m_tileIndexes.Release();
            }

            m_resolvedDepth    = new MyDepthStencil(width, height, 1, 0);
            m_particlesRT      = new MyRenderTarget(width, height, Format.R16G16B16A16_Float, 1, 0);
            m_ambientOcclusion = new MyRenderTarget(width, height, Format.R8G8B8A8_UNorm, 1, 0);
            m_test             = new MyUnorderedAccessTexture(width, height, Format.R8G8B8A8_UNorm);

            int tilesNum = ((width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE) * ((height + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE);

            TilesNum      = tilesNum;
            TilesX        = (width + MyLightRendering.TILE_SIZE - 1) / MyLightRendering.TILE_SIZE;
            m_tileIndexes = new MyRWStructuredBuffer(tilesNum + tilesNum * MyRender11Constants.MAX_POINT_LIGHTS, sizeof(uint));
        }