| 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 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2073 | 2073 |
| 2074 combined_map[key_value.first] = &key_value.second; | 2074 combined_map[key_value.first] = &key_value.second; |
| 2075 } | 2075 } |
| 2076 | 2076 |
| 2077 if (combined_map.size() == 0) | 2077 if (combined_map.size() == 0) |
| 2078 return true; | 2078 return true; |
| 2079 std::vector<sh::ShaderVariable> variables; | 2079 std::vector<sh::ShaderVariable> variables; |
| 2080 for (const auto& key_value : combined_map) { | 2080 for (const auto& key_value : combined_map) { |
| 2081 variables.push_back(*key_value.second); | 2081 variables.push_back(*key_value.second); |
| 2082 } | 2082 } |
| 2083 return ShCheckVariablesWithinPackingLimits( | 2083 return sh::CheckVariablesWithinPackingLimits( |
| 2084 static_cast<int>(manager_->max_varying_vectors()), | 2084 static_cast<int>(manager_->max_varying_vectors()), variables); |
| 2085 variables); | |
| 2086 } | 2085 } |
| 2087 | 2086 |
| 2088 void Program::GetProgramInfo( | 2087 void Program::GetProgramInfo( |
| 2089 ProgramManager* manager, CommonDecoder::Bucket* bucket) const { | 2088 ProgramManager* manager, CommonDecoder::Bucket* bucket) const { |
| 2090 // NOTE: It seems to me the math in here does not need check for overflow | 2089 // NOTE: It seems to me the math in here does not need check for overflow |
| 2091 // because the data being calucated from has various small limits. The max | 2090 // because the data being calucated from has various small limits. The max |
| 2092 // number of attribs + uniforms is somewhere well under 1024. The maximum size | 2091 // number of attribs + uniforms is somewhere well under 1024. The maximum size |
| 2093 // of an identifier is 256 characters. | 2092 // of an identifier is 256 characters. |
| 2094 uint32_t num_locations = 0; | 2093 uint32_t num_locations = 0; |
| 2095 uint32_t total_string_size = 0; | 2094 uint32_t total_string_size = 0; |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 DCHECK(program); | 2660 DCHECK(program); |
| 2662 program->ClearUniforms(&zero_); | 2661 program->ClearUniforms(&zero_); |
| 2663 } | 2662 } |
| 2664 | 2663 |
| 2665 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { | 2664 int32_t ProgramManager::MakeFakeLocation(int32_t index, int32_t element) { |
| 2666 return index + element * 0x10000; | 2665 return index + element * 0x10000; |
| 2667 } | 2666 } |
| 2668 | 2667 |
| 2669 } // namespace gles2 | 2668 } // namespace gles2 |
| 2670 } // namespace gpu | 2669 } // namespace gpu |
| OLD | NEW |