| 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 bool GetProgramiv( | 32 bool GetProgramiv( |
| 33 GLES2Implementation* gl, GLuint program, GLenum pname, GLint* params); | 33 GLES2Implementation* gl, GLuint program, GLenum pname, GLint* params); |
| 34 | 34 |
| 35 GLint GetAttribLocation( | 35 GLint GetAttribLocation( |
| 36 GLES2Implementation* gl, GLuint program, const char* name); | 36 GLES2Implementation* gl, GLuint program, const char* name); |
| 37 | 37 |
| 38 GLint GetUniformLocation( | 38 GLint GetUniformLocation( |
| 39 GLES2Implementation* gl, GLuint program, const char* name); | 39 GLES2Implementation* gl, GLuint program, const char* name); |
| 40 | 40 |
| 41 GLint GetFragDataIndex(GLES2Implementation* gl, |
| 42 GLuint program, |
| 43 const char* name); |
| 44 |
| 41 GLint GetFragDataLocation( | 45 GLint GetFragDataLocation( |
| 42 GLES2Implementation* gl, GLuint program, const char* name); | 46 GLES2Implementation* gl, GLuint program, const char* name); |
| 43 | 47 |
| 44 bool GetActiveAttrib( | 48 bool GetActiveAttrib( |
| 45 GLES2Implementation* gl, GLuint program, GLuint index, GLsizei bufsize, | 49 GLES2Implementation* gl, GLuint program, GLuint index, GLsizei bufsize, |
| 46 GLsizei* length, GLint* size, GLenum* type, char* name); | 50 GLsizei* length, GLint* size, GLenum* type, char* name); |
| 47 | 51 |
| 48 bool GetActiveUniform( | 52 bool GetActiveUniform( |
| 49 GLES2Implementation* gl, GLuint program, GLuint index, GLsizei bufsize, | 53 GLES2Implementation* gl, GLuint program, GLuint index, GLsizei bufsize, |
| 50 GLsizei* length, GLint* size, GLenum* type, char* name); | 54 GLsizei* length, GLint* size, GLenum* type, char* name); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 const UniformInfo* GetUniformInfo(GLint index) const; | 163 const UniformInfo* GetUniformInfo(GLint index) const; |
| 160 | 164 |
| 161 // Gets the location of a uniform by name. | 165 // Gets the location of a uniform by name. |
| 162 GLint GetUniformLocation(const std::string& name) const; | 166 GLint GetUniformLocation(const std::string& name) const; |
| 163 // Gets the index of a uniform by name. Return INVALID_INDEX in failure. | 167 // Gets the index of a uniform by name. Return INVALID_INDEX in failure. |
| 164 GLuint GetUniformIndex(const std::string& name) const; | 168 GLuint GetUniformIndex(const std::string& name) const; |
| 165 | 169 |
| 166 bool GetUniformsiv( | 170 bool GetUniformsiv( |
| 167 GLsizei count, const GLuint* indices, GLenum pname, GLint* params); | 171 GLsizei count, const GLuint* indices, GLenum pname, GLint* params); |
| 168 | 172 |
| 173 GLint GetFragDataIndex(const std::string& name) const; |
| 174 void CacheFragDataIndex(const std::string& name, GLint index); |
| 175 |
| 169 GLint GetFragDataLocation(const std::string& name) const; | 176 GLint GetFragDataLocation(const std::string& name) const; |
| 170 void CacheFragDataLocation(const std::string& name, GLint loc); | 177 void CacheFragDataLocation(const std::string& name, GLint loc); |
| 171 | 178 |
| 172 bool GetProgramiv(GLenum pname, GLint* params); | 179 bool GetProgramiv(GLenum pname, GLint* params); |
| 173 | 180 |
| 174 // Gets the index of a uniform block by name. | 181 // Gets the index of a uniform block by name. |
| 175 GLuint GetUniformBlockIndex(const std::string& name) const; | 182 GLuint GetUniformBlockIndex(const std::string& name) const; |
| 176 const UniformBlock* GetUniformBlock(GLuint index) const; | 183 const UniformBlock* GetUniformBlock(GLuint index) const; |
| 177 // Update the binding if the |index| uniform block is in the cache. | 184 // Update the binding if the |index| uniform block is in the cache. |
| 178 void UniformBlockBinding(GLuint index, GLuint binding); | 185 void UniformBlockBinding(GLuint index, GLuint binding); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 uint32_t transform_feedback_varying_max_length_; | 231 uint32_t transform_feedback_varying_max_length_; |
| 225 | 232 |
| 226 // TransformFeedback varyings by index. | 233 // TransformFeedback varyings by index. |
| 227 std::vector<TransformFeedbackVarying> transform_feedback_varyings_; | 234 std::vector<TransformFeedbackVarying> transform_feedback_varyings_; |
| 228 | 235 |
| 229 bool cached_es3_uniformsiv_; | 236 bool cached_es3_uniformsiv_; |
| 230 | 237 |
| 231 std::vector<UniformES3> uniforms_es3_; | 238 std::vector<UniformES3> uniforms_es3_; |
| 232 | 239 |
| 233 base::hash_map<std::string, GLint> frag_data_locations_; | 240 base::hash_map<std::string, GLint> frag_data_locations_; |
| 241 base::hash_map<std::string, GLint> frag_data_indices_; |
| 234 }; | 242 }; |
| 235 | 243 |
| 236 Program* GetProgramInfo( | 244 Program* GetProgramInfo( |
| 237 GLES2Implementation* gl, GLuint program, ProgramInfoType type); | 245 GLES2Implementation* gl, GLuint program, ProgramInfoType type); |
| 238 | 246 |
| 239 typedef base::hash_map<GLuint, Program> ProgramInfoMap; | 247 typedef base::hash_map<GLuint, Program> ProgramInfoMap; |
| 240 | 248 |
| 241 ProgramInfoMap program_infos_; | 249 ProgramInfoMap program_infos_; |
| 242 | 250 |
| 243 mutable base::Lock lock_; | 251 mutable base::Lock lock_; |
| 244 }; | 252 }; |
| 245 | 253 |
| 246 } // namespace gles2 | 254 } // namespace gles2 |
| 247 } // namespace gpu | 255 } // namespace gpu |
| 248 | 256 |
| 249 #endif // GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ | 257 #endif // GPU_COMMAND_BUFFER_CLIENT_PROGRAM_INFO_MANAGER_H_ |
| OLD | NEW |