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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 } | 864 } |
865 glLinkProgram(service_id()); | 865 glLinkProgram(service_id()); |
866 } | 866 } |
867 | 867 |
868 GLint success = 0; | 868 GLint success = 0; |
869 glGetProgramiv(service_id(), GL_LINK_STATUS, &success); | 869 glGetProgramiv(service_id(), GL_LINK_STATUS, &success); |
870 if (success == GL_TRUE) { | 870 if (success == GL_TRUE) { |
871 GatherInterfaceBlockInfo(); | 871 GatherInterfaceBlockInfo(); |
872 Update(); | 872 Update(); |
873 if (link) { | 873 if (link) { |
| 874 // ANGLE updates the translated shader sources on link. |
| 875 for (auto shader : attached_shaders_) { |
| 876 shader->RefreshTranslatedShaderSource(); |
| 877 } |
874 if (cache) { | 878 if (cache) { |
875 cache->SaveLinkedProgram(service_id(), | 879 cache->SaveLinkedProgram(service_id(), |
876 attached_shaders_[0].get(), | 880 attached_shaders_[0].get(), |
877 attached_shaders_[1].get(), | 881 attached_shaders_[1].get(), |
878 &bind_attrib_location_map_, | 882 &bind_attrib_location_map_, |
879 transform_feedback_varyings_, | 883 transform_feedback_varyings_, |
880 transform_feedback_buffer_mode_, | 884 transform_feedback_buffer_mode_, |
881 shader_callback); | 885 shader_callback); |
882 } | 886 } |
883 UMA_HISTOGRAM_CUSTOM_COUNTS( | 887 UMA_HISTOGRAM_CUSTOM_COUNTS( |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 DCHECK(program); | 2172 DCHECK(program); |
2169 program->ClearUniforms(&zero_); | 2173 program->ClearUniforms(&zero_); |
2170 } | 2174 } |
2171 | 2175 |
2172 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { | 2176 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { |
2173 return index + element * 0x10000; | 2177 return index + element * 0x10000; |
2174 } | 2178 } |
2175 | 2179 |
2176 } // namespace gles2 | 2180 } // namespace gles2 |
2177 } // namespace gpu | 2181 } // namespace gpu |
OLD | NEW |