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

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

Issue 1546303002: Command Buffer: add types for vertexAttribPointer against gles3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed zmo@'s feedback: merge some code into this one Created 4 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 | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | no next file » | 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 8744 matching lines...) Expand 10 before | Expand all | Expand 10 after
8755 if (!unsafe_es3_apis_enabled()) 8755 if (!unsafe_es3_apis_enabled())
8756 return error::kUnknownCommand; 8756 return error::kUnknownCommand;
8757 const gles2::cmds::VertexAttribIPointer& c = 8757 const gles2::cmds::VertexAttribIPointer& c =
8758 *static_cast<const gles2::cmds::VertexAttribIPointer*>(cmd_data); 8758 *static_cast<const gles2::cmds::VertexAttribIPointer*>(cmd_data);
8759 8759
8760 if (!state_.bound_array_buffer.get() || 8760 if (!state_.bound_array_buffer.get() ||
8761 state_.bound_array_buffer->IsDeleted()) { 8761 state_.bound_array_buffer->IsDeleted()) {
8762 if (state_.vertex_attrib_manager.get() == 8762 if (state_.vertex_attrib_manager.get() ==
8763 state_.default_vertex_attrib_manager.get()) { 8763 state_.default_vertex_attrib_manager.get()) {
8764 LOCAL_SET_GL_ERROR( 8764 LOCAL_SET_GL_ERROR(
8765 GL_INVALID_VALUE, "glVertexAttribIPointer", "no array buffer bound"); 8765 GL_INVALID_OPERATION,
8766 "glVertexAttribIPointer", "no array buffer bound");
8766 return error::kNoError; 8767 return error::kNoError;
8767 } else if (c.offset != 0) { 8768 } else if (c.offset != 0) {
8768 LOCAL_SET_GL_ERROR( 8769 LOCAL_SET_GL_ERROR(
8769 GL_INVALID_VALUE, 8770 GL_INVALID_OPERATION,
8770 "glVertexAttribIPointer", "client side arrays are not allowed"); 8771 "glVertexAttribIPointer", "client side arrays are not allowed");
8771 return error::kNoError; 8772 return error::kNoError;
8772 } 8773 }
8773 } 8774 }
8774 8775
8775 GLuint indx = c.indx; 8776 GLuint indx = c.indx;
8776 GLint size = c.size; 8777 GLint size = c.size;
8777 GLenum type = c.type; 8778 GLenum type = c.type;
8778 GLsizei stride = c.stride; 8779 GLsizei stride = c.stride;
8779 GLsizei offset = c.offset; 8780 GLsizei offset = c.offset;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
8841 uint32_t immediate_data_size, 8842 uint32_t immediate_data_size,
8842 const void* cmd_data) { 8843 const void* cmd_data) {
8843 const gles2::cmds::VertexAttribPointer& c = 8844 const gles2::cmds::VertexAttribPointer& c =
8844 *static_cast<const gles2::cmds::VertexAttribPointer*>(cmd_data); 8845 *static_cast<const gles2::cmds::VertexAttribPointer*>(cmd_data);
8845 8846
8846 if (!state_.bound_array_buffer.get() || 8847 if (!state_.bound_array_buffer.get() ||
8847 state_.bound_array_buffer->IsDeleted()) { 8848 state_.bound_array_buffer->IsDeleted()) {
8848 if (state_.vertex_attrib_manager.get() == 8849 if (state_.vertex_attrib_manager.get() ==
8849 state_.default_vertex_attrib_manager.get()) { 8850 state_.default_vertex_attrib_manager.get()) {
8850 LOCAL_SET_GL_ERROR( 8851 LOCAL_SET_GL_ERROR(
8851 GL_INVALID_VALUE, "glVertexAttribPointer", "no array buffer bound"); 8852 GL_INVALID_OPERATION,
8853 "glVertexAttribPointer", "no array buffer bound");
8852 return error::kNoError; 8854 return error::kNoError;
8853 } else if (c.offset != 0) { 8855 } else if (c.offset != 0) {
8854 LOCAL_SET_GL_ERROR( 8856 LOCAL_SET_GL_ERROR(
8855 GL_INVALID_VALUE, 8857 GL_INVALID_OPERATION,
8856 "glVertexAttribPointer", "client side arrays are not allowed"); 8858 "glVertexAttribPointer", "client side arrays are not allowed");
8857 return error::kNoError; 8859 return error::kNoError;
8858 } 8860 }
8859 } 8861 }
8860 8862
8861 GLuint indx = c.indx; 8863 GLuint indx = c.indx;
8862 GLint size = c.size; 8864 GLint size = c.size;
8863 GLenum type = c.type; 8865 GLenum type = c.type;
8864 GLboolean normalized = static_cast<GLboolean>(c.normalized); 8866 GLboolean normalized = static_cast<GLboolean>(c.normalized);
8865 GLsizei stride = c.stride; 8867 GLsizei stride = c.stride;
(...skipping 6922 matching lines...) Expand 10 before | Expand all | Expand 10 after
15788 } 15790 }
15789 15791
15790 // Include the auto-generated part of this file. We split this because it means 15792 // Include the auto-generated part of this file. We split this because it means
15791 // we can easily edit the non-auto generated parts right here in this file 15793 // we can easily edit the non-auto generated parts right here in this file
15792 // instead of having to edit some template or the code generator. 15794 // instead of having to edit some template or the code generator.
15793 #include "base/macros.h" 15795 #include "base/macros.h"
15794 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 15796 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
15795 15797
15796 } // namespace gles2 15798 } // namespace gles2
15797 } // namespace gpu 15799 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698