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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 10581029: Make GL_CHROMIUM_consistent_uniform_locations slighty more robust (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 575d180b11a0ad51f42415fd966cf77d3b19c8dc..892d565ea12117cedbb7bbd027537acaebce4163 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -3295,13 +3295,18 @@ class GLUniformDefinitionComparer {
const GLUniformDefinitionCHROMIUM* uniforms_;
};
+
+
} // anonymous namespace.
void GLES2Implementation::GetUniformLocationsCHROMIUM(
+ GLuint program,
const GLUniformDefinitionCHROMIUM* uniforms,
GLsizei count,
GLsizei max_locations,
GLint* locations) {
+ (void)program; // To keep the compiler happy as it's unused in release.
+
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << this << "] glGenUniformLocationsCHROMIUM("
<< static_cast<const void*>(uniforms) << ", " << count << ", "
@@ -3342,9 +3347,23 @@ void GLES2Implementation::GetUniformLocationsCHROMIUM(
if (max_locations <= 0) {
return;
}
- *locations++ = GLES2Util::SwizzleLocation(
+ GLint location = GLES2Util::SwizzleLocation(
GLES2Util::MakeFakeLocation(base_location, jj));
+ *locations++ = location;
+ #if defined(GPU_CLIENT_DEBUG)
+ std::string name(def.name);
+ if (jj > 0) {
+ char buf[20];
+ sprintf(buf, "%d", jj);
+ name = name + "[" + buf + "]";
+ }
+ GPU_DCHECK_EQ(
+ location,
+ share_group_->program_info_manager()->GetUniformLocation(
+ this, program, name.c_str()));
+ #endif
--max_locations;
+
}
}
}
« no previous file with comments | « gpu/command_buffer/client/gles2_c_lib_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698