| 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, | |
| 37 kGlslES | 36 kGlslES |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 // Initializes the translator. | 39 // Initializes the translator. |
| 41 // Must be called once before using the translator object. | 40 // Must be called once before using the translator object. |
| 42 virtual bool Init( | 41 virtual bool Init( |
| 43 sh::GLenum shader_type, | 42 sh::GLenum shader_type, |
| 44 ShShaderSpec shader_spec, | 43 ShShaderSpec shader_spec, |
| 45 const ShBuiltInResources* resources, | 44 const ShBuiltInResources* resources, |
| 46 GlslImplementationType glsl_implementation_type, | 45 GlslImplementationType glsl_implementation_type, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 bool implementation_is_glsl_es_; | 117 bool implementation_is_glsl_es_; |
| 119 ShCompileOptions driver_bug_workarounds_; | 118 ShCompileOptions driver_bug_workarounds_; |
| 120 ObserverList<DestructionObserver> destruction_observers_; | 119 ObserverList<DestructionObserver> destruction_observers_; |
| 121 }; | 120 }; |
| 122 | 121 |
| 123 } // namespace gles2 | 122 } // namespace gles2 |
| 124 } // namespace gpu | 123 } // namespace gpu |
| 125 | 124 |
| 126 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 125 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 127 | 126 |
| OLD | NEW |