Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: gpu/command_buffer/service/program_manager.h

Issue 10246004: Clear uniforms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix warning Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 232db9181990c5378f0f0794415d86971d397266..43433f8ea1fc8e1fa6f0f06e705a498615c3a0e2 100644
--- a/gpu/command_buffer/service/program_manager.h
+++ b/gpu/command_buffer/service/program_manager.h
@@ -144,7 +144,7 @@ class GPU_EXPORT ProgramManager {
bool CanLink() const;
// Performs glLinkProgram and related activities.
- void Link();
+ bool Link();
// Performs glValidateProgram and related activities.
void Validate();
@@ -211,6 +211,9 @@ class GPU_EXPORT ProgramManager {
// Updates the program log info from GL
void UpdateLogInfo();
+ // Clears all the uniforms.
+ void ClearUniforms(std::vector<uint8>* zero_buffer);
+
// If long attribate names are mapped during shader translation, call
// glBindAttribLocation() again with the mapped names.
// This is called right before the glLink() call, but after shaders are
@@ -272,6 +275,9 @@ class GPU_EXPORT ProgramManager {
// This is true if glLinkProgram was successful last time it was called.
bool link_status_;
+ // True if the uniforms have been cleared.
+ bool uniforms_cleared_;
+
// Log info
scoped_ptr<std::string> log_info_;
@@ -303,6 +309,9 @@ class GPU_EXPORT ProgramManager {
// Makes a program as unused. If deleted the program info will be removed.
void UnuseProgram(ShaderManager* shader_manager, ProgramInfo* info);
+ // Clears the uniforms for this program.
+ void ClearUniforms(ProgramInfo* info);
+
// Returns true if prefix is invalid for gl.
static bool IsInvalidPrefix(const char* name, size_t length);
@@ -329,6 +338,9 @@ class GPU_EXPORT ProgramManager {
bool have_context_;
+ // Used to clear uniforms.
+ std::vector<uint8> zero_;
+
void RemoveProgramInfoIfUnused(
ShaderManager* shader_manager, ProgramInfo* info);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc ('k') | gpu/command_buffer/service/program_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698