Disable shader disk cache by default.

The code to handle cache clearing didn't land in time for the M27
branch so it has been decided to disable this feature for M27.

This patch will be rolled back after it lands on the M27 branch.

BUG=228989


Review URL: https://chromiumcodereview.appspot.com/13800013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192949 0039d316-1c4b-4281-b951-d872f2087c98
parent 66b6f321
......@@ -76,7 +76,7 @@ std::string DeriveCommandLine(const GURL& start_url,
::switches::kDisableBrowserPluginCompositing,
::switches::kDisableEncryptedMedia,
::switches::kDisableForceCompositingMode,
::switches::kDisableGpuShaderDiskCache,
::switches::kEnableGpuShaderDiskCache,
::switches::kDisableGpuWatchdog,
::switches::kDisableLoginAnimations,
::switches::kDisableOobeAnimation,
......
......@@ -756,8 +756,8 @@ void GpuProcessHost::EstablishGpuChannel(
callback.Run(IPC::ChannelHandle(), GPUInfo());
}
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGpuShaderDiskCache)) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGpuShaderDiskCache)) {
CreateChannelCache(client_id, gpu::kDefaultMaxProgramCacheMemoryBytes);
}
}
......
......@@ -60,7 +60,7 @@ const char kGpuProgramCacheSizeKb[] = "gpu-program-cache-size-kb";
const char kTraceGL[] = "trace-gl";
// Disables the GPU shader on disk cache.
const char kDisableGpuShaderDiskCache[] = "disable-gpu-shader-disk-cache";
const char kEnableGpuShaderDiskCache[] = "enable-gpu-shader-disk-cache";
const char* kGpuSwitches[] = {
kCompileShaderAlwaysSucceeds,
......@@ -79,7 +79,7 @@ const char* kGpuSwitches[] = {
kGpuDriverBugWorkarounds,
kGpuProgramCacheSizeKb,
kTraceGL,
kDisableGpuShaderDiskCache,
kEnableGpuShaderDiskCache,
};
const int kNumGpuSwitches = arraysize(kGpuSwitches);
......
......@@ -27,7 +27,7 @@ GPU_EXPORT extern const char kForceSynchronousGLReadPixels[];
GPU_EXPORT extern const char kGpuDriverBugWorkarounds[];
GPU_EXPORT extern const char kGpuProgramCacheSizeKb[];
GPU_EXPORT extern const char kTraceGL[];
GPU_EXPORT extern const char kDisableGpuShaderDiskCache[];
GPU_EXPORT extern const char kEnableGpuShaderDiskCache[];
GPU_EXPORT extern const char* kGpuSwitches[];
GPU_EXPORT extern const int kNumGpuSwitches;
......
......@@ -179,8 +179,8 @@ void MemoryProgramCache::SaveLinkedProgram(
}
if (!shader_callback.is_null() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableGpuShaderDiskCache)) {
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGpuShaderDiskCache)) {
std::string key;
base::Base64Encode(sha_string, &key);
......
......@@ -204,37 +204,6 @@ TEST_F(MemoryProgramCacheTest, CacheSave) {
*vertex_shader_->deferred_compilation_source(),
*fragment_shader_->deferred_compilation_source(),
NULL));
EXPECT_EQ(1, shader_cache_count());
}
TEST_F(MemoryProgramCacheTest, LoadProgram) {
const GLenum kFormat = 1;
const int kProgramId = 10;
const int kBinaryLength = 20;
char test_binary[kBinaryLength];
for (int i = 0; i < kBinaryLength; ++i) {
test_binary[i] = i;
}
ProgramBinaryEmulator emulator(kBinaryLength, kFormat, test_binary);
SetExpectationsForSaveLinkedProgram(kProgramId, &emulator);
cache_->SaveLinkedProgram(kProgramId, vertex_shader_, fragment_shader_, NULL,
base::Bind(&MemoryProgramCacheTest::ShaderCacheCb,
base::Unretained(this)));
EXPECT_EQ(ProgramCache::LINK_SUCCEEDED, cache_->GetLinkedProgramStatus(
*vertex_shader_->deferred_compilation_source(),
*fragment_shader_->deferred_compilation_source(),
NULL));
EXPECT_EQ(1, shader_cache_count());
cache_->Clear();
cache_->LoadProgram(shader_cache_shader());
EXPECT_EQ(ProgramCache::LINK_SUCCEEDED, cache_->GetLinkedProgramStatus(
*vertex_shader_->deferred_compilation_source(),
*fragment_shader_->deferred_compilation_source(),
NULL));
}
TEST_F(MemoryProgramCacheTest, CacheLoadMatchesSave) {
......@@ -251,7 +220,6 @@ TEST_F(MemoryProgramCacheTest, CacheLoadMatchesSave) {
cache_->SaveLinkedProgram(kProgramId, vertex_shader_, fragment_shader_, NULL,
base::Bind(&MemoryProgramCacheTest::ShaderCacheCb,
base::Unretained(this)));
EXPECT_EQ(1, shader_cache_count());
VariableMap vertex_attrib_map = vertex_shader_->attrib_map();
VariableMap vertex_uniform_map = vertex_shader_->uniform_map();
......@@ -295,7 +263,6 @@ TEST_F(MemoryProgramCacheTest, LoadProgramMatchesSave) {
cache_->SaveLinkedProgram(kProgramId, vertex_shader_, fragment_shader_, NULL,
base::Bind(&MemoryProgramCacheTest::ShaderCacheCb,
base::Unretained(this)));
EXPECT_EQ(1, shader_cache_count());
VariableMap vertex_attrib_map = vertex_shader_->attrib_map();
VariableMap vertex_uniform_map = vertex_shader_->uniform_map();
......@@ -309,9 +276,6 @@ TEST_F(MemoryProgramCacheTest, LoadProgramMatchesSave) {
SetExpectationsForLoadLinkedProgram(kProgramId, &emulator);
cache_->Clear();
cache_->LoadProgram(shader_cache_shader());
EXPECT_EQ(ProgramCache::PROGRAM_LOAD_SUCCESS, cache_->LoadLinkedProgram(
kProgramId,
vertex_shader_,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment