| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 27 matching lines...) Expand all Loading... |
| 38 // A valid info-log is always returned irrespective of whether translation | 38 // A valid info-log is always returned irrespective of whether translation |
| 39 // was successful or not. | 39 // was successful or not. |
| 40 virtual const char* translated_shader() const = 0; | 40 virtual const char* translated_shader() const = 0; |
| 41 virtual const char* info_log() const = 0; | 41 virtual const char* info_log() const = 0; |
| 42 | 42 |
| 43 struct VariableInfo { | 43 struct VariableInfo { |
| 44 VariableInfo() | 44 VariableInfo() |
| 45 : type(0), | 45 : type(0), |
| 46 size(0) { | 46 size(0) { |
| 47 } | 47 } |
| 48 VariableInfo(int _type, int _size) | 48 VariableInfo(int _type, int _size, std::string _name) |
| 49 : type(_type), | 49 : type(_type), |
| 50 size(_size) { | 50 size(_size), |
| 51 name(_name) { |
| 51 } | 52 } |
| 52 int type; | 53 int type; |
| 53 int size; | 54 int size; |
| 55 std::string name; // name in the original shader source. |
| 54 }; | 56 }; |
| 55 // Mapping between variable name and info. | 57 // Mapping between variable name and info. |
| 56 typedef base::hash_map<std::string, VariableInfo> VariableMap; | 58 typedef base::hash_map<std::string, VariableInfo> VariableMap; |
| 57 virtual const VariableMap& attrib_map() const = 0; | 59 virtual const VariableMap& attrib_map() const = 0; |
| 58 virtual const VariableMap& uniform_map() const = 0; | 60 virtual const VariableMap& uniform_map() const = 0; |
| 59 }; | 61 }; |
| 60 | 62 |
| 61 // Implementation of ShaderTranslatorInterface | 63 // Implementation of ShaderTranslatorInterface |
| 62 class ShaderTranslator : public ShaderTranslatorInterface { | 64 class ShaderTranslator : public ShaderTranslatorInterface { |
| 63 public: | 65 public: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 93 bool implementation_is_glsl_es_; | 95 bool implementation_is_glsl_es_; |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); | 97 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace gles2 | 100 } // namespace gles2 |
| 99 } // namespace gpu | 101 } // namespace gpu |
| 100 | 102 |
| 101 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 103 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 102 | 104 |
| OLD | NEW |