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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // GLSL ES spec 1.00.17, section 4.6.4, Invariance and Linkage. | 232 // GLSL ES spec 1.00.17, section 4.6.4, Invariance and Linkage. |
233 bool DetectBuiltInInvariantConflicts() const; | 233 bool DetectBuiltInInvariantConflicts() const; |
234 | 234 |
235 // Return true if an uniform and an attribute share the same name. | 235 // Return true if an uniform and an attribute share the same name. |
236 bool DetectGlobalNameConflicts(std::string* conflicting_name) const; | 236 bool DetectGlobalNameConflicts(std::string* conflicting_name) const; |
237 | 237 |
238 // Return false if varyings can't be packed into the max available | 238 // Return false if varyings can't be packed into the max available |
239 // varying registers. | 239 // varying registers. |
240 bool CheckVaryingsPacking(VaryingsPackingOption option) const; | 240 bool CheckVaryingsPacking(VaryingsPackingOption option) const; |
241 | 241 |
| 242 void TransformFeedbackVaryings(GLsizei count, const char* const* varyings, |
| 243 GLenum buffer_mode); |
| 244 |
242 // Visible for testing | 245 // Visible for testing |
243 const LocationMap& bind_attrib_location_map() const { | 246 const LocationMap& bind_attrib_location_map() const { |
244 return bind_attrib_location_map_; | 247 return bind_attrib_location_map_; |
245 } | 248 } |
246 | 249 |
| 250 const std::vector<std::string>& transform_feedback_varyings() const { |
| 251 return transform_feedback_varyings_; |
| 252 } |
| 253 |
| 254 GLenum transform_feedback_buffer_mode() const { |
| 255 return transform_feedback_buffer_mode_; |
| 256 } |
| 257 |
247 private: | 258 private: |
248 friend class base::RefCounted<Program>; | 259 friend class base::RefCounted<Program>; |
249 friend class ProgramManager; | 260 friend class ProgramManager; |
250 | 261 |
251 ~Program(); | 262 ~Program(); |
252 | 263 |
253 void set_log_info(const char* str) { | 264 void set_log_info(const char* str) { |
254 log_info_.reset(str ? new std::string(str) : NULL); | 265 log_info_.reset(str ? new std::string(str) : NULL); |
255 } | 266 } |
256 | 267 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 GLint num_uniforms_; | 377 GLint num_uniforms_; |
367 | 378 |
368 // Log info | 379 // Log info |
369 scoped_ptr<std::string> log_info_; | 380 scoped_ptr<std::string> log_info_; |
370 | 381 |
371 // attribute-location binding map from glBindAttribLocation() calls. | 382 // attribute-location binding map from glBindAttribLocation() calls. |
372 LocationMap bind_attrib_location_map_; | 383 LocationMap bind_attrib_location_map_; |
373 | 384 |
374 // uniform-location binding map from glBindUniformLocationCHROMIUM() calls. | 385 // uniform-location binding map from glBindUniformLocationCHROMIUM() calls. |
375 LocationMap bind_uniform_location_map_; | 386 LocationMap bind_uniform_location_map_; |
| 387 |
| 388 std::vector<std::string> transform_feedback_varyings_; |
| 389 |
| 390 GLenum transform_feedback_buffer_mode_; |
376 }; | 391 }; |
377 | 392 |
378 // Tracks the Programs. | 393 // Tracks the Programs. |
379 // | 394 // |
380 // NOTE: To support shared resources an instance of this class will | 395 // NOTE: To support shared resources an instance of this class will |
381 // need to be shared by multiple GLES2Decoders. | 396 // need to be shared by multiple GLES2Decoders. |
382 class GPU_EXPORT ProgramManager { | 397 class GPU_EXPORT ProgramManager { |
383 public: | 398 public: |
384 explicit ProgramManager(ProgramCache* program_cache, | 399 explicit ProgramManager(ProgramCache* program_cache, |
385 uint32 max_varying_vectors); | 400 uint32 max_varying_vectors); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 | 466 |
452 uint32 max_varying_vectors_; | 467 uint32 max_varying_vectors_; |
453 | 468 |
454 DISALLOW_COPY_AND_ASSIGN(ProgramManager); | 469 DISALLOW_COPY_AND_ASSIGN(ProgramManager); |
455 }; | 470 }; |
456 | 471 |
457 } // namespace gles2 | 472 } // namespace gles2 |
458 } // namespace gpu | 473 } // namespace gpu |
459 | 474 |
460 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 475 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
OLD | NEW |