| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 bool use_client_side_arrays_for_stream_buffers = feature_info->workarounds( | 195 bool use_client_side_arrays_for_stream_buffers = feature_info->workarounds( |
| 196 ).use_client_side_arrays_for_stream_buffers; | 196 ).use_client_side_arrays_for_stream_buffers; |
| 197 // Validate all attribs currently enabled. If they are used by the current | 197 // Validate all attribs currently enabled. If they are used by the current |
| 198 // program then check that they have enough elements to handle the draw call. | 198 // program then check that they have enough elements to handle the draw call. |
| 199 // If they are not used by the current program check that they have a buffer | 199 // If they are not used by the current program check that they have a buffer |
| 200 // assigned. | 200 // assigned. |
| 201 for (VertexAttribList::iterator it = enabled_vertex_attribs_.begin(); | 201 for (VertexAttribList::iterator it = enabled_vertex_attribs_.begin(); |
| 202 it != enabled_vertex_attribs_.end(); ++it) { | 202 it != enabled_vertex_attribs_.end(); ++it) { |
| 203 VertexAttrib* attrib = *it; | 203 VertexAttrib* attrib = *it; |
| 204 Buffer* buffer = attrib->buffer(); | 204 Buffer* buffer = attrib->buffer(); |
| 205 std::string msg_tag = base::StringPrintf( | |
| 206 "attached to enabled attrib %u", attrib->index()); | |
| 207 if (!buffer_manager->RequestBufferAccess( | 205 if (!buffer_manager->RequestBufferAccess( |
| 208 error_state, buffer, function_name, msg_tag.c_str())) { | 206 error_state, buffer, function_name, |
| 207 "attached to enabled attrib %u", |
| 208 attrib->index())) { |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| 211 const Program::VertexAttrib* attrib_info = | 211 const Program::VertexAttrib* attrib_info = |
| 212 current_program->GetAttribInfoByLocation(attrib->index()); | 212 current_program->GetAttribInfoByLocation(attrib->index()); |
| 213 if (attrib_info) { | 213 if (attrib_info) { |
| 214 divisor0 |= (attrib->divisor() == 0); | 214 divisor0 |= (attrib->divisor() == 0); |
| 215 have_enabled_active_attribs = true; | 215 have_enabled_active_attribs = true; |
| 216 GLuint count = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); | 216 GLuint count = attrib->MaxVertexAccessed(primcount, max_vertex_accessed); |
| 217 // This attrib is used in the current program. | 217 // This attrib is used in the current program. |
| 218 if (!attrib->CanAccess(count)) { | 218 if (!attrib->CanAccess(count)) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 if (current_buffer_id != kInitialBufferId) { | 286 if (current_buffer_id != kInitialBufferId) { |
| 287 // Restore the buffer binding. | 287 // Restore the buffer binding. |
| 288 decoder->RestoreBufferBindings(); | 288 decoder->RestoreBufferBindings(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 return true; | 291 return true; |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace gles2 | 294 } // namespace gles2 |
| 295 } // namespace gpu | 295 } // namespace gpu |
| OLD | NEW |