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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 10268004: Merge 131538 - Always write data to new buffer in SimulateAttrib0 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder.cc (revision 134510)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -5068,21 +5068,22 @@
CopyRealGLErrorsToWrapper();
glBindBuffer(GL_ARRAY_BUFFER, attrib_0_buffer_id_);
- if (static_cast<GLsizei>(size_needed) > attrib_0_size_) {
+ bool new_buffer = static_cast<GLsizei>(size_needed) > attrib_0_size_;
+ if (new_buffer) {
glBufferData(GL_ARRAY_BUFFER, size_needed, NULL, GL_DYNAMIC_DRAW);
GLenum error = glGetError();
if (error != GL_NO_ERROR) {
SetGLError(GL_OUT_OF_MEMORY, "glDrawXXX: Simulating attrib 0");
return false;
}
- attrib_0_buffer_matches_value_ = false;
}
- if (attrib_0_used &&
- (!attrib_0_buffer_matches_value_ ||
- (info->value().v[0] != attrib_0_value_.v[0] ||
- info->value().v[1] != attrib_0_value_.v[1] ||
- info->value().v[2] != attrib_0_value_.v[2] ||
- info->value().v[3] != attrib_0_value_.v[3]))) {
+ if (new_buffer ||
+ (attrib_0_used &&
+ (!attrib_0_buffer_matches_value_ ||
+ (info->value().v[0] != attrib_0_value_.v[0] ||
+ info->value().v[1] != attrib_0_value_.v[1] ||
+ info->value().v[2] != attrib_0_value_.v[2] ||
+ info->value().v[3] != attrib_0_value_.v[3])))) {
std::vector<Vec4> temp(num_vertices, info->value());
glBufferSubData(GL_ARRAY_BUFFER, 0, size_needed, &temp[0].v[0]);
attrib_0_buffer_matches_value_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698