Index: gpu/command_buffer/client/program_info_manager.h |
diff --git a/gpu/command_buffer/client/program_info_manager.h b/gpu/command_buffer/client/program_info_manager.h |
index efbff73f08423072061b687f35d0810fbbdcf484..6f8a745c0b89d9af2106f1500d148842afad799f 100644 |
--- a/gpu/command_buffer/client/program_info_manager.h |
+++ b/gpu/command_buffer/client/program_info_manager.h |
@@ -60,14 +60,39 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
GLES2Implementation* gl, GLuint program, GLuint index, |
GLenum pname, GLint* params); |
+ // Attempt to update the |index| uniform block binding. |
+ // It's no op if the program does not exist, or the |index| uniform block |
+ // is not in the cache, or binding >= GL_MAX_UNIFORM_BUFFER_BINDINGS. |
+ void UniformBlockBinding( |
+ GLES2Implementation* gl, GLuint program, GLuint index, GLuint binding); |
+ |
+ bool GetTransformFeedbackVarying( |
+ GLES2Implementation* gl, GLuint program, GLuint index, GLsizei bufsize, |
+ GLsizei* length, GLsizei* size, GLenum* type, char* name); |
+ |
+ bool GetUniformIndices( |
+ GLES2Implementation* gl, GLuint program, GLsizei count, |
+ const char* const* names, GLuint* indices); |
+ |
+ bool GetActiveUniformsiv( |
+ GLES2Implementation* gl, GLuint program, GLsizei count, |
+ const GLuint* indices, GLenum pname, GLint* params); |
+ |
private: |
friend class ProgramInfoManagerTest; |
+ FRIEND_TEST_ALL_PREFIXES(ProgramInfoManagerTest, UpdateES2); |
FRIEND_TEST_ALL_PREFIXES(ProgramInfoManagerTest, UpdateES3UniformBlocks); |
+ FRIEND_TEST_ALL_PREFIXES(ProgramInfoManagerTest, |
+ UpdateES3TransformFeedbackVaryings); |
+ FRIEND_TEST_ALL_PREFIXES(ProgramInfoManagerTest, |
+ GetActiveUniformsivCached); |
enum ProgramInfoType { |
kES2, |
kES3UniformBlocks, |
+ kES3TransformFeedbackVaryings, |
+ kES3Uniformsiv, |
kNone, |
}; |
@@ -84,6 +109,16 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
std::string name; |
std::vector<GLint> element_locations; |
}; |
+ struct UniformES3 { |
+ UniformES3(); |
+ ~UniformES3(); |
+ |
+ GLint block_index; |
+ GLint offset; |
+ GLint array_stride; |
+ GLint matrix_stride; |
+ GLint is_row_major; |
+ }; |
struct VertexAttrib { |
VertexAttrib(GLsizei _size, GLenum _type, const std::string& _name, |
GLint _location); |
@@ -105,6 +140,14 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
GLboolean referenced_by_fragment_shader; |
std::string name; |
}; |
+ struct TransformFeedbackVarying { |
+ TransformFeedbackVarying(); |
+ ~TransformFeedbackVarying(); |
+ |
+ GLsizei size; |
+ GLenum type; |
+ std::string name; |
+ }; |
Program(); |
~Program(); |
@@ -117,6 +160,11 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
// Gets the location of a uniform by name. |
GLint GetUniformLocation(const std::string& name) const; |
+ // Gets the index of a uniform by name. Return INVALID_INDEX in failure. |
+ GLuint GetUniformIndex(const std::string& name) const; |
+ |
+ bool GetUniformsiv( |
+ GLsizei count, const GLuint* indices, GLenum pname, GLint* params); |
GLint GetFragDataLocation(const std::string& name) const; |
void CacheFragDataLocation(const std::string& name, GLint loc); |
@@ -126,6 +174,11 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
// Gets the index of a uniform block by name. |
GLuint GetUniformBlockIndex(const std::string& name) const; |
const UniformBlock* GetUniformBlock(GLuint index) const; |
+ // Update the binding if the |index| uniform block is in the cache. |
+ void UniformBlockBinding(GLuint index, GLuint binding); |
+ |
+ const TransformFeedbackVarying* GetTransformFeedbackVarying( |
+ GLuint index) const; |
// Updates the ES2 only program info after a successful link. |
void UpdateES2(const std::vector<int8>& result); |
@@ -133,6 +186,12 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
// Updates the ES3 UniformBlock info after a successful link. |
void UpdateES3UniformBlocks(const std::vector<int8>& result); |
+ // Updates the ES3 Uniformsiv info after a successful link. |
+ void UpdateES3Uniformsiv(const std::vector<int8>& result); |
+ |
+ // Updates the ES3 TransformFeedbackVaryings info after a successful link. |
+ void UpdateES3TransformFeedbackVaryings(const std::vector<int8>& result); |
+ |
bool IsCached(ProgramInfoType type) const; |
private: |
@@ -160,6 +219,17 @@ class GLES2_IMPL_EXPORT ProgramInfoManager { |
// Uniform blocks by index. |
std::vector<UniformBlock> uniform_blocks_; |
+ bool cached_es3_transform_feedback_varyings_; |
+ |
+ uint32_t transform_feedback_varying_max_length_; |
+ |
+ // TransformFeedback varyings by index. |
+ std::vector<TransformFeedbackVarying> transform_feedback_varyings_; |
+ |
+ bool cached_es3_uniformsiv_; |
+ |
+ std::vector<UniformES3> uniforms_es3_; |
+ |
base::hash_map<std::string, GLint> frag_data_locations_; |
}; |