| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 const VertexAttrib* GetAttribInfoByLocation(GLuint location) const { | 193 const VertexAttrib* GetAttribInfoByLocation(GLuint location) const { |
| 194 if (location < attrib_location_to_index_map_.size()) { | 194 if (location < attrib_location_to_index_map_.size()) { |
| 195 GLint index = attrib_location_to_index_map_[location]; | 195 GLint index = attrib_location_to_index_map_[location]; |
| 196 if (index >= 0) { | 196 if (index >= 0) { |
| 197 return &attrib_infos_[index]; | 197 return &attrib_infos_[index]; |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 return NULL; | 200 return NULL; |
| 201 } | 201 } |
| 202 | 202 |
| 203 GLuint GetAttribDivisorByLocation(GLuint location) const { |
| 204 if (location < attrib_location_to_divisor_map_.size()) { |
| 205 return attrib_location_to_divisor_map_[location]; |
| 206 } |
| 207 return 0; |
| 208 } |
| 209 |
| 210 void SaveAttribDivisor(GLuint location, GLuint divisor) { |
| 211 if (location < attrib_location_to_divisor_map_.size()) { |
| 212 attrib_location_to_divisor_map_[location] = divisor; |
| 213 } |
| 214 } |
| 215 |
| 203 const UniformInfo* GetUniformInfo(GLint index) const; | 216 const UniformInfo* GetUniformInfo(GLint index) const; |
| 204 | 217 |
| 205 // If the original name is not found, return NULL. | 218 // If the original name is not found, return NULL. |
| 206 const std::string* GetAttribMappedName( | 219 const std::string* GetAttribMappedName( |
| 207 const std::string& original_name) const; | 220 const std::string& original_name) const; |
| 208 | 221 |
| 209 // If the original name is not found, return NULL. | 222 // If the original name is not found, return NULL. |
| 210 const std::string* GetUniformMappedName( | 223 const std::string* GetUniformMappedName( |
| 211 const std::string& original_name) const; | 224 const std::string& original_name) const; |
| 212 | 225 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 int use_count_; | 481 int use_count_; |
| 469 | 482 |
| 470 GLsizei max_attrib_name_length_; | 483 GLsizei max_attrib_name_length_; |
| 471 | 484 |
| 472 // Attrib by index. | 485 // Attrib by index. |
| 473 AttribInfoVector attrib_infos_; | 486 AttribInfoVector attrib_infos_; |
| 474 | 487 |
| 475 // Attrib by location to index. | 488 // Attrib by location to index. |
| 476 std::vector<GLint> attrib_location_to_index_map_; | 489 std::vector<GLint> attrib_location_to_index_map_; |
| 477 | 490 |
| 491 // Attrib by location to divisor value. |
| 492 std::vector<GLuint> attrib_location_to_divisor_map_; |
| 493 |
| 478 GLsizei max_uniform_name_length_; | 494 GLsizei max_uniform_name_length_; |
| 479 | 495 |
| 480 // Uniform info by index. | 496 // Uniform info by index. |
| 481 UniformInfoVector uniform_infos_; | 497 UniformInfoVector uniform_infos_; |
| 482 UniformLocationVector uniform_locations_; | 498 UniformLocationVector uniform_locations_; |
| 483 | 499 |
| 484 // The indices of the uniforms that are samplers. | 500 // The indices of the uniforms that are samplers. |
| 485 SamplerIndices sampler_indices_; | 501 SamplerIndices sampler_indices_; |
| 486 | 502 |
| 487 FragmentInputInfoVector fragment_input_infos_; | 503 FragmentInputInfoVector fragment_input_infos_; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 }; | 636 }; |
| 621 | 637 |
| 622 inline const FeatureInfo& Program::feature_info() const { | 638 inline const FeatureInfo& Program::feature_info() const { |
| 623 return *manager_->feature_info_.get(); | 639 return *manager_->feature_info_.get(); |
| 624 } | 640 } |
| 625 | 641 |
| 626 } // namespace gles2 | 642 } // namespace gles2 |
| 627 } // namespace gpu | 643 } // namespace gpu |
| 628 | 644 |
| 629 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 645 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
| OLD | NEW |