| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |