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_CLIENT_PROGRAM_INFO_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ |
7 | 7 |
8 #include <GLES3/gl3.h> | 8 #include <GLES3/gl3.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 kES3TransformFeedbackVaryings, | 99 kES3TransformFeedbackVaryings, |
100 kES3Uniformsiv, | 100 kES3Uniformsiv, |
101 kNone, | 101 kNone, |
102 }; | 102 }; |
103 | 103 |
104 // Need GLES2_IMPL_EXPORT for tests. | 104 // Need GLES2_IMPL_EXPORT for tests. |
105 class GLES2_IMPL_EXPORT Program { | 105 class GLES2_IMPL_EXPORT Program { |
106 public: | 106 public: |
107 struct UniformInfo { | 107 struct UniformInfo { |
108 UniformInfo(GLsizei _size, GLenum _type, const std::string& _name); | 108 UniformInfo(GLsizei _size, GLenum _type, const std::string& _name); |
| 109 UniformInfo(const UniformInfo& other); |
109 ~UniformInfo(); | 110 ~UniformInfo(); |
110 | 111 |
111 GLsizei size; | 112 GLsizei size; |
112 GLenum type; | 113 GLenum type; |
113 bool is_array; | 114 bool is_array; |
114 std::string name; | 115 std::string name; |
115 std::vector<GLint> element_locations; | 116 std::vector<GLint> element_locations; |
116 }; | 117 }; |
117 struct UniformES3 { | 118 struct UniformES3 { |
118 UniformES3(); | 119 UniformES3(); |
(...skipping 10 matching lines...) Expand all Loading... |
129 GLint _location); | 130 GLint _location); |
130 ~VertexAttrib(); | 131 ~VertexAttrib(); |
131 | 132 |
132 GLsizei size; | 133 GLsizei size; |
133 GLenum type; | 134 GLenum type; |
134 GLint location; | 135 GLint location; |
135 std::string name; | 136 std::string name; |
136 }; | 137 }; |
137 struct UniformBlock { | 138 struct UniformBlock { |
138 UniformBlock(); | 139 UniformBlock(); |
| 140 UniformBlock(const UniformBlock& other); |
139 ~UniformBlock(); | 141 ~UniformBlock(); |
140 | 142 |
141 GLuint binding; | 143 GLuint binding; |
142 GLuint data_size; | 144 GLuint data_size; |
143 std::vector<GLuint> active_uniform_indices; | 145 std::vector<GLuint> active_uniform_indices; |
144 GLboolean referenced_by_vertex_shader; | 146 GLboolean referenced_by_vertex_shader; |
145 GLboolean referenced_by_fragment_shader; | 147 GLboolean referenced_by_fragment_shader; |
146 std::string name; | 148 std::string name; |
147 }; | 149 }; |
148 struct TransformFeedbackVarying { | 150 struct TransformFeedbackVarying { |
149 TransformFeedbackVarying(); | 151 TransformFeedbackVarying(); |
150 ~TransformFeedbackVarying(); | 152 ~TransformFeedbackVarying(); |
151 | 153 |
152 GLsizei size; | 154 GLsizei size; |
153 GLenum type; | 155 GLenum type; |
154 std::string name; | 156 std::string name; |
155 }; | 157 }; |
156 | 158 |
157 Program(); | 159 Program(); |
| 160 Program(const Program& other); |
158 ~Program(); | 161 ~Program(); |
159 | 162 |
160 const VertexAttrib* GetAttribInfo(GLint index) const; | 163 const VertexAttrib* GetAttribInfo(GLint index) const; |
161 | 164 |
162 GLint GetAttribLocation(const std::string& name) const; | 165 GLint GetAttribLocation(const std::string& name) const; |
163 | 166 |
164 const UniformInfo* GetUniformInfo(GLint index) const; | 167 const UniformInfo* GetUniformInfo(GLint index) const; |
165 | 168 |
166 // Gets the location of a uniform by name. | 169 // Gets the location of a uniform by name. |
167 GLint GetUniformLocation(const std::string& name) const; | 170 GLint GetUniformLocation(const std::string& name) const; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 253 |
251 ProgramInfoMap program_infos_; | 254 ProgramInfoMap program_infos_; |
252 | 255 |
253 mutable base::Lock lock_; | 256 mutable base::Lock lock_; |
254 }; | 257 }; |
255 | 258 |
256 } // namespace gles2 | 259 } // namespace gles2 |
257 } // namespace gpu | 260 } // namespace gpu |
258 | 261 |
259 #endif // GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ | 262 #endif // GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ |
OLD | NEW |