本文整理汇总了C++中LinearDiskCache::Sync方法的典型用法代码示例。如果您正苦于以下问题:C++ LinearDiskCache::Sync方法的具体用法?C++ LinearDiskCache::Sync怎么用?C++ LinearDiskCache::Sync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearDiskCache
的用法示例。
在下文中一共展示了LinearDiskCache::Sync方法的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();
}
示例2: Reload
void StateCache::Reload()
{
m_small_pso_map.clear();
s_pso_disk_cache.Sync();
s_pso_disk_cache.Close();
LoadFromDisk();
}
示例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();
}
示例4: Clear
void StateCache::Clear()
{
m_pso_map.clear();
m_small_pso_map.clear();
s_pso_disk_cache.Sync();
s_pso_disk_cache.Close();
}
示例5: Reload
void GeometryShaderCache::Reload()
{
g_gs_disk_cache.Sync();
g_gs_disk_cache.Close();
Clear();
if (g_ActiveConfig.bShaderCache)
LoadShaderCache();
}
示例6: 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();
}
示例7: Shutdown
void GeometryShaderCache::Shutdown()
{
D3D::commandListMgr->DestroyResourceAfterCurrentCommandListExecuted(gscbuf12);
ClearGeometryShaderBlob->Release();
CopyGeometryShaderBlob->Release();
Clear();
g_gs_disk_cache.Sync();
g_gs_disk_cache.Close();
}
示例8: Shutdown
void GeometryShaderCache::Shutdown()
{
SAFE_RELEASE(gscbuf);
SAFE_RELEASE(ClearGeometryShader);
SAFE_RELEASE(CopyGeometryShader);
Clear();
g_gs_disk_cache.Sync();
g_gs_disk_cache.Close();
}
示例9: 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;
}
示例10: 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();
}
示例11: 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();
}
示例12: 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;
}
示例13: 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();
}
示例14: 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;
}
}
示例15: Shutdown
void PixelShaderCache::Shutdown()
{
SAFE_RELEASE(pscbuf);
SAFE_RELEASE(s_ClearProgram);
for (int i = 0; i < 2; ++i)
{
SAFE_RELEASE(s_ColorCopyProgram[i]);
SAFE_RELEASE(s_ColorMatrixProgram[i]);
SAFE_RELEASE(s_DepthMatrixProgram[i]);
SAFE_RELEASE(s_rgba6_to_rgb8[i]);
SAFE_RELEASE(s_rgb8_to_rgba6[i]);
}
Clear();
g_ps_disk_cache.Sync();
g_ps_disk_cache.Close();
}