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

Side by Side Diff: gpu/command_buffer/service/program_manager.cc

Issue 619723008: Switch to use ANGLE's new APIs to query shader variables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win build fix Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/program_manager.h" 5 #include "gpu/command_buffer/service/program_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h"
18 #include "base/time/time.h" 19 #include "base/time/time.h"
19 #include "gpu/command_buffer/common/gles2_cmd_format.h" 20 #include "gpu/command_buffer/common/gles2_cmd_format.h"
20 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 21 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
21 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 22 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
22 #include "gpu/command_buffer/service/gpu_switches.h" 23 #include "gpu/command_buffer/service/gpu_switches.h"
23 #include "gpu/command_buffer/service/program_cache.h" 24 #include "gpu/command_buffer/service/program_cache.h"
24 #include "gpu/command_buffer/service/shader_manager.h" 25 #include "gpu/command_buffer/service/shader_manager.h"
25 #include "gpu/command_buffer/service/shader_translator.h" 26 #include "gpu/command_buffer/service/shader_translator.h"
26 #include "third_party/re2/re2/re2.h" 27 #include "third_party/re2/re2/re2.h"
27 28
28 using base::TimeDelta; 29 using base::TimeDelta;
29 using base::TimeTicks; 30 using base::TimeTicks;
30 31
31 namespace gpu { 32 namespace gpu {
32 namespace gles2 { 33 namespace gles2 {
33 34
34 namespace { 35 namespace {
35 36
36 struct UniformType {
37 explicit UniformType(const ShaderTranslator::VariableInfo uniform)
38 : type(uniform.type),
39 size(uniform.size),
40 precision(uniform.precision) { }
41
42 UniformType()
43 : type(0),
44 size(0),
45 precision(SH_PRECISION_MEDIUMP) { }
46
47 bool operator==(const UniformType& other) const {
48 return type == other.type &&
49 size == other.size &&
50 precision == other.precision;
51 }
52
53 int type;
54 int size;
55 int precision;
56 };
57
58 int ShaderTypeToIndex(GLenum shader_type) { 37 int ShaderTypeToIndex(GLenum shader_type) {
59 switch (shader_type) { 38 switch (shader_type) {
60 case GL_VERTEX_SHADER: 39 case GL_VERTEX_SHADER:
61 return 0; 40 return 0;
62 case GL_FRAGMENT_SHADER: 41 case GL_FRAGMENT_SHADER:
63 return 1; 42 return 1;
64 default: 43 default:
65 NOTREACHED(); 44 NOTREACHED();
66 return 0; 45 return 0;
67 } 46 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 scoped_ptr<char[]> name_buffer(new char[max_len]); 361 scoped_ptr<char[]> name_buffer(new char[max_len]);
383 for (GLint ii = 0; ii < num_attribs; ++ii) { 362 for (GLint ii = 0; ii < num_attribs; ++ii) {
384 GLsizei length = 0; 363 GLsizei length = 0;
385 GLsizei size = 0; 364 GLsizei size = 0;
386 GLenum type = 0; 365 GLenum type = 0;
387 glGetActiveAttrib( 366 glGetActiveAttrib(
388 service_id_, ii, max_len, &length, &size, &type, name_buffer.get()); 367 service_id_, ii, max_len, &length, &size, &type, name_buffer.get());
389 DCHECK(max_len == 0 || length < max_len); 368 DCHECK(max_len == 0 || length < max_len);
390 DCHECK(length == 0 || name_buffer[length] == '\0'); 369 DCHECK(length == 0 || name_buffer[length] == '\0');
391 if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) { 370 if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) {
392 std::string name;
393 std::string original_name; 371 std::string original_name;
394 GetCorrectedVariableInfo( 372 GetVertexAttribData(name_buffer.get(), &original_name, &type);
395 false, name_buffer.get(), &name, &original_name, &size, &type);
396 // TODO(gman): Should we check for error? 373 // TODO(gman): Should we check for error?
397 GLint location = glGetAttribLocation(service_id_, name_buffer.get()); 374 GLint location = glGetAttribLocation(service_id_, name_buffer.get());
398 if (location > max_location) { 375 if (location > max_location) {
399 max_location = location; 376 max_location = location;
400 } 377 }
401 attrib_infos_.push_back( 378 attrib_infos_.push_back(
402 VertexAttrib(size, type, original_name, location)); 379 VertexAttrib(1, type, original_name, location));
403 max_attrib_name_length_ = std::max( 380 max_attrib_name_length_ = std::max(
404 max_attrib_name_length_, static_cast<GLsizei>(original_name.size())); 381 max_attrib_name_length_, static_cast<GLsizei>(original_name.size()));
405 } 382 }
406 } 383 }
407 384
408 // Create attrib location to index map. 385 // Create attrib location to index map.
409 attrib_location_to_index_map_.resize(max_location + 1); 386 attrib_location_to_index_map_.resize(max_location + 1);
410 for (GLint ii = 0; ii <= max_location; ++ii) { 387 for (GLint ii = 0; ii <= max_location; ++ii) {
411 attrib_location_to_index_map_[ii] = -1; 388 attrib_location_to_index_map_[ii] = -1;
412 } 389 }
(...skipping 27 matching lines...) Expand all
440 for (GLint ii = 0; ii < num_uniforms; ++ii) { 417 for (GLint ii = 0; ii < num_uniforms; ++ii) {
441 GLsizei length = 0; 418 GLsizei length = 0;
442 UniformData data; 419 UniformData data;
443 glGetActiveUniform( 420 glGetActiveUniform(
444 service_id_, ii, max_len, &length, 421 service_id_, ii, max_len, &length,
445 &data.size, &data.type, name_buffer.get()); 422 &data.size, &data.type, name_buffer.get());
446 DCHECK(max_len == 0 || length < max_len); 423 DCHECK(max_len == 0 || length < max_len);
447 DCHECK(length == 0 || name_buffer[length] == '\0'); 424 DCHECK(length == 0 || name_buffer[length] == '\0');
448 if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) { 425 if (!ProgramManager::IsInvalidPrefix(name_buffer.get(), length)) {
449 data.queried_name = std::string(name_buffer.get()); 426 data.queried_name = std::string(name_buffer.get());
450 GetCorrectedVariableInfo( 427 GetCorrectedUniformData(
451 true, name_buffer.get(), &data.corrected_name, &data.original_name, 428 data.queried_name,
452 &data.size, &data.type); 429 &data.corrected_name, &data.original_name, &data.size, &data.type);
453 uniform_data.push_back(data); 430 uniform_data.push_back(data);
454 } 431 }
455 } 432 }
456 433
457 // NOTE: We don't care if 2 uniforms are bound to the same location. 434 // NOTE: We don't care if 2 uniforms are bound to the same location.
458 // One of them will take preference. The spec allows this, same as 435 // One of them will take preference. The spec allows this, same as
459 // BindAttribLocation. 436 // BindAttribLocation.
460 // 437 //
461 // The reason we don't check is if we were to fail we'd have to 438 // The reason we don't check is if we were to fail we'd have to
462 // restore the previous program but since we've already linked successfully 439 // restore the previous program but since we've already linked successfully
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 element_index != 0) { 727 element_index != 0) {
751 return false; 728 return false;
752 } 729 }
753 730
754 bind_uniform_location_map_[short_name] = location; 731 bind_uniform_location_map_[short_name] = location;
755 return true; 732 return true;
756 } 733 }
757 734
758 // Note: This is only valid to call right after a program has been linked 735 // Note: This is only valid to call right after a program has been linked
759 // successfully. 736 // successfully.
760 void Program::GetCorrectedVariableInfo( 737 void Program::GetCorrectedUniformData(
761 bool use_uniforms, 738 const std::string& name,
762 const std::string& name, std::string* corrected_name, 739 std::string* corrected_name, std::string* original_name,
763 std::string* original_name,
764 GLsizei* size, GLenum* type) const { 740 GLsizei* size, GLenum* type) const {
765 DCHECK(corrected_name); 741 DCHECK(corrected_name && original_name && size && type);
766 DCHECK(original_name); 742 for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
767 DCHECK(size); 743 Shader* shader = attached_shaders_[ii].get();
768 DCHECK(type); 744 if (!shader)
769 const char* kArraySpec = "[0]"; 745 continue;
770 for (int jj = 0; jj < 2; ++jj) { 746 const sh::ShaderVariable* info = NULL;
771 std::string test_name(name + ((jj == 1) ? kArraySpec : "")); 747 const sh::Uniform* uniform = shader->GetUniformInfo(name);
772 for (int ii = 0; ii < kMaxAttachedShaders; ++ii) { 748 bool found = false;
773 Shader* shader = attached_shaders_[ii].get(); 749 if (uniform)
774 if (shader) { 750 found = uniform->findInfoByMappedName(name, &info, original_name);
775 const Shader::VariableInfo* variable_info = 751 if (found) {
776 use_uniforms ? shader->GetUniformInfo(test_name) : 752 const std::string kArraySpec("[0]");
777 shader->GetAttribInfo(test_name); 753 if (info->arraySize > 0 && !EndsWith(name, kArraySpec, true)) {
778 // Note: There is an assuption here that if an attrib is defined in more 754 *corrected_name = name + kArraySpec;
779 // than 1 attached shader their types and sizes match. Should we check 755 *original_name += kArraySpec;
780 // for that case? 756 } else {
781 if (variable_info) { 757 *corrected_name = name;
782 *corrected_name = test_name;
783 *original_name = variable_info->name;
784 *type = variable_info->type;
785 *size = variable_info->size;
786 return;
787 }
788 } 758 }
759 *type = info->type;
760 *size = std::max(1u, info->arraySize);
761 return;
789 } 762 }
790 } 763 }
764 // TODO(zmo): this path should never be reached unless there is a serious
765 // bug in the driver or in ANGLE translator.
791 *corrected_name = name; 766 *corrected_name = name;
792 *original_name = name; 767 *original_name = name;
793 } 768 }
794 769
770 void Program::GetVertexAttribData(
771 const std::string& name, std::string* original_name, GLenum* type) const {
772 DCHECK(original_name);
773 DCHECK(type);
774 Shader* shader = attached_shaders_[ShaderTypeToIndex(GL_VERTEX_SHADER)].get();
775 if (shader) {
776 // Vertex attributes can not be arrays or structs (GLSL ES 3.00.4, section
777 // 4.3.4, "Input Variables"), so the top level sh::Attribute returns the
778 // information we need.
779 const sh::Attribute* info = shader->GetAttribInfo(name);
780 if (info) {
781 *original_name = info->name;
782 *type = info->type;
783 return;
784 }
785 }
786 // TODO(zmo): this path should never be reached unless there is a serious
787 // bug in the driver or in ANGLE translator.
788 *original_name = name;
789 }
790
795 bool Program::AddUniformInfo( 791 bool Program::AddUniformInfo(
796 GLsizei size, GLenum type, GLint location, GLint fake_base_location, 792 GLsizei size, GLenum type, GLint location, GLint fake_base_location,
797 const std::string& name, const std::string& original_name, 793 const std::string& name, const std::string& original_name,
798 size_t* next_available_index) { 794 size_t* next_available_index) {
799 DCHECK(next_available_index); 795 DCHECK(next_available_index);
800 const char* kArraySpec = "[0]"; 796 const char* kArraySpec = "[0]";
801 size_t uniform_index = 797 size_t uniform_index =
802 fake_base_location >= 0 ? fake_base_location : *next_available_index; 798 fake_base_location >= 0 ? fake_base_location : *next_available_index;
803 if (uniform_infos_.size() < uniform_index + 1) { 799 if (uniform_infos_.size() < uniform_index + 1) {
804 uniform_infos_.resize(uniform_index + 1); 800 uniform_infos_.resize(uniform_index + 1);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 std::pair<std::set<GLint>::iterator, bool> result = 1003 std::pair<std::set<GLint>::iterator, bool> result =
1008 location_binding_used.insert(it->second); 1004 location_binding_used.insert(it->second);
1009 if (!result.second) 1005 if (!result.second)
1010 return true; 1006 return true;
1011 } 1007 }
1012 } 1008 }
1013 return false; 1009 return false;
1014 } 1010 }
1015 1011
1016 bool Program::DetectUniformsMismatch(std::string* conflicting_name) const { 1012 bool Program::DetectUniformsMismatch(std::string* conflicting_name) const {
1017 typedef std::map<std::string, UniformType> UniformMap; 1013 typedef std::map<std::string, const sh::Uniform*> UniformPointerMap;
1018 UniformMap uniform_map; 1014 UniformPointerMap uniform_pointer_map;
1019 for (int ii = 0; ii < kMaxAttachedShaders; ++ii) { 1015 for (int ii = 0; ii < kMaxAttachedShaders; ++ii) {
1020 const ShaderTranslator::VariableMap& shader_uniforms = 1016 const UniformMap& shader_uniforms = attached_shaders_[ii]->uniform_map();
1021 attached_shaders_[ii]->uniform_map(); 1017 for (UniformMap::const_iterator iter = shader_uniforms.begin();
1022 for (ShaderTranslator::VariableMap::const_iterator iter =
1023 shader_uniforms.begin();
1024 iter != shader_uniforms.end(); ++iter) { 1018 iter != shader_uniforms.end(); ++iter) {
1025 const std::string& name = iter->first; 1019 const std::string& name = iter->first;
1026 UniformType type(iter->second); 1020 UniformPointerMap::iterator hit = uniform_pointer_map.find(name);
1027 UniformMap::iterator map_entry = uniform_map.find(name); 1021 if (hit == uniform_pointer_map.end()) {
1028 if (map_entry == uniform_map.end()) { 1022 uniform_pointer_map[name] = &(iter->second);
1029 uniform_map[name] = type;
1030 } else { 1023 } else {
1031 // If a uniform is already in the map, i.e., it has already been 1024 // If a uniform is in the map, i.e., it has already been declared by
1032 // declared by other shader, then the type and precision must match. 1025 // another shader, then the type, precision, etc. must match.
1033 if (map_entry->second == type) 1026 if (hit->second->isSameUniformAtLinkTime(iter->second))
1034 continue; 1027 continue;
1035 *conflicting_name = name; 1028 *conflicting_name = name;
1036 return true; 1029 return true;
1037 } 1030 }
1038 } 1031 }
1039 } 1032 }
1040 return false; 1033 return false;
1041 } 1034 }
1042 1035
1043 bool Program::DetectVaryingsMismatch(std::string* conflicting_name) const { 1036 bool Program::DetectVaryingsMismatch(std::string* conflicting_name) const {
1044 DCHECK(attached_shaders_[0].get() && 1037 DCHECK(attached_shaders_[0].get() &&
1045 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER && 1038 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
1046 attached_shaders_[1].get() && 1039 attached_shaders_[1].get() &&
1047 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER); 1040 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
1048 const ShaderTranslator::VariableMap* vertex_varyings = 1041 const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map());
1049 &(attached_shaders_[0]->varying_map()); 1042 const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map());
1050 const ShaderTranslator::VariableMap* fragment_varyings =
1051 &(attached_shaders_[1]->varying_map());
1052 1043
1053 for (ShaderTranslator::VariableMap::const_iterator iter = 1044 for (VaryingMap::const_iterator iter = fragment_varyings->begin();
1054 fragment_varyings->begin();
1055 iter != fragment_varyings->end(); ++iter) { 1045 iter != fragment_varyings->end(); ++iter) {
1056 const std::string& name = iter->first; 1046 const std::string& name = iter->first;
1057 if (IsBuiltInVarying(name)) 1047 if (IsBuiltInVarying(name))
1058 continue; 1048 continue;
1059 1049
1060 ShaderTranslator::VariableMap::const_iterator hit = 1050 VaryingMap::const_iterator hit = vertex_varyings->find(name);
1061 vertex_varyings->find(name);
1062 if (hit == vertex_varyings->end()) { 1051 if (hit == vertex_varyings->end()) {
1063 if (iter->second.static_use) { 1052 if (iter->second.staticUse) {
1064 *conflicting_name = name; 1053 *conflicting_name = name;
1065 return true; 1054 return true;
1066 } 1055 }
1067 continue; 1056 continue;
1068 } 1057 }
1069 1058
1070 if (hit->second.type != iter->second.type || 1059 if (!hit->second.isSameVaryingAtLinkTime(iter->second)) {
1071 hit->second.size != iter->second.size) {
1072 *conflicting_name = name; 1060 *conflicting_name = name;
1073 return true; 1061 return true;
1074 } 1062 }
1075 1063
1076 } 1064 }
1077 return false; 1065 return false;
1078 } 1066 }
1079 1067
1080 bool Program::DetectGlobalNameConflicts(std::string* conflicting_name) const { 1068 bool Program::DetectGlobalNameConflicts(std::string* conflicting_name) const {
1081 DCHECK(attached_shaders_[0].get() && 1069 DCHECK(attached_shaders_[0].get() &&
1082 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER && 1070 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
1083 attached_shaders_[1].get() && 1071 attached_shaders_[1].get() &&
1084 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER); 1072 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
1085 const ShaderTranslator::VariableMap* uniforms[2]; 1073 const UniformMap* uniforms[2];
1086 uniforms[0] = &(attached_shaders_[0]->uniform_map()); 1074 uniforms[0] = &(attached_shaders_[0]->uniform_map());
1087 uniforms[1] = &(attached_shaders_[1]->uniform_map()); 1075 uniforms[1] = &(attached_shaders_[1]->uniform_map());
1088 const ShaderTranslator::VariableMap* attribs = 1076 const AttributeMap* attribs =
1089 &(attached_shaders_[0]->attrib_map()); 1077 &(attached_shaders_[0]->attrib_map());
1090 1078
1091 for (ShaderTranslator::VariableMap::const_iterator iter = 1079 for (AttributeMap::const_iterator iter = attribs->begin();
1092 attribs->begin(); iter != attribs->end(); ++iter) { 1080 iter != attribs->end(); ++iter) {
1093 for (int ii = 0; ii < 2; ++ii) { 1081 for (int ii = 0; ii < 2; ++ii) {
1094 if (uniforms[ii]->find(iter->first) != uniforms[ii]->end()) { 1082 if (uniforms[ii]->find(iter->first) != uniforms[ii]->end()) {
1095 *conflicting_name = iter->first; 1083 *conflicting_name = iter->first;
1096 return true; 1084 return true;
1097 } 1085 }
1098 } 1086 }
1099 } 1087 }
1100 return false; 1088 return false;
1101 } 1089 }
1102 1090
1103 bool Program::CheckVaryingsPacking( 1091 bool Program::CheckVaryingsPacking(
1104 Program::VaryingsPackingOption option) const { 1092 Program::VaryingsPackingOption option) const {
1105 DCHECK(attached_shaders_[0].get() && 1093 DCHECK(attached_shaders_[0].get() &&
1106 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER && 1094 attached_shaders_[0]->shader_type() == GL_VERTEX_SHADER &&
1107 attached_shaders_[1].get() && 1095 attached_shaders_[1].get() &&
1108 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER); 1096 attached_shaders_[1]->shader_type() == GL_FRAGMENT_SHADER);
1109 const ShaderTranslator::VariableMap* vertex_varyings = 1097 const VaryingMap* vertex_varyings = &(attached_shaders_[0]->varying_map());
1110 &(attached_shaders_[0]->varying_map()); 1098 const VaryingMap* fragment_varyings = &(attached_shaders_[1]->varying_map());
1111 const ShaderTranslator::VariableMap* fragment_varyings =
1112 &(attached_shaders_[1]->varying_map());
1113 1099
1114 std::map<std::string, ShVariableInfo> combined_map; 1100 std::map<std::string, ShVariableInfo> combined_map;
1115 1101
1116 for (ShaderTranslator::VariableMap::const_iterator iter = 1102 for (VaryingMap::const_iterator iter = fragment_varyings->begin();
1117 fragment_varyings->begin();
1118 iter != fragment_varyings->end(); ++iter) { 1103 iter != fragment_varyings->end(); ++iter) {
1119 if (!iter->second.static_use && option == kCountOnlyStaticallyUsed) 1104 if (!iter->second.staticUse && option == kCountOnlyStaticallyUsed)
1120 continue; 1105 continue;
1121 if (!IsBuiltInVarying(iter->first)) { 1106 if (!IsBuiltInVarying(iter->first)) {
1122 ShaderTranslator::VariableMap::const_iterator vertex_iter = 1107 VaryingMap::const_iterator vertex_iter =
1123 vertex_varyings->find(iter->first); 1108 vertex_varyings->find(iter->first);
1124 if (vertex_iter == vertex_varyings->end() || 1109 if (vertex_iter == vertex_varyings->end() ||
1125 (!vertex_iter->second.static_use && 1110 (!vertex_iter->second.staticUse &&
1126 option == kCountOnlyStaticallyUsed)) 1111 option == kCountOnlyStaticallyUsed))
1127 continue; 1112 continue;
1128 } 1113 }
1129 1114
1130 ShVariableInfo var; 1115 ShVariableInfo var;
1131 var.type = static_cast<sh::GLenum>(iter->second.type); 1116 var.type = static_cast<sh::GLenum>(iter->second.type);
1132 var.size = iter->second.size; 1117 var.size = std::max(1u, iter->second.arraySize);
1133 combined_map[iter->first] = var; 1118 combined_map[iter->first] = var;
1134 } 1119 }
1135 1120
1136 if (combined_map.size() == 0) 1121 if (combined_map.size() == 0)
1137 return true; 1122 return true;
1138 scoped_ptr<ShVariableInfo[]> variables( 1123 scoped_ptr<ShVariableInfo[]> variables(
1139 new ShVariableInfo[combined_map.size()]); 1124 new ShVariableInfo[combined_map.size()]);
1140 size_t index = 0; 1125 size_t index = 0;
1141 for (std::map<std::string, ShVariableInfo>::const_iterator iter = 1126 for (std::map<std::string, ShVariableInfo>::const_iterator iter =
1142 combined_map.begin(); 1127 combined_map.begin();
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 DCHECK(program); 1350 DCHECK(program);
1366 program->ClearUniforms(&zero_); 1351 program->ClearUniforms(&zero_);
1367 } 1352 }
1368 1353
1369 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { 1354 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) {
1370 return index + element * 0x10000; 1355 return index + element * 0x10000;
1371 } 1356 }
1372 1357
1373 } // namespace gles2 1358 } // namespace gles2
1374 } // namespace gpu 1359 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/program_manager.h ('k') | gpu/command_buffer/service/program_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698