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_SHADER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // If the original_name is not found, return NULL. | 115 // If the original_name is not found, return NULL. |
116 const std::string* GetInterfaceBlockMappedName( | 116 const std::string* GetInterfaceBlockMappedName( |
117 const std::string& original_name) const; | 117 const std::string& original_name) const; |
118 | 118 |
119 // If the original_name is not found, return NULL. | 119 // If the original_name is not found, return NULL. |
120 const std::string* GetOutputVariableMappedName( | 120 const std::string* GetOutputVariableMappedName( |
121 const std::string& original_name) const; | 121 const std::string& original_name) const; |
122 | 122 |
123 // If the hashed_name is not found, return NULL. | 123 // If the hashed_name is not found, return NULL. |
| 124 // Use this only when one of the more specific Get*Info methods can't be used. |
124 const std::string* GetOriginalNameFromHashedName( | 125 const std::string* GetOriginalNameFromHashedName( |
125 const std::string& hashed_name) const; | 126 const std::string& hashed_name) const; |
126 | 127 |
127 const std::string* GetMappedName( | |
128 const std::string& original_name) const; | |
129 | |
130 const std::string& log_info() const { | 128 const std::string& log_info() const { |
131 return log_info_; | 129 return log_info_; |
132 } | 130 } |
133 | 131 |
134 bool valid() const { | 132 bool valid() const { |
135 return shader_state_ == kShaderStateCompiled && valid_; | 133 return shader_state_ == kShaderStateCompiled && valid_; |
136 } | 134 } |
137 | 135 |
138 bool IsDeleted() const { | 136 bool IsDeleted() const { |
139 return marked_for_deletion_; | 137 return marked_for_deletion_; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 250 |
253 // The shader translation log. | 251 // The shader translation log. |
254 std::string log_info_; | 252 std::string log_info_; |
255 | 253 |
256 // The type info when the shader was last compiled. | 254 // The type info when the shader was last compiled. |
257 AttributeMap attrib_map_; | 255 AttributeMap attrib_map_; |
258 UniformMap uniform_map_; | 256 UniformMap uniform_map_; |
259 VaryingMap varying_map_; | 257 VaryingMap varying_map_; |
260 InterfaceBlockMap interface_block_map_; | 258 InterfaceBlockMap interface_block_map_; |
261 OutputVariableList output_variable_list_; | 259 OutputVariableList output_variable_list_; |
262 | 260 // If a new info type is added, add it to GetOriginalNameFromHashedName. |
263 // The name hashing info when the shader was last compiled. | |
264 NameMap name_map_; | |
265 }; | 261 }; |
266 | 262 |
267 // Tracks the Shaders. | 263 // Tracks the Shaders. |
268 // | 264 // |
269 // NOTE: To support shared resources an instance of this class will | 265 // NOTE: To support shared resources an instance of this class will |
270 // need to be shared by multiple GLES2Decoders. | 266 // need to be shared by multiple GLES2Decoders. |
271 class GPU_EXPORT ShaderManager { | 267 class GPU_EXPORT ShaderManager { |
272 public: | 268 public: |
273 ShaderManager(ProgressReporter* progress_reporter); | 269 ShaderManager(ProgressReporter* progress_reporter); |
274 ~ShaderManager(); | 270 ~ShaderManager(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 ProgressReporter* progress_reporter_; | 312 ProgressReporter* progress_reporter_; |
317 | 313 |
318 DISALLOW_COPY_AND_ASSIGN(ShaderManager); | 314 DISALLOW_COPY_AND_ASSIGN(ShaderManager); |
319 }; | 315 }; |
320 | 316 |
321 } // namespace gles2 | 317 } // namespace gles2 |
322 } // namespace gpu | 318 } // namespace gpu |
323 | 319 |
324 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ | 320 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ |
325 | 321 |
OLD | NEW |