Пример #1
0
CRenderTarget::~CRenderTarget	()
{
	_RELEASE(pFB);

	// Textures
	t_material->surface_set		(NULL);

#ifdef DEBUG
	_SHOW_REF					("t_material_surf",t_material_surf);
#endif // DEBUG
	_RELEASE					(t_material_surf);

	t_LUM_src->surface_set		(NULL);
	t_LUM_dest->surface_set		(NULL);

#ifdef DEBUG
	ID3DBaseTexture*	pSurf = 0;

	pSurf = t_envmap_0->surface_get();
	if (pSurf) pSurf->Release();
	_SHOW_REF("t_envmap_0 - #small",pSurf);

	pSurf = t_envmap_1->surface_get();
	if (pSurf) pSurf->Release();
	_SHOW_REF("t_envmap_1 - #small",pSurf);
	//_SHOW_REF("t_envmap_0 - #small",t_envmap_0->pSurface);
	//_SHOW_REF("t_envmap_1 - #small",t_envmap_1->pSurface);
#endif // DEBUG
	t_envmap_0->surface_set		(NULL);
	t_envmap_1->surface_set		(NULL);
	t_envmap_0.destroy			();
	t_envmap_1.destroy			();

	_RELEASE					(rt_smap_ZB);

	// Jitter
	for (int it=0; it<TEX_jitter_count; it++)	{
		t_noise	[it]->surface_set	(NULL);
#ifdef DEBUG
		_SHOW_REF("t_noise_surf[it]",t_noise_surf[it]);
#endif // DEBUG
		_RELEASE					(t_noise_surf[it]);
	}

	// 
	accum_spot_geom_destroy		();
	accum_omnip_geom_destroy	();
	accum_point_geom_destroy	();
	accum_volumetric_geom_destroy();

	// Blenders
	xr_delete					(b_combine				);
	xr_delete					(b_luminance			);
	xr_delete					(b_bloom				);
	xr_delete					(b_ssao					);
	xr_delete					(b_accum_reflected		);
	xr_delete					(b_accum_spot			);
	xr_delete					(b_accum_point			);
	xr_delete					(b_accum_direct			);
	xr_delete					(b_accum_mask			);
	xr_delete					(b_occq					);
}
Пример #2
0
CRenderTarget::~CRenderTarget	()
{
    _RELEASE					(t_ss_async);

    // Textures
    t_material->surface_set		(NULL);

#ifdef DEBUG
    _SHOW_REF					("t_material_surf",t_material_surf);
#endif // DEBUG
    _RELEASE					(t_material_surf);

    t_LUM_src->surface_set		(NULL);
    t_LUM_dest->surface_set		(NULL);

#ifdef DEBUG
    ID3DBaseTexture*	pSurf = 0;

    pSurf = t_envmap_0->surface_get();
    if (pSurf) pSurf->Release();
    _SHOW_REF("t_envmap_0 - #small",pSurf);

    pSurf = t_envmap_1->surface_get();
    if (pSurf) pSurf->Release();
    _SHOW_REF("t_envmap_1 - #small",pSurf);
    //_SHOW_REF("t_envmap_0 - #small",t_envmap_0->pSurface);
    //_SHOW_REF("t_envmap_1 - #small",t_envmap_1->pSurface);
#endif // DEBUG
    t_envmap_0->surface_set		(NULL);
    t_envmap_1->surface_set		(NULL);
    t_envmap_0.destroy			();
    t_envmap_1.destroy			();

    //	TODO: DX10: Check if we need old style SMAPs
//	_RELEASE					(rt_smap_ZB);

    // Jitter
    for (int it=0; it<TEX_jitter_count; it++)	{
        t_noise	[it]->surface_set	(NULL);
#ifdef DEBUG
        _SHOW_REF("t_noise_surf[it]",t_noise_surf[it]);
#endif // DEBUG
        _RELEASE					(t_noise_surf[it]);
    }

    t_noise_mipped->surface_set	(NULL);
#ifdef DEBUG
    _SHOW_REF("t_noise_surf_mipped",t_noise_surf_mipped);
#endif // DEBUG
    _RELEASE					(t_noise_surf_mipped);

    //
    accum_spot_geom_destroy		();
    accum_omnip_geom_destroy	();
    accum_point_geom_destroy	();
    accum_volumetric_geom_destroy();

    // Blenders
    xr_delete					(b_combine				);
    xr_delete					(b_luminance			);
    xr_delete					(b_bloom				);
    xr_delete					(b_accum_reflected		);
    xr_delete					(b_accum_spot			);
    xr_delete					(b_accum_point			);
    xr_delete					(b_accum_direct			);
    xr_delete					(b_ssao					);

    if( RImplementation.o.dx10_msaa )
    {
        int bound = RImplementation.o.dx10_msaa_samples;

        if( RImplementation.o.dx10_msaa_opt )
            bound = 1;

        for( int i = 0; i < bound; ++i )
        {
            xr_delete					(b_combine_msaa[i]);
            xr_delete					(b_accum_direct_msaa[i]);
            xr_delete					(b_accum_mask_msaa[i]);
            xr_delete					(b_accum_direct_volumetric_msaa[i]);
            //xr_delete					(b_accum_direct_volumetric_sun_msaa[i]);
            xr_delete					(b_accum_spot_msaa[i]);
            xr_delete					(b_accum_volumetric_msaa[i]);
            xr_delete					(b_accum_point_msaa[i]);
            xr_delete					(b_accum_reflected_msaa[i]);
            xr_delete					(b_ssao_msaa[i]);
        }
    }
    xr_delete					(b_accum_mask			);
    xr_delete					(b_occq					);
}