Esempio n. 1
0
//-----------------------------------------------------------------------------------------------
void Material::Disable()
{
	OpenGLRenderer::UseShaderProgram( 0 );
	UnbindTextures();

	OpenGLRenderer::DisableAttribArray( VERTEX_ATTRIB_POSITIONS );
	OpenGLRenderer::DisableAttribArray( VERTEX_ATTRIB_COLORS );
	OpenGLRenderer::DisableAttribArray( VERTEX_ATTRIB_TEX_COORDS );
	OpenGLRenderer::DisableAttribArray( VERTEX_ATTRIB_NORMALS );
	OpenGLRenderer::DisableAttribArray( VERTEX_ATTRIB_TANGENTS );
}
Esempio n. 2
0
void TextureCacheBase::Invalidate()
{
	UnbindTextures();
	TexCache::iterator iter = textures_by_address.begin();
	TexCache::iterator end = textures_by_address.end();
	while (iter != end)
	{
		iter = FreeTexture(iter);
	}
	textures_by_address.clear();
	textures_by_hash.clear();
}
Esempio n. 3
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();
}
Esempio n. 4
0
void TextureCache::Invalidate()
{
	UnbindTextures();

	for (auto& tex : textures_by_address)
	{
		delete tex.second;
	}
	textures_by_address.clear();
	textures_by_hash.clear();

	for (auto& rt : texture_pool)
	{
		delete rt.second;
	}
	texture_pool.clear();
}
Esempio n. 5
0
TextureCacheBase::~TextureCacheBase()
{
	HiresTexture::Shutdown();
	UnbindTextures();
	Invalidate();
	InvalidateHiresCache();
	for (auto& rt : texture_pool)
	{
		delete rt.second;
	}
	texture_pool.clear();
	texture_pool_memory_usage = 0;
	if (TextureCacheBase::temp)
	{
		FreeAlignedMemory(TextureCacheBase::temp);
		TextureCacheBase::temp = nullptr;
	}
}