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

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

Issue 1261353003: gpu: Add ANGLE commit to program cache hash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix BUILD.gn Created 5 years, 5 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
« no previous file with comments | « gpu/command_buffer/service/BUILD.gn ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/program_cache.cc
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc
index 31802de2e0bb56f978cca3ec99f86a9cf045704a..ee1a736b9e09211be166be4acdc6a1a3e1485962 100644
--- a/gpu/command_buffer/service/program_cache.cc
+++ b/gpu/command_buffer/service/program_cache.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/memory/scoped_ptr.h"
#include "gpu/command_buffer/service/shader_manager.h"
+#include "third_party/angle/src/common/version.h"
namespace gpu {
namespace gles2 {
@@ -114,15 +115,18 @@ void ProgramCache::ComputeProgramHash(
char* result) const {
const size_t shader0_size = kHashLength;
const size_t shader1_size = kHashLength;
+ const size_t angle_commit_size = ANGLE_COMMIT_HASH_SIZE;
const size_t map_size = CalculateMapSize(bind_attrib_location_map);
const size_t var_size = CalculateVaryingsSize(transform_feedback_varyings);
- const size_t total_size = shader0_size + shader1_size + map_size + var_size
- + sizeof(transform_feedback_buffer_mode);
+ const size_t total_size = shader0_size + shader1_size + angle_commit_size
+ + map_size + var_size + sizeof(transform_feedback_buffer_mode);
scoped_ptr<unsigned char[]> buffer(new unsigned char[total_size]);
memcpy(buffer.get(), hashed_shader_0, shader0_size);
memcpy(&buffer[shader0_size], hashed_shader_1, shader1_size);
size_t current_pos = shader0_size + shader1_size;
+ memcpy(&buffer[current_pos], ANGLE_COMMIT_HASH, angle_commit_size);
+ current_pos += angle_commit_size;
if (map_size != 0) {
// copy our map
for (auto it = bind_attrib_location_map->begin();
« no previous file with comments | « gpu/command_buffer/service/BUILD.gn ('k') | gpu/command_buffer_service.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698