当前位置: 首页>>代码示例>>C++>>正文


C++ LinearDiskCache::Close方法代码示例

本文整理汇总了C++中LinearDiskCache::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ LinearDiskCache::Close方法的具体用法?C++ LinearDiskCache::Close怎么用?C++ LinearDiskCache::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LinearDiskCache的用法示例。


在下文中一共展示了LinearDiskCache::Close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Shutdown

void ShaderCache::Shutdown()
{
  Clear();

  s_gs_disk_cache.Sync();
  s_gs_disk_cache.Close();
  s_ps_disk_cache.Sync();
  s_ps_disk_cache.Close();
  s_vs_disk_cache.Sync();
  s_vs_disk_cache.Close();
}
开发者ID:jloehr,项目名称:dolphin,代码行数:11,代码来源:ShaderCache.cpp

示例2: LoadFromDisk

void StateCache::LoadFromDisk()
{
  std::string cache_filename = GetDiskShaderCacheFileName(API_D3D11, "pso", true, true);

  PipelineStateCacheInserter inserter;
  s_pso_disk_cache.OpenAndRead(cache_filename, inserter);

  if (s_cache_is_corrupted)
  {
    // If a PSO fails to create, that means either:
    // - The file itself is corrupt.
    // - A driver/HW change has occured, causing the existing cache blobs to be invalid.
    // 
    // In either case, we want to re-create the disk cache. This should not be a frequent occurence.

    s_pso_disk_cache.Close();

    s_gx_state_cache.m_small_pso_map.clear();

    File::Delete(cache_filename);

    s_pso_disk_cache.OpenAndRead(cache_filename, inserter);

    s_cache_is_corrupted = false;
  }
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:26,代码来源:D3DState.cpp

示例3: Reload

void VertexShaderCache::Reload()
{
  g_async_compiler->WaitUntilCompletion();
  g_async_compiler->RetrieveWorkItems();

  g_vs_disk_cache.Sync();
  g_vs_disk_cache.Close();
  g_uber_vs_disk_cache.Sync();
  g_uber_vs_disk_cache.Close();
  Clear();

  if (g_ActiveConfig.bShaderCache)
    LoadShaderCache();

  if (g_ActiveConfig.CanPrecompileUberShaders())
    QueueUberShaderCompiles();
}
开发者ID:t27duck,项目名称:dolphin,代码行数:17,代码来源:VertexShaderCache.cpp

示例4: Clear

void StateCache::Clear()
{
  m_pso_map.clear();
  m_small_pso_map.clear();

  s_pso_disk_cache.Sync();
  s_pso_disk_cache.Close();
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:8,代码来源:D3DState.cpp

示例5: Reload

void StateCache::Reload()
{
  m_small_pso_map.clear();

  s_pso_disk_cache.Sync();
  s_pso_disk_cache.Close();
  LoadFromDisk();
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:8,代码来源:D3DState.cpp

示例6: Reload

void GeometryShaderCache::Reload()
{
  g_gs_disk_cache.Sync();
  g_gs_disk_cache.Close();
  Clear();

  if (g_ActiveConfig.bShaderCache)
    LoadShaderCache();
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:9,代码来源:GeometryShaderCache.cpp

示例7: Shutdown

void GeometryShaderCache::Shutdown()
{
	D3D::commandListMgr->DestroyResourceAfterCurrentCommandListExecuted(gscbuf12);
	ClearGeometryShaderBlob->Release();
	CopyGeometryShaderBlob->Release();

	Clear();
	g_gs_disk_cache.Sync();
	g_gs_disk_cache.Close();
}
开发者ID:hdcmeta,项目名称:dolphin,代码行数:10,代码来源:GeometryShaderCache.cpp

示例8: Shutdown

void VertexShaderCache::Shutdown()
{
  g_async_compiler->StopWorkerThreads();
  g_async_compiler->RetrieveWorkItems();

  SAFE_RELEASE(vscbuf);

  SAFE_RELEASE(SimpleVertexShader);
  SAFE_RELEASE(ClearVertexShader);

  SAFE_RELEASE(SimpleLayout);
  SAFE_RELEASE(ClearLayout);

  Clear();
  g_vs_disk_cache.Sync();
  g_vs_disk_cache.Close();
  g_uber_vs_disk_cache.Sync();
  g_uber_vs_disk_cache.Close();
}
开发者ID:t27duck,项目名称:dolphin,代码行数:19,代码来源:VertexShaderCache.cpp

示例9: Shutdown

void GeometryShaderCache::Shutdown()
{
	SAFE_RELEASE(gscbuf);

	SAFE_RELEASE(ClearGeometryShader);
	SAFE_RELEASE(CopyGeometryShader);

	Clear();
	g_gs_disk_cache.Sync();
	g_gs_disk_cache.Close();
}
开发者ID:Abrahamh08,项目名称:dolphin,代码行数:11,代码来源:GeometryShaderCache.cpp

示例10: Shutdown

void ProgramShaderCache::Shutdown()
{
	// store all shaders in cache on disk
	if (g_ogl_config.bSupportsGLSLCache && !g_Config.bEnableShaderDebugging)
	{
		for (auto& entry : pshaders)
		{
			// Clear any prior error code
			glGetError();

			if (entry.second.in_cache)
			{
				continue;
			}

			GLint link_status = GL_FALSE, delete_status = GL_TRUE, binary_size = 0;
			glGetProgramiv(entry.second.shader.glprogid, GL_LINK_STATUS, &link_status);
			glGetProgramiv(entry.second.shader.glprogid, GL_DELETE_STATUS, &delete_status);
			glGetProgramiv(entry.second.shader.glprogid, GL_PROGRAM_BINARY_LENGTH, &binary_size);
			if (glGetError() != GL_NO_ERROR || link_status == GL_FALSE || delete_status == GL_TRUE || !binary_size)
			{
				continue;
			}

			std::vector<u8> data(binary_size + sizeof(GLenum));
			u8* binary = &data[sizeof(GLenum)];
			GLenum* prog_format = (GLenum*)&data[0];
			glGetProgramBinary(entry.second.shader.glprogid, binary_size, nullptr, prog_format, binary);
			if (glGetError() != GL_NO_ERROR)
			{
				continue;
			}

			g_program_disk_cache.Append(entry.first, &data[0], binary_size + sizeof(GLenum));
		}

		g_program_disk_cache.Sync();
		g_program_disk_cache.Close();
	}

	glUseProgram(0);

	for (auto& entry : pshaders)
	{
		entry.second.Destroy();
	}
	pshaders.clear();

	pixel_uid_checker.Invalidate();
	vertex_uid_checker.Invalidate();

	delete s_buffer;
	s_buffer = nullptr;
}
开发者ID:dragonbane0,项目名称:dolphin,代码行数:54,代码来源:ProgramShaderCache.cpp

示例11: Shutdown

void VertexShaderCache::Shutdown()
{
  SAFE_RELEASE(vscbuf);

  SAFE_RELEASE(SimpleVertexShader);
  SAFE_RELEASE(ClearVertexShader);

  SAFE_RELEASE(SimpleLayout);
  SAFE_RELEASE(ClearLayout);

  Clear();
  g_vs_disk_cache.Sync();
  g_vs_disk_cache.Close();
}
开发者ID:E2xD,项目名称:dolphin,代码行数:14,代码来源:VertexShaderCache.cpp

示例12: Clear

void StateCache::Clear()
{
	for (auto& it : m_pso_map)
	{
		SAFE_RELEASE(it.second);
	}
	m_pso_map.clear();

	for (auto& it : m_small_pso_map)
	{
		SAFE_RELEASE(it.second);
	}
	m_small_pso_map.clear();

	s_pso_disk_cache.Sync();
	s_pso_disk_cache.Close();
}
开发者ID:Lionel07,项目名称:dolphin,代码行数:17,代码来源:D3DState.cpp

示例13: Shutdown

void ProgramShaderCache::Shutdown()
{
	// store all shaders in cache on disk
	if (g_ogl_config.bSupportsGLSLCache && !g_Config.bEnableShaderDebugging)
	{
		for (auto& entry : pshaders)
		{
			if (entry.second.in_cache)
			{
				continue;
			}

			GLint binary_size;
			glGetProgramiv(entry.second.shader.glprogid, GL_PROGRAM_BINARY_LENGTH, &binary_size);
			if (!binary_size)
			{
				continue;
			}

			u8 *data = new u8[binary_size+sizeof(GLenum)];
			u8 *binary = data + sizeof(GLenum);
			GLenum *prog_format = (GLenum*)data;
			glGetProgramBinary(entry.second.shader.glprogid, binary_size, nullptr, prog_format, binary);

			g_program_disk_cache.Append(entry.first, data, binary_size+sizeof(GLenum));
			delete [] data;
		}

		g_program_disk_cache.Sync();
		g_program_disk_cache.Close();
	}

	glUseProgram(0);

	for (auto& entry : pshaders)
	{
		entry.second.Destroy();
	}
	pshaders.clear();

	pixel_uid_checker.Invalidate();
	vertex_uid_checker.Invalidate();

	delete s_buffer;
	s_buffer = nullptr;
}
开发者ID:Blackbird88,项目名称:dolphin,代码行数:46,代码来源:ProgramShaderCache.cpp

示例14: Shutdown

void VertexShaderCache::Shutdown()
{
	for (int i = 0; i < MAX_SSAA_SHADERS; i++)
	{
		if (SimpleVertexShader[i])
			SimpleVertexShader[i]->Release();
		SimpleVertexShader[i] = NULL;
	}

	if (ClearVertexShader)
		ClearVertexShader->Release();
	ClearVertexShader = NULL;
	
	Clear();
	g_vs_disk_cache.Sync();
	g_vs_disk_cache.Close();
}
开发者ID:NullNoname,项目名称:dolphin,代码行数:17,代码来源:VertexShaderCache.cpp

示例15: Shutdown

void ProgramShaderCache::Shutdown(void)
{
	// store all shaders in cache on disk
	if (g_ogl_config.bSupportsGLSLCache)
	{
		PCache::iterator iter = pshaders.begin();
		for (; iter != pshaders.end(); ++iter)
		{
			if(iter->second.in_cache) continue;
			
			GLint binary_size;
			glGetProgramiv(iter->second.shader.glprogid, GL_PROGRAM_BINARY_LENGTH, &binary_size);
			if(!binary_size) continue;
			
			u8 *data = new u8[binary_size+sizeof(GLenum)];
			u8 *binary = data + sizeof(GLenum);
			GLenum *prog_format = (GLenum*)data;
			glGetProgramBinary(iter->second.shader.glprogid, binary_size, NULL, prog_format, binary);
			
			g_program_disk_cache.Append(iter->first, data, binary_size+sizeof(GLenum));
			delete [] data;
		}

		g_program_disk_cache.Sync();
		g_program_disk_cache.Close();
	}

	glUseProgram(0);
	
	PCache::iterator iter = pshaders.begin();
	for (; iter != pshaders.end(); ++iter)
		iter->second.Destroy();
	pshaders.clear();

	pixel_uid_checker.Invalidate();
	vertex_uid_checker.Invalidate();

	if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
	{
		delete s_buffer;
		s_buffer = 0;
		delete [] s_ubo_buffer;
		s_ubo_buffer = 0;
	}
}
开发者ID:Max-E,项目名称:dolphin-emu,代码行数:45,代码来源:ProgramShaderCache.cpp


注:本文中的LinearDiskCache::Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。