diff options
author | dsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 00:01:37 +0000 |
---|---|---|
committer | dsinclair@chromium.org <dsinclair@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 00:01:37 +0000 |
commit | e3932abb978b39d8b28db6e9b7d15869d817dad2 (patch) | |
tree | e86df2495c23edf37fb72c2e6b306ef0f0458c70 /gpu/command_buffer/service/program_cache.cc | |
parent | a11b00cf82c61489fe42878204375524fa2f952a (diff) | |
download | chromium_src-e3932abb978b39d8b28db6e9b7d15869d817dad2.zip chromium_src-e3932abb978b39d8b28db6e9b7d15869d817dad2.tar.gz chromium_src-e3932abb978b39d8b28db6e9b7d15869d817dad2.tar.bz2 |
Add per-profile disk caching of complied GPU shaders.
This CL adds a per-profile disk cache for any shaders that are
complied while using the profile. When the profile is first opened
the shaders will be loaded from disk and used to pre-populate the
GPU memory shader cache.
The disk cache takes the load time for From Dust from ~30 seconds
to ~18 seconds on my Linux machine for any loads after the first.
BUG=166763
Review URL: https://chromiumcodereview.appspot.com/12036056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/program_cache.cc')
-rw-r--r-- | gpu/command_buffer/service/program_cache.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc index 821b6e1..bc32dfc 100644 --- a/gpu/command_buffer/service/program_cache.cc +++ b/gpu/command_buffer/service/program_cache.cc @@ -39,7 +39,11 @@ void ProgramCache::ShaderCompilationSucceeded( char sha[kHashLength]; ComputeShaderHash(shader_src, sha); const std::string sha_string(sha, kHashLength); + ShaderCompilationSucceededSha(sha_string); +} +void ProgramCache::ShaderCompilationSucceededSha( + const std::string& sha_string) { CompileStatusMap::iterator it = shader_status_.find(sha_string); if (it == shader_status_.end()) { shader_status_[sha_string] = CompiledShaderInfo(COMPILATION_SUCCEEDED); |