summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/gles2_implementation.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 23:35:31 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 23:35:31 +0000
commit9e64440a70e0a18ff5b6edcbf10652feb2954b39 (patch)
treec2012f5a29786e7dfd2cdd638bc7f0c1e6da2083 /gpu/command_buffer/client/gles2_implementation.cc
parent891ca0f165421a6d748df275058832d2e9ebecab (diff)
downloadchromium_src-9e64440a70e0a18ff5b6edcbf10652feb2954b39.zip
chromium_src-9e64440a70e0a18ff5b6edcbf10652feb2954b39.tar.gz
chromium_src-9e64440a70e0a18ff5b6edcbf10652feb2954b39.tar.bz2
This CL adds the option to support buffers that are bound
to more than one target. We had originally decided that this would be an disallowed. glBindBuffer(GL_ARRAY_BUFFER, some_buffer_id); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, some_buffer_id); Unfortunately the GLES2 conformance tests require this behavior. This CL makes this behavior possible but it has to be turned on because it means all buffers have to have CPU side backing (not just ELEMENT_ARRAY_BUFFERs) and it means a slowdown for dynamic vertex related stuff like skinning because an extra copy has to be made every time they are updated. So, by default it will be off but we'll come up with some way to turn it on. Al's suggestion is to use eglCreateContext with a custom intialization attribute. My #1 question: What about the name of the command, the name of the constant and the filename the constant is in. Any thoughts? TEST=none BUG=none Review URL: http://codereview.chromium.org/1992008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.cc')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 8e7867c..8d7c57f 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -1340,6 +1340,10 @@ void GLES2Implementation::BindBuffer(GLenum target, GLuint buffer) {
}
void GLES2Implementation::DeleteBuffers(GLsizei n, const GLuint* buffers) {
+ if (n < 0) {
+ SetGLError(GL_INVALID_VALUE, "glDeleteBuffers: n < 0");
+ return;
+ }
buffer_id_handler_->FreeIds(n, buffers);
for (GLsizei ii = 0; ii < n; ++ii) {
if (buffers[ii] == bound_array_buffer_id_) {