| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 attached_shaders_[1], | 482 attached_shaders_[1], |
| 483 &bind_attrib_location_map_); | 483 &bind_attrib_location_map_); |
| 484 link = success != ProgramCache::PROGRAM_LOAD_SUCCESS; | 484 link = success != ProgramCache::PROGRAM_LOAD_SUCCESS; |
| 485 } | 485 } |
| 486 | 486 |
| 487 if (link) { | 487 if (link) { |
| 488 // compile our shaders if they're pending | 488 // compile our shaders if they're pending |
| 489 const int kShaders = ProgramManager::ProgramInfo::kMaxAttachedShaders; | 489 const int kShaders = ProgramManager::ProgramInfo::kMaxAttachedShaders; |
| 490 for (int i = 0; i < kShaders; ++i) { | 490 for (int i = 0; i < kShaders; ++i) { |
| 491 ShaderManager::ShaderInfo* info = attached_shaders_[i].get(); | 491 ShaderManager::ShaderInfo* info = attached_shaders_[i].get(); |
| 492 if (!info->source_compiled()) { | 492 if (info->compilation_status() == |
| 493 ShaderManager::ShaderInfo::PENDING_DEFERRED_COMPILE) { |
| 493 ShaderTranslator* translator = ShaderIndexToTranslator( | 494 ShaderTranslator* translator = ShaderIndexToTranslator( |
| 494 i, | 495 i, |
| 495 vertex_translator, | 496 vertex_translator, |
| 496 fragment_translator); | 497 fragment_translator); |
| 497 manager_->ForceCompileShader(info->deferred_compilation_source(), | 498 manager_->ForceCompileShader(info->deferred_compilation_source(), |
| 498 attached_shaders_[i], | 499 attached_shaders_[i], |
| 499 translator, | 500 translator, |
| 500 feature_info); | 501 feature_info); |
| 501 CHECK(info->IsValid()); | 502 CHECK(info->IsValid()); |
| 502 } | 503 } |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { | 1118 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { |
| 1118 return index + element * 0x10000; | 1119 return index + element * 0x10000; |
| 1119 } | 1120 } |
| 1120 | 1121 |
| 1121 } // namespace gles2 | 1122 } // namespace gles2 |
| 1122 } // namespace gpu | 1123 } // namespace gpu |
| 1123 | 1124 |
| 1124 | 1125 |
| OLD | NEW |