| 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/vertex_attrib_manager.h" | 5 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // Validate all attribs currently enabled. If they are used by the current | 183 // Validate all attribs currently enabled. If they are used by the current |
| 184 // program then check that they have enough elements to handle the draw call. | 184 // program then check that they have enough elements to handle the draw call. |
| 185 // If they are not used by the current program check that they have a buffer | 185 // If they are not used by the current program check that they have a buffer |
| 186 // assigned. | 186 // assigned. |
| 187 for (VertexAttribList::iterator it = enabled_vertex_attribs_.begin(); | 187 for (VertexAttribList::iterator it = enabled_vertex_attribs_.begin(); |
| 188 it != enabled_vertex_attribs_.end(); ++it) { | 188 it != enabled_vertex_attribs_.end(); ++it) { |
| 189 VertexAttrib* attrib = *it; | 189 VertexAttrib* attrib = *it; |
| 190 const Program::VertexAttrib* attrib_info = | 190 const Program::VertexAttrib* attrib_info = |
| 191 current_program->GetAttribInfoByLocation(attrib->index()); | 191 current_program->GetAttribInfoByLocation(attrib->index()); |
| 192 if (attrib_info) { | 192 if (attrib_info) { |
| 193 divisor0 |= (attrib->divisor() == 0); | 193 divisor0 |= (current_program->GetAttribDivisorByLocation( |
| 194 attrib->index()) == 0); |
| 194 have_enabled_active_attribs = true; | 195 have_enabled_active_attribs = true; |
| 195 GLuint count = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); | 196 GLuint count = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); |
| 196 // This attrib is used in the current program. | 197 // This attrib is used in the current program. |
| 197 if (!attrib->CanAccess(count)) { | 198 if (!attrib->CanAccess(count)) { |
| 198 ERRORSTATE_SET_GL_ERROR( | 199 ERRORSTATE_SET_GL_ERROR( |
| 199 error_state, GL_INVALID_OPERATION, function_name, | 200 error_state, GL_INVALID_OPERATION, function_name, |
| 200 (std::string( | 201 (std::string( |
| 201 "attempt to access out of range vertices in attribute ") + | 202 "attempt to access out of range vertices in attribute ") + |
| 202 base::UintToString(attrib->index())).c_str()); | 203 base::UintToString(attrib->index())).c_str()); |
| 203 return false; | 204 return false; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (current_buffer_id != kInitialBufferId) { | 276 if (current_buffer_id != kInitialBufferId) { |
| 276 // Restore the buffer binding. | 277 // Restore the buffer binding. |
| 277 decoder->RestoreBufferBindings(); | 278 decoder->RestoreBufferBindings(); |
| 278 } | 279 } |
| 279 | 280 |
| 280 return true; | 281 return true; |
| 281 } | 282 } |
| 282 | 283 |
| 283 } // namespace gles2 | 284 } // namespace gles2 |
| 284 } // namespace gpu | 285 } // namespace gpu |
| OLD | NEW |