summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-17 03:04:38 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-17 03:04:38 +0000
commitbf0985e7e5509acd1cf907776031df7fdc629d06 (patch)
tree127967929098167c1108aead202d2b41d0c88970 /gpu
parentc95c38f7b2303467f466d9dd86ffdecf8ee06cff (diff)
downloadchromium_src-bf0985e7e5509acd1cf907776031df7fdc629d06.zip
chromium_src-bf0985e7e5509acd1cf907776031df7fdc629d06.tar.gz
chromium_src-bf0985e7e5509acd1cf907776031df7fdc629d06.tar.bz2
Fixes VertexAttribPointer by allowing null (0) to be
passed in. The scary thing is, not setting this causes the GL driver to trash memory Review URL: http://codereview.chromium.org/501072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index f6db34d..620cb5a 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -676,11 +676,11 @@ parse_error::ParseError GLES2DecoderImpl::DoCommand(
GLES2_COMMAND_LIST(GLES2_CMD_OP)
#undef GLES2_CMD_OP
- if (debug()) {
- if (glGetError() != 0) {
- // TODO(gman): Change output to something useful for NaCl.
- printf("GL ERROR b4: %s\n", GetCommandName(command));
- }
+ }
+ if (debug()) {
+ if (glGetError() != 0) {
+ // TODO(gman): Change output to something useful for NaCl.
+ printf("GL ERROR b4: %s\n", GetCommandName(command));
}
}
} else {
@@ -717,6 +717,7 @@ void GLES2DecoderImpl::DoBindBuffer(GLenum target, GLuint buffer) {
bound_element_array_buffer_ = buffer;
break;
default:
+ DCHECK(false); // Validation should prevent us getting here.
break;
}
glBindBuffer(target, buffer);
@@ -875,6 +876,8 @@ parse_error::ParseError GLES2DecoderImpl::HandleShaderSourceImmediate(
parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer(
uint32 immediate_data_size, const gles2::VertexAttribPointer& c) {
+ // TODO(gman): Is this a valid check or does this check have to come
+ // at glDrawElements time.
if (bound_array_buffer_ != 0) {
GLuint indx = c.indx;
GLint size = c.size;
@@ -883,10 +886,6 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer(
GLsizei stride = c.stride;
GLuint offset = c.offset;
const void* ptr = reinterpret_cast<const void*>(c.offset);
- // TODO(gman): Do manual validation.
- if (!ptr) {
- return parse_error::kParseOutOfBounds;
- }
if (!ValidateGLenumVertexAttribType(type) ||
!ValidateGLenumVertexAttribSize(size)) {
SetGLError(GL_INVALID_VALUE);