Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: gpu/command_buffer/service/memory_program_cache.cc

Issue 2744363002: Clear shader disk cache after glProgramBinary failure. (Closed)
Patch Set: Remove singleton and clean up init Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/memory_program_cache.cc
diff --git a/gpu/command_buffer/service/memory_program_cache.cc b/gpu/command_buffer/service/memory_program_cache.cc
index b24cbd7e42f74149e8d804f9ad973b165c91a95b..3b4fe79dd51682c7c2212114a6a18277a4da5230 100644
--- a/gpu/command_buffer/service/memory_program_cache.cc
+++ b/gpu/command_buffer/service/memory_program_cache.cc
@@ -12,6 +12,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
+#include "gpu/command_buffer/common/activity_flags.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/service/disk_cache_proto.pb.h"
#include "gpu/command_buffer/service/gl_utils.h"
@@ -211,14 +212,15 @@ bool ProgramBinaryExtensionsAvailable() {
MemoryProgramCache::MemoryProgramCache(
size_t max_cache_size_bytes,
bool disable_gpu_shader_disk_cache,
- bool disable_program_caching_for_transform_feedback)
+ bool disable_program_caching_for_transform_feedback,
+ GpuProcessActivityFlags* activity_flags)
: max_size_bytes_(max_cache_size_bytes),
disable_gpu_shader_disk_cache_(disable_gpu_shader_disk_cache),
disable_program_caching_for_transform_feedback_(
disable_program_caching_for_transform_feedback),
curr_size_bytes_(0),
- store_(ProgramMRUCache::NO_AUTO_EVICT) {
-}
+ store_(ProgramMRUCache::NO_AUTO_EVICT),
+ activity_flags_(activity_flags) {}
MemoryProgramCache::~MemoryProgramCache() {}
@@ -263,10 +265,14 @@ ProgramCache::ProgramLoadResult MemoryProgramCache::LoadLinkedProgram(
return PROGRAM_LOAD_FAILURE;
}
const scoped_refptr<ProgramCacheValue> value = found->second;
- glProgramBinary(program,
- value->format(),
- static_cast<const GLvoid*>(value->data()),
- value->length());
+
+ {
+ GpuProcessActivityFlags::ScopedSetFlag scoped_set_flag(
+ activity_flags_, ActivityFlagsBase::FLAG_LOADING_PROGRAM_BINARY);
+ glProgramBinary(program, value->format(),
+ static_cast<const GLvoid*>(value->data()), value->length());
+ }
+
GLint success = 0;
glGetProgramiv(program, GL_LINK_STATUS, &success);
if (success == GL_FALSE) {
« no previous file with comments | « gpu/command_buffer/service/memory_program_cache.h ('k') | gpu/command_buffer/service/memory_program_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698