OLD | NEW |
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 10908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10919 const volatile gles2::cmds::VertexAttribIPointer& c = | 10919 const volatile gles2::cmds::VertexAttribIPointer& c = |
10920 *static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data); | 10920 *static_cast<const volatile gles2::cmds::VertexAttribIPointer*>(cmd_data); |
10921 GLuint indx = c.indx; | 10921 GLuint indx = c.indx; |
10922 GLint size = c.size; | 10922 GLint size = c.size; |
10923 GLenum type = c.type; | 10923 GLenum type = c.type; |
10924 GLsizei stride = c.stride; | 10924 GLsizei stride = c.stride; |
10925 GLsizei offset = c.offset; | 10925 GLsizei offset = c.offset; |
10926 | 10926 |
10927 if (!state_.bound_array_buffer.get() || | 10927 if (!state_.bound_array_buffer.get() || |
10928 state_.bound_array_buffer->IsDeleted()) { | 10928 state_.bound_array_buffer->IsDeleted()) { |
10929 if (state_.vertex_attrib_manager.get() == | 10929 if (offset != 0) { |
10930 state_.default_vertex_attrib_manager.get()) { | |
10931 LOCAL_SET_GL_ERROR( | 10930 LOCAL_SET_GL_ERROR( |
10932 GL_INVALID_OPERATION, | 10931 GL_INVALID_OPERATION, "glVertexAttribIPointer", "offset != 0"); |
10933 "glVertexAttribIPointer", "no array buffer bound"); | |
10934 return error::kNoError; | |
10935 } else if (offset != 0) { | |
10936 LOCAL_SET_GL_ERROR( | |
10937 GL_INVALID_OPERATION, | |
10938 "glVertexAttribIPointer", "client side arrays are not allowed"); | |
10939 return error::kNoError; | 10932 return error::kNoError; |
10940 } | 10933 } |
10941 } | 10934 } |
10942 | 10935 |
10943 const void* ptr = reinterpret_cast<const void*>(offset); | 10936 const void* ptr = reinterpret_cast<const void*>(offset); |
10944 if (!validators_->vertex_attrib_i_type.IsValid(type)) { | 10937 if (!validators_->vertex_attrib_i_type.IsValid(type)) { |
10945 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribIPointer", type, "type"); | 10938 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribIPointer", type, "type"); |
10946 return error::kNoError; | 10939 return error::kNoError; |
10947 } | 10940 } |
10948 if (size < 1 || size > 4) { | 10941 if (size < 1 || size > 4) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11012 *static_cast<const volatile gles2::cmds::VertexAttribPointer*>(cmd_data); | 11005 *static_cast<const volatile gles2::cmds::VertexAttribPointer*>(cmd_data); |
11013 GLuint indx = c.indx; | 11006 GLuint indx = c.indx; |
11014 GLint size = c.size; | 11007 GLint size = c.size; |
11015 GLenum type = c.type; | 11008 GLenum type = c.type; |
11016 GLboolean normalized = static_cast<GLboolean>(c.normalized); | 11009 GLboolean normalized = static_cast<GLboolean>(c.normalized); |
11017 GLsizei stride = c.stride; | 11010 GLsizei stride = c.stride; |
11018 GLsizei offset = c.offset; | 11011 GLsizei offset = c.offset; |
11019 | 11012 |
11020 if (!state_.bound_array_buffer.get() || | 11013 if (!state_.bound_array_buffer.get() || |
11021 state_.bound_array_buffer->IsDeleted()) { | 11014 state_.bound_array_buffer->IsDeleted()) { |
11022 if (state_.vertex_attrib_manager.get() == | 11015 if (offset != 0) { |
11023 state_.default_vertex_attrib_manager.get()) { | |
11024 LOCAL_SET_GL_ERROR( | 11016 LOCAL_SET_GL_ERROR( |
11025 GL_INVALID_OPERATION, | 11017 GL_INVALID_OPERATION, "glVertexAttribPointer", "offset != 0"); |
11026 "glVertexAttribPointer", "no array buffer bound"); | |
11027 return error::kNoError; | |
11028 } else if (offset != 0) { | |
11029 LOCAL_SET_GL_ERROR( | |
11030 GL_INVALID_OPERATION, | |
11031 "glVertexAttribPointer", "client side arrays are not allowed"); | |
11032 return error::kNoError; | 11018 return error::kNoError; |
11033 } | 11019 } |
11034 } | 11020 } |
11035 const void* ptr = reinterpret_cast<const void*>(offset); | 11021 const void* ptr = reinterpret_cast<const void*>(offset); |
11036 if (!validators_->vertex_attrib_type.IsValid(type)) { | 11022 if (!validators_->vertex_attrib_type.IsValid(type)) { |
11037 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribPointer", type, "type"); | 11023 LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribPointer", type, "type"); |
11038 return error::kNoError; | 11024 return error::kNoError; |
11039 } | 11025 } |
11040 if (size < 1 || size > 4) { | 11026 if (size < 1 || size > 4) { |
11041 LOCAL_SET_GL_ERROR( | 11027 LOCAL_SET_GL_ERROR( |
(...skipping 8106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19148 } | 19134 } |
19149 | 19135 |
19150 // Include the auto-generated part of this file. We split this because it means | 19136 // Include the auto-generated part of this file. We split this because it means |
19151 // we can easily edit the non-auto generated parts right here in this file | 19137 // we can easily edit the non-auto generated parts right here in this file |
19152 // instead of having to edit some template or the code generator. | 19138 // instead of having to edit some template or the code generator. |
19153 #include "base/macros.h" | 19139 #include "base/macros.h" |
19154 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19140 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19155 | 19141 |
19156 } // namespace gles2 | 19142 } // namespace gles2 |
19157 } // namespace gpu | 19143 } // namespace gpu |
OLD | NEW |