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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 // uniform-location binding map from glBindUniformLocationCHROMIUM() calls. | 349 // uniform-location binding map from glBindUniformLocationCHROMIUM() calls. |
350 LocationMap bind_uniform_location_map_; | 350 LocationMap bind_uniform_location_map_; |
351 }; | 351 }; |
352 | 352 |
353 // Tracks the Programs. | 353 // Tracks the Programs. |
354 // | 354 // |
355 // NOTE: To support shared resources an instance of this class will | 355 // NOTE: To support shared resources an instance of this class will |
356 // need to be shared by multiple GLES2Decoders. | 356 // need to be shared by multiple GLES2Decoders. |
357 class GPU_EXPORT ProgramManager { | 357 class GPU_EXPORT ProgramManager { |
358 public: | 358 public: |
359 enum TranslatedShaderSourceType { | |
360 kANGLE, | |
361 kGL, // GL or GLES | |
362 }; | |
363 | |
364 explicit ProgramManager(ProgramCache* program_cache, | 359 explicit ProgramManager(ProgramCache* program_cache, |
365 uint32 max_varying_vectors); | 360 uint32 max_varying_vectors); |
366 ~ProgramManager(); | 361 ~ProgramManager(); |
367 | 362 |
368 // Must call before destruction. | 363 // Must call before destruction. |
369 void Destroy(bool have_context); | 364 void Destroy(bool have_context); |
370 | 365 |
371 // Creates a new program. | 366 // Creates a new program. |
372 Program* CreateProgram(GLuint client_id, GLuint service_id); | 367 Program* CreateProgram(GLuint client_id, GLuint service_id); |
373 | 368 |
(...skipping 19 matching lines...) Expand all Loading... |
393 void ClearUniforms(Program* program); | 388 void ClearUniforms(Program* program); |
394 | 389 |
395 // Returns true if prefix is invalid for gl. | 390 // Returns true if prefix is invalid for gl. |
396 static bool IsInvalidPrefix(const char* name, size_t length); | 391 static bool IsInvalidPrefix(const char* name, size_t length); |
397 | 392 |
398 // Check if a Program is owned by this ProgramManager. | 393 // Check if a Program is owned by this ProgramManager. |
399 bool IsOwned(Program* program); | 394 bool IsOwned(Program* program); |
400 | 395 |
401 static int32 MakeFakeLocation(int32 index, int32 element); | 396 static int32 MakeFakeLocation(int32 index, int32 element); |
402 | 397 |
403 void DoCompileShader( | |
404 Shader* shader, | |
405 ShaderTranslator* translator, | |
406 TranslatedShaderSourceType translated_shader_source_type); | |
407 | |
408 uint32 max_varying_vectors() const { | 398 uint32 max_varying_vectors() const { |
409 return max_varying_vectors_; | 399 return max_varying_vectors_; |
410 } | 400 } |
411 | 401 |
412 private: | 402 private: |
413 friend class Program; | 403 friend class Program; |
414 | 404 |
415 void StartTracking(Program* program); | 405 void StartTracking(Program* program); |
416 void StopTracking(Program* program); | 406 void StopTracking(Program* program); |
417 | 407 |
(...skipping 18 matching lines...) Expand all Loading... |
436 | 426 |
437 uint32 max_varying_vectors_; | 427 uint32 max_varying_vectors_; |
438 | 428 |
439 DISALLOW_COPY_AND_ASSIGN(ProgramManager); | 429 DISALLOW_COPY_AND_ASSIGN(ProgramManager); |
440 }; | 430 }; |
441 | 431 |
442 } // namespace gles2 | 432 } // namespace gles2 |
443 } // namespace gpu | 433 } // namespace gpu |
444 | 434 |
445 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ | 435 #endif // GPU_COMMAND_BUFFER_SERVICE_PROGRAM_MANAGER_H_ |
OLD | NEW |