| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 max_uniform_name_length_ = 0; | 281 max_uniform_name_length_ = 0; |
| 282 max_attrib_name_length_ = 0; | 282 max_attrib_name_length_ = 0; |
| 283 attrib_infos_.clear(); | 283 attrib_infos_.clear(); |
| 284 uniform_infos_.clear(); | 284 uniform_infos_.clear(); |
| 285 uniform_locations_.clear(); | 285 uniform_locations_.clear(); |
| 286 fragment_input_infos_.clear(); | 286 fragment_input_infos_.clear(); |
| 287 fragment_input_locations_.clear(); | 287 fragment_input_locations_.clear(); |
| 288 program_output_infos_.clear(); | 288 program_output_infos_.clear(); |
| 289 sampler_indices_.clear(); | 289 sampler_indices_.clear(); |
| 290 attrib_location_to_index_map_.clear(); | 290 attrib_location_to_index_map_.clear(); |
| 291 attrib_location_to_divisor_map_.clear(); |
| 291 } | 292 } |
| 292 | 293 |
| 293 std::string Program::ProcessLogInfo( | 294 std::string Program::ProcessLogInfo( |
| 294 const std::string& log) { | 295 const std::string& log) { |
| 295 std::string output; | 296 std::string output; |
| 296 re2::StringPiece input(log); | 297 re2::StringPiece input(log); |
| 297 std::string prior_log; | 298 std::string prior_log; |
| 298 std::string hashed_name; | 299 std::string hashed_name; |
| 299 while (RE2::Consume(&input, | 300 while (RE2::Consume(&input, |
| 300 "(.*?)(webgl_[0123456789abcdefABCDEF]+)", | 301 "(.*?)(webgl_[0123456789abcdefABCDEF]+)", |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 for (GLint ii = 0; ii <= max_location; ++ii) { | 491 for (GLint ii = 0; ii <= max_location; ++ii) { |
| 491 attrib_location_to_index_map_[ii] = -1; | 492 attrib_location_to_index_map_[ii] = -1; |
| 492 } | 493 } |
| 493 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { | 494 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { |
| 494 const VertexAttrib& info = attrib_infos_[ii]; | 495 const VertexAttrib& info = attrib_infos_[ii]; |
| 495 if (info.location >= 0 && info.location <= max_location) { | 496 if (info.location >= 0 && info.location <= max_location) { |
| 496 attrib_location_to_index_map_[info.location] = ii; | 497 attrib_location_to_index_map_[info.location] = ii; |
| 497 } | 498 } |
| 498 } | 499 } |
| 499 | 500 |
| 501 // Create attrib location to divisor map |
| 502 attrib_location_to_divisor_map_.resize(max_location + 1); |
| 503 for (GLint ii = 0; ii <= max_location; ++ii) { |
| 504 attrib_location_to_divisor_map_[ii] = 0; |
| 505 } |
| 506 |
| 500 if (manager_->gpu_preferences_.enable_gpu_service_logging_gpu) { | 507 if (manager_->gpu_preferences_.enable_gpu_service_logging_gpu) { |
| 501 DVLOG(1) << "----: attribs for service_id: " << service_id(); | 508 DVLOG(1) << "----: attribs for service_id: " << service_id(); |
| 502 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { | 509 for (size_t ii = 0; ii < attrib_infos_.size(); ++ii) { |
| 503 const VertexAttrib& info = attrib_infos_[ii]; | 510 const VertexAttrib& info = attrib_infos_[ii]; |
| 504 DVLOG(1) << ii << ": loc = " << info.location | 511 DVLOG(1) << ii << ": loc = " << info.location |
| 505 << ", size = " << info.size | 512 << ", size = " << info.size |
| 506 << ", type = " << GLES2Util::GetStringEnum(info.type) | 513 << ", type = " << GLES2Util::GetStringEnum(info.type) |
| 507 << ", name = " << info.name; | 514 << ", name = " << info.name; |
| 508 } | 515 } |
| 509 } | 516 } |
| (...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2367 DCHECK(program); | 2374 DCHECK(program); |
| 2368 program->ClearUniforms(&zero_); | 2375 program->ClearUniforms(&zero_); |
| 2369 } | 2376 } |
| 2370 | 2377 |
| 2371 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { | 2378 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { |
| 2372 return index + element * 0x10000; | 2379 return index + element * 0x10000; |
| 2373 } | 2380 } |
| 2374 | 2381 |
| 2375 } // namespace gles2 | 2382 } // namespace gles2 |
| 2376 } // namespace gpu | 2383 } // namespace gpu |
| OLD | NEW |