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

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

Issue 11415223: gpu: Allow BufferData size=0 for pixel transfer buffer objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow BufferTracker::Buffer to be created with zero size. Created 8 years, 1 month 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 | « gpu/command_buffer/client/buffer_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 30389fa281a582810a0a090650730048c1a4c846..ec2f7c68c6022198be700192235ca75af7ebaeaa 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -1197,10 +1197,6 @@ void GLES2Implementation::ShaderSource(
void GLES2Implementation::BufferDataHelper(
GLenum target, GLsizeiptr size, const void* data, GLenum usage) {
- if (size == 0) {
- return;
- }
-
if (size < 0) {
SetGLError(GL_INVALID_VALUE, "glBufferData", "size < 0");
return;
@@ -1230,6 +1226,10 @@ void GLES2Implementation::BufferDataHelper(
return;
}
+ if (size == 0) {
+ return;
+ }
+
// If there is no data just send BufferData
if (!data) {
helper_->BufferData(target, size, 0, 0, usage);
« no previous file with comments | « gpu/command_buffer/client/buffer_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698