| Index: gpu/command_buffer/service/program_manager.h
|
| diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h
|
| index dbe9c14fa2695770aa1925a14297187507d567ce..af65aea545220316ea5189be0d748a92e6db21ba 100644
|
| --- a/gpu/command_buffer/service/program_manager.h
|
| +++ b/gpu/command_buffer/service/program_manager.h
|
| @@ -39,6 +39,7 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
| };
|
|
|
| enum UniformApiType {
|
| + kUniformNone = 0,
|
| kUniform1i = 1 << 0,
|
| kUniform2i = 1 << 1,
|
| kUniform3i = 1 << 2,
|
| @@ -95,6 +96,7 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
| typedef std::vector<VertexAttrib> AttribInfoVector;
|
| typedef std::vector<int> SamplerIndices;
|
| typedef std::map<std::string, GLint> LocationMap;
|
| + typedef base::hash_map<GLint, GLenum> SubscriptionMap;
|
|
|
| Program(ProgramManager* manager, GLuint service_id);
|
|
|
| @@ -191,6 +193,11 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
| return use_count_ != 0;
|
| }
|
|
|
| + void SetNeedsUpdateSubscriptions();
|
| + bool needs_update_subscriptions() const {
|
| + return needs_update_subscriptions_;
|
| + }
|
| +
|
| // Sets attribute-location binding from a glBindAttribLocation() call.
|
| void SetAttribLocationBinding(const std::string& attrib, GLint location) {
|
| bind_attrib_location_map_[attrib] = location;
|
| @@ -226,11 +233,18 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
| // varying registers.
|
| bool CheckVaryingsPacking(VaryingsPackingOption option) const;
|
|
|
| + // Subscribe uniform |location| to |target|
|
| + void AddSubscription(GLint location, GLenum target);
|
| + // Unsubscribes uniform |location| for any targets
|
| + void RemoveSubscription(GLint location);
|
| +
|
| // Visible for testing
|
| const LocationMap& bind_attrib_location_map() const {
|
| return bind_attrib_location_map_;
|
| }
|
|
|
| + const SubscriptionMap& subscription_map() const { return subscription_map_; }
|
| +
|
| private:
|
| friend class base::RefCounted<Program>;
|
| friend class ProgramManager;
|
| @@ -348,6 +362,9 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
| // True if the uniforms have been cleared.
|
| bool uniforms_cleared_;
|
|
|
| + // True if one or more subscription uniforms are out of date
|
| + bool needs_update_subscriptions_;
|
| +
|
| // This is different than uniform_infos_.size() because
|
| // that is a sparce array.
|
| GLint num_uniforms_;
|
| @@ -360,6 +377,8 @@ class GPU_EXPORT Program : public base::RefCounted<Program> {
|
|
|
| // uniform-location binding map from glBindUniformLocationCHROMIUM() calls.
|
| LocationMap bind_uniform_location_map_;
|
| +
|
| + SubscriptionMap subscription_map_;
|
| };
|
|
|
| // Tracks the Programs.
|
| @@ -405,8 +424,13 @@ class GPU_EXPORT ProgramManager {
|
| // Check if a Program is owned by this ProgramManager.
|
| bool IsOwned(Program* program);
|
|
|
| + // Update the active_state of the subscriptions
|
| + void ActivateUniformSubscriptionState();
|
| +
|
| static int32 MakeFakeLocation(int32 index, int32 element);
|
|
|
| + static Program::UniformApiType ApiTypeForSubscriptionTarget(GLenum target);
|
| +
|
| uint32 max_varying_vectors() const {
|
| return max_varying_vectors_;
|
| }
|
|
|