예제 #1
0
TextureCache::TextureCache()
{
	temp_size = 2048 * 2048 * 4;
	if (!temp)
		temp = (u8*)AllocateAlignedMemory(temp_size, 16);
	TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
    if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
		HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
	SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
}
예제 #2
0
TextureCacheBase::TextureCacheBase()
{
	temp_size = 2048 * 2048 * 4;
	if (!temp)
		temp = (u8*)AllocateAlignedMemory(temp_size, 16);

	TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);

	HiresTexture::Init();

	SetHash64Function();
}
예제 #3
0
void TextureCacheBase::OnConfigChanged(VideoConfig& config)
{
	if (g_texture_cache)
	{
		// TODO: Invalidating texcache is really stupid in some of these cases
		if (config.iSafeTextureCache_ColorSamples != backup_config.s_colorsamples ||
			config.bTexFmtOverlayEnable != backup_config.s_texfmt_overlay ||
			config.bTexFmtOverlayCenter != backup_config.s_texfmt_overlay_center ||
			config.bHiresTextures != backup_config.s_hires_textures ||
			config.iTexScalingFactor != backup_config.s_scaling_factor ||
			config.iTexScalingType != backup_config.s_scaling_mode ||
			config.bTexDeposterize != backup_config.s_scaling_deposterize ||
			invalidate_texture_cache_requested)
		{
			g_texture_cache->Invalidate();

			TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);

			if (config.bHiresTextures != backup_config.s_hires_textures ||
				config.bCacheHiresTextures != backup_config.s_cache_hires_textures)
			{
				HiresTexture::Update();
				if (!config.bHiresTextures)
				{
					InvalidateHiresCache();
				}
			}
			invalidate_texture_cache_requested = false;
		}

		if ((config.iStereoMode > 0) != backup_config.s_stereo_3d ||
			config.bStereoEFBMonoDepth != backup_config.s_efb_mono_depth)
		{
			g_texture_cache->DeleteShaders();
			g_texture_cache->CompileShaders();
		}
	}

	backup_config.s_colorsamples = config.iSafeTextureCache_ColorSamples;
	backup_config.s_texfmt_overlay = config.bTexFmtOverlayEnable;
	backup_config.s_texfmt_overlay_center = config.bTexFmtOverlayCenter;
	backup_config.s_hires_textures = config.bHiresTextures;
	backup_config.s_cache_hires_textures = config.bCacheHiresTextures;
	backup_config.s_stereo_3d = config.iStereoMode > 0;
	backup_config.s_efb_mono_depth = config.bStereoEFBMonoDepth;
	backup_config.s_scaling_factor = config.iTexScalingFactor;
	backup_config.s_scaling_mode = config.iTexScalingType;
	backup_config.s_scaling_deposterize = config.bTexDeposterize;
}
예제 #4
0
TextureCacheBase::TextureCacheBase()
{
	temp_size = 2048 * 2048 * 4;
	if (!TextureCacheBase::temp)
		TextureCacheBase::temp = static_cast<u8*>(AllocateAlignedMemory(temp_size, 16));

	TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);

	HiresTexture::Init();

	SetHash64Function();
	texture_pool_memory_usage = 0;
	invalidate_texture_cache_requested = false;
	UnbindTextures();
}
예제 #5
0
void TextureCache::OnConfigChanged(VideoConfig& config)
{
	if (g_texture_cache)
	{
		// TODO: Invalidating texcache is really stupid in some of these cases
		if (config.iSafeTextureCache_ColorSamples != backup_config.s_colorsamples ||
			config.bTexFmtOverlayEnable != backup_config.s_texfmt_overlay ||
			config.bTexFmtOverlayCenter != backup_config.s_texfmt_overlay_center ||
			config.bHiresTextures != backup_config.s_hires_textures ||
			invalidate_texture_cache_requested)
		{
			g_texture_cache->Invalidate();

			if (g_ActiveConfig.bHiresTextures)
				HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID);

			SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
			TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);

			invalidate_texture_cache_requested = false;
		}

		// TODO: Probably shouldn't clear all render targets here, just mark them dirty or something.
		if (config.bEFBCopyCacheEnable != backup_config.s_copy_cache_enable || // TODO: not sure if this is needed?
			config.bCopyEFBToTexture != backup_config.s_copy_efb_to_texture ||
			config.bCopyEFBScaled != backup_config.s_copy_efb_scaled ||
			config.bEFBCopyEnable != backup_config.s_copy_efb ||
			config.iEFBScale != backup_config.s_efb_scale)
		{
			g_texture_cache->ClearRenderTargets();
		}
	}

	backup_config.s_colorsamples = config.iSafeTextureCache_ColorSamples;
	backup_config.s_copy_efb_to_texture = config.bCopyEFBToTexture;
	backup_config.s_copy_efb_scaled = config.bCopyEFBScaled;
	backup_config.s_copy_efb = config.bEFBCopyEnable;
	backup_config.s_efb_scale = config.iEFBScale;
	backup_config.s_texfmt_overlay = config.bTexFmtOverlayEnable;
	backup_config.s_texfmt_overlay_center = config.bTexFmtOverlayCenter;
	backup_config.s_hires_textures = config.bHiresTextures;
	backup_config.s_copy_cache_enable = config.bEFBCopyCacheEnable;
}