OLD | NEW |
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> |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 Shader* shader = attached_shaders_[ii].get(); | 775 Shader* shader = attached_shaders_[ii].get(); |
776 if (!shader) | 776 if (!shader) |
777 continue; | 777 continue; |
778 const sh::ShaderVariable* info = NULL; | 778 const sh::ShaderVariable* info = NULL; |
779 const sh::Uniform* uniform = shader->GetUniformInfo(name); | 779 const sh::Uniform* uniform = shader->GetUniformInfo(name); |
780 bool found = false; | 780 bool found = false; |
781 if (uniform) | 781 if (uniform) |
782 found = uniform->findInfoByMappedName(name, &info, original_name); | 782 found = uniform->findInfoByMappedName(name, &info, original_name); |
783 if (found) { | 783 if (found) { |
784 const std::string kArraySpec("[0]"); | 784 const std::string kArraySpec("[0]"); |
785 if (info->arraySize > 0 && !EndsWith(name, kArraySpec, true)) { | 785 if (info->arraySize > 0 && |
| 786 !base::EndsWith(name, kArraySpec, base::CompareCase::SENSITIVE)) { |
786 *corrected_name = name + kArraySpec; | 787 *corrected_name = name + kArraySpec; |
787 *original_name += kArraySpec; | 788 *original_name += kArraySpec; |
788 } else { | 789 } else { |
789 *corrected_name = name; | 790 *corrected_name = name; |
790 } | 791 } |
791 *type = info->type; | 792 *type = info->type; |
792 *size = std::max(1u, info->arraySize); | 793 *size = std::max(1u, info->arraySize); |
793 return; | 794 return; |
794 } | 795 } |
795 } | 796 } |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 DCHECK(program); | 1746 DCHECK(program); |
1746 program->ClearUniforms(&zero_); | 1747 program->ClearUniforms(&zero_); |
1747 } | 1748 } |
1748 | 1749 |
1749 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { | 1750 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { |
1750 return index + element * 0x10000; | 1751 return index + element * 0x10000; |
1751 } | 1752 } |
1752 | 1753 |
1753 } // namespace gles2 | 1754 } // namespace gles2 |
1754 } // namespace gpu | 1755 } // namespace gpu |
OLD | NEW |