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

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

Issue 501072: Fixes VertexAttribPointer by allowing null (0) to be... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 34726)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -676,11 +676,11 @@
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 @@
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::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 @@
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);
« 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