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

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

Issue 10826073: Added null check for shader source when compiling, and fixed re-caching behavior to spec (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « gpu/command_buffer/service/memory_program_cache_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/memory_program_cache_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698