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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2610393003: Fix the bug for VertexAttrib{I}Pointer when no array buffer bound (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 10891 matching lines...) Expand 10 before | Expand all | Expand 10 after
10902 GLuint indx = c.indx; 10902 GLuint indx = c.indx;
10903 GLint size = c.size; 10903 GLint size = c.size;
10904 GLenum type = c.type; 10904 GLenum type = c.type;
10905 GLsizei stride = c.stride; 10905 GLsizei stride = c.stride;
10906 GLsizei offset = c.offset; 10906 GLsizei offset = c.offset;
10907 10907
10908 if (!state_.bound_array_buffer.get() || 10908 if (!state_.bound_array_buffer.get() ||
10909 state_.bound_array_buffer->IsDeleted()) { 10909 state_.bound_array_buffer->IsDeleted()) {
10910 if (state_.vertex_attrib_manager.get() == 10910 if (state_.vertex_attrib_manager.get() ==
10911 state_.default_vertex_attrib_manager.get()) { 10911 state_.default_vertex_attrib_manager.get()) {
10912 LOCAL_SET_GL_ERROR( 10912 if (offset != 0) {
Zhenyao Mo 2017/01/09 18:21:15 I think you can combine this and the else to a sim
yunchao 2017/01/10 14:10:11 Done.
10913 GL_INVALID_OPERATION, 10913 LOCAL_SET_GL_ERROR(
10914 "glVertexAttribIPointer", "no array buffer bound"); 10914 GL_INVALID_OPERATION,
10915 return error::kNoError; 10915 "glVertexAttribIPointer",
10916 "no array buffer is bound and offset is non-zero");
10917 return error::kNoError;
10918 }
10916 } else if (offset != 0) { 10919 } else if (offset != 0) {
10917 LOCAL_SET_GL_ERROR( 10920 LOCAL_SET_GL_ERROR(
10918 GL_INVALID_OPERATION, 10921 GL_INVALID_OPERATION,
10919 "glVertexAttribIPointer", "client side arrays are not allowed"); 10922 "glVertexAttribIPointer", "client side arrays are not allowed");
10920 return error::kNoError; 10923 return error::kNoError;
10921 } 10924 }
10922 } 10925 }
10923 10926
10924 const void* ptr = reinterpret_cast<const void*>(offset); 10927 const void* ptr = reinterpret_cast<const void*>(offset);
10925 if (!validators_->vertex_attrib_i_type.IsValid(type)) { 10928 if (!validators_->vertex_attrib_i_type.IsValid(type)) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
10995 GLint size = c.size; 10998 GLint size = c.size;
10996 GLenum type = c.type; 10999 GLenum type = c.type;
10997 GLboolean normalized = static_cast<GLboolean>(c.normalized); 11000 GLboolean normalized = static_cast<GLboolean>(c.normalized);
10998 GLsizei stride = c.stride; 11001 GLsizei stride = c.stride;
10999 GLsizei offset = c.offset; 11002 GLsizei offset = c.offset;
11000 11003
11001 if (!state_.bound_array_buffer.get() || 11004 if (!state_.bound_array_buffer.get() ||
11002 state_.bound_array_buffer->IsDeleted()) { 11005 state_.bound_array_buffer->IsDeleted()) {
11003 if (state_.vertex_attrib_manager.get() == 11006 if (state_.vertex_attrib_manager.get() ==
11004 state_.default_vertex_attrib_manager.get()) { 11007 state_.default_vertex_attrib_manager.get()) {
11005 LOCAL_SET_GL_ERROR( 11008 if (offset != 0) {
Zhenyao Mo 2017/01/09 18:21:15 Same here.
yunchao 2017/01/10 14:10:11 Done.
11006 GL_INVALID_OPERATION, 11009 LOCAL_SET_GL_ERROR(
11007 "glVertexAttribPointer", "no array buffer bound"); 11010 GL_INVALID_OPERATION,
11008 return error::kNoError; 11011 "glVertexAttribPointer",
11012 "no array buffer is bound and offset is non-zero");
11013 return error::kNoError;
11014 }
11009 } else if (offset != 0) { 11015 } else if (offset != 0) {
11010 LOCAL_SET_GL_ERROR( 11016 LOCAL_SET_GL_ERROR(
11011 GL_INVALID_OPERATION, 11017 GL_INVALID_OPERATION,
11012 "glVertexAttribPointer", "client side arrays are not allowed"); 11018 "glVertexAttribPointer", "client side arrays are not allowed");
11013 return error::kNoError; 11019 return error::kNoError;
11014 } 11020 }
11015 } 11021 }
11016 const void* ptr = reinterpret_cast<const void*>(offset); 11022 const void* ptr = reinterpret_cast<const void*>(offset);
11017 if (!validators_->vertex_attrib_type.IsValid(type)) { 11023 if (!validators_->vertex_attrib_type.IsValid(type)) {
11018 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribPointer", type, "type"); 11024 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribPointer", type, "type");
(...skipping 8099 matching lines...) Expand 10 before | Expand all | Expand 10 after
19118 } 19124 }
19119 19125
19120 // Include the auto-generated part of this file. We split this because it means 19126 // Include the auto-generated part of this file. We split this because it means
19121 // we can easily edit the non-auto generated parts right here in this file 19127 // we can easily edit the non-auto generated parts right here in this file
19122 // instead of having to edit some template or the code generator. 19128 // instead of having to edit some template or the code generator.
19123 #include "base/macros.h" 19129 #include "base/macros.h"
19124 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 19130 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
19125 19131
19126 } // namespace gles2 19132 } // namespace gles2
19127 } // namespace gpu 19133 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698