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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 const std::string* mapped_name = GetAttribMappedName(it->first); | 375 const std::string* mapped_name = GetAttribMappedName(it->first); |
376 if (mapped_name && *mapped_name != it->first) | 376 if (mapped_name && *mapped_name != it->first) |
377 glBindAttribLocation(service_id_, it->second, mapped_name->c_str()); | 377 glBindAttribLocation(service_id_, it->second, mapped_name->c_str()); |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 void ProgramManager::DoCompileShader(ShaderManager::ShaderInfo* info, | 381 void ProgramManager::DoCompileShader(ShaderManager::ShaderInfo* info, |
382 ShaderTranslator* translator, | 382 ShaderTranslator* translator, |
383 FeatureInfo* feature_info) { | 383 FeatureInfo* feature_info) { |
384 if (program_cache_ && | 384 if (program_cache_ && |
385 program_cache_->GetShaderCompilationStatus(*info->source()) == | 385 program_cache_->GetShaderCompilationStatus(info->source() ? |
| 386 *info->source() : "") == |
386 ProgramCache::COMPILATION_SUCCEEDED) { | 387 ProgramCache::COMPILATION_SUCCEEDED) { |
387 info->SetStatus(true, "", translator); | 388 info->SetStatus(true, "", translator); |
388 info->FlagSourceAsCompiled(false); | 389 info->FlagSourceAsCompiled(false); |
389 return; | 390 return; |
390 } | 391 } |
391 ForceCompileShader(info->source(), info, translator, feature_info); | 392 ForceCompileShader(info->source(), info, translator, feature_info); |
392 } | 393 } |
393 | 394 |
394 void ProgramManager::ForceCompileShader(const std::string* source, | 395 void ProgramManager::ForceCompileShader(const std::string* source, |
395 ShaderManager::ShaderInfo* info, | 396 ShaderManager::ShaderInfo* info, |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 info->ClearUniforms(&zero_); | 1114 info->ClearUniforms(&zero_); |
1114 } | 1115 } |
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 |
OLD | NEW |