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

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

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 attrib_location_to_index_map_.resize(max_location + 1); 397 attrib_location_to_index_map_.resize(max_location + 1);
398 for (GLint ii = 0; ii <= max_location; ++ii) { 398 for (GLint ii = 0; ii <= max_location; ++ii) {
399 attrib_location_to_index_map_[ii] = -1; 399 attrib_location_to_index_map_[ii] = -1;
400 } 400 }
401 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { 401 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) {
402 const VertexAttrib& info = attrib_infos_[ii]; 402 const VertexAttrib& info = attrib_infos_[ii];
403 attrib_location_to_index_map_[info.location] = ii; 403 attrib_location_to_index_map_[info.location] = ii;
404 } 404 }
405 405
406 #if !defined(NDEBUG) 406 #if !defined(NDEBUG)
407 if (CommandLine::ForCurrentProcess()->HasSwitch( 407 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
408 switches::kEnableGPUServiceLoggingGPU)) { 408 switches::kEnableGPUServiceLoggingGPU)) {
409 DVLOG(1) << "----: attribs for service_id: " << service_id(); 409 DVLOG(1) << "----: attribs for service_id: " << service_id();
410 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { 410 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) {
411 const VertexAttrib& info = attrib_infos_[ii]; 411 const VertexAttrib& info = attrib_infos_[ii];
412 DVLOG(1) << ii << ": loc = " << info.location 412 DVLOG(1) << ii << ": loc = " << info.location
413 << ", size = " << info.size 413 << ", size = " << info.size
414 << ", type = " << GLES2Util::GetStringEnum(info.type) 414 << ", type = " << GLES2Util::GetStringEnum(info.type)
415 << ", name = " << info.name; 415 << ", name = " << info.name;
416 } 416 }
417 } 417 }
418 #endif 418 #endif
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 for (size_t ii = 0; ii < uniform_data.size(); ++ii) { 475 for (size_t ii = 0; ii < uniform_data.size(); ++ii) {
476 const UniformData& data = uniform_data[ii]; 476 const UniformData& data = uniform_data[ii];
477 if (!data.added) { 477 if (!data.added) {
478 AddUniformInfo( 478 AddUniformInfo(
479 data.size, data.type, data.location, -1, data.corrected_name, 479 data.size, data.type, data.location, -1, data.corrected_name,
480 data.original_name, &next_available_index); 480 data.original_name, &next_available_index);
481 } 481 }
482 } 482 }
483 483
484 #if !defined(NDEBUG) 484 #if !defined(NDEBUG)
485 if (CommandLine::ForCurrentProcess()->HasSwitch( 485 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
486 switches::kEnableGPUServiceLoggingGPU)) { 486 switches::kEnableGPUServiceLoggingGPU)) {
487 DVLOG(1) << "----: uniforms for service_id: " << service_id(); 487 DVLOG(1) << "----: uniforms for service_id: " << service_id();
488 for (size_t ii = 0; ii < uniform_infos_.size(); ++ii) { 488 for (size_t ii = 0; ii < uniform_infos_.size(); ++ii) {
489 const UniformInfo& info = uniform_infos_[ii]; 489 const UniformInfo& info = uniform_infos_[ii];
490 if (info.IsValid()) { 490 if (info.IsValid()) {
491 DVLOG(1) << ii << ": loc = " << info.element_locations[0] 491 DVLOG(1) << ii << ": loc = " << info.element_locations[0]
492 << ", size = " << info.size 492 << ", size = " << info.size
493 << ", type = " << GLES2Util::GetStringEnum(info.type) 493 << ", type = " << GLES2Util::GetStringEnum(info.type)
494 << ", name = " << info.name; 494 << ", name = " << info.name;
495 } 495 }
496 } 496 }
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 DCHECK(program); 1415 DCHECK(program);
1416 program->ClearUniforms(&zero_); 1416 program->ClearUniforms(&zero_);
1417 } 1417 }
1418 1418
1419 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) { 1419 int32 ProgramManager::MakeFakeLocation(int32 index, int32 element) {
1420 return index + element * 0x10000; 1420 return index + element * 0x10000;
1421 } 1421 }
1422 1422
1423 } // namespace gles2 1423 } // namespace gles2
1424 } // namespace gpu 1424 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/memory_program_cache.cc ('k') | gpu/command_buffer/service/shader_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698