| 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_TRANSLATOR_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 typedef base::hash_map<std::string, std::string> NameMap; | 26 typedef base::hash_map<std::string, std::string> NameMap; |
| 27 | 27 |
| 28 // Translates a GLSL ES 2.0 shader to desktop GLSL shader, or just | 28 // Translates a GLSL ES 2.0 shader to desktop GLSL shader, or just |
| 29 // validates GLSL ES 2.0 shaders on a true GLSL ES implementation. | 29 // validates GLSL ES 2.0 shaders on a true GLSL ES implementation. |
| 30 class ShaderTranslatorInterface | 30 class ShaderTranslatorInterface |
| 31 : public base::RefCounted<ShaderTranslatorInterface> { | 31 : public base::RefCounted<ShaderTranslatorInterface> { |
| 32 public: | 32 public: |
| 33 ShaderTranslatorInterface() {} | 33 ShaderTranslatorInterface() {} |
| 34 enum GlslImplementationType { | 34 enum GlslImplementationType { |
| 35 kGlsl, | 35 kGlsl, |
| 36 kGlslCoreProfile, |
| 36 kGlslES | 37 kGlslES |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 // Initializes the translator. | 40 // Initializes the translator. |
| 40 // Must be called once before using the translator object. | 41 // Must be called once before using the translator object. |
| 41 virtual bool Init( | 42 virtual bool Init( |
| 42 sh::GLenum shader_type, | 43 sh::GLenum shader_type, |
| 43 ShShaderSpec shader_spec, | 44 ShShaderSpec shader_spec, |
| 44 const ShBuiltInResources* resources, | 45 const ShBuiltInResources* resources, |
| 45 GlslImplementationType glsl_implementation_type, | 46 GlslImplementationType glsl_implementation_type, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 bool implementation_is_glsl_es_; | 118 bool implementation_is_glsl_es_; |
| 118 ShCompileOptions driver_bug_workarounds_; | 119 ShCompileOptions driver_bug_workarounds_; |
| 119 ObserverList<DestructionObserver> destruction_observers_; | 120 ObserverList<DestructionObserver> destruction_observers_; |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace gles2 | 123 } // namespace gles2 |
| 123 } // namespace gpu | 124 } // namespace gpu |
| 124 | 125 |
| 125 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 126 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 126 | 127 |
| OLD | NEW |