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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1131273005: Fine tune vertex attrib commands handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: working Created 5 years, 7 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
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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2ext.h> 9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h> 10 #include <GLES2/gl2extchromium.h>
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 void GLES2Implementation::VertexAttribIPointer( 1551 void GLES2Implementation::VertexAttribIPointer(
1552 GLuint index, GLint size, GLenum type, GLsizei stride, const void* ptr) { 1552 GLuint index, GLint size, GLenum type, GLsizei stride, const void* ptr) {
1553 GPU_CLIENT_SINGLE_THREAD_CHECK(); 1553 GPU_CLIENT_SINGLE_THREAD_CHECK();
1554 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribIPointer(" 1554 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribIPointer("
1555 << index << ", " 1555 << index << ", "
1556 << size << ", " 1556 << size << ", "
1557 << GLES2Util::GetStringVertexAttribIType(type) << ", " 1557 << GLES2Util::GetStringVertexAttribIType(type) << ", "
1558 << stride << ", " 1558 << stride << ", "
1559 << ptr << ")"); 1559 << ptr << ")");
1560 // Record the info on the client side. 1560 // Record the info on the client side.
1561 if (!vertex_array_object_manager_->SetAttribPointer( 1561 if (!vertex_array_object_manager_->SetAttribPointer(bound_array_buffer_id_,
1562 bound_array_buffer_id_, index, size, type, GL_FALSE, stride, ptr)) { 1562 index,
1563 size,
1564 type,
1565 GL_FALSE,
1566 stride,
1567 ptr,
1568 GL_TRUE)) {
1563 SetGLError(GL_INVALID_OPERATION, "glVertexAttribIPointer", 1569 SetGLError(GL_INVALID_OPERATION, "glVertexAttribIPointer",
1564 "client side arrays are not allowed in vertex array objects."); 1570 "client side arrays are not allowed in vertex array objects.");
1565 return; 1571 return;
1566 } 1572 }
1567 if (!support_client_side_arrays_ || bound_array_buffer_id_ != 0) { 1573 if (!support_client_side_arrays_ || bound_array_buffer_id_ != 0) {
1568 // Only report NON client side buffers to the service. 1574 // Only report NON client side buffers to the service.
1569 if (!ValidateOffset("glVertexAttribIPointer", 1575 if (!ValidateOffset("glVertexAttribIPointer",
1570 reinterpret_cast<GLintptr>(ptr))) { 1576 reinterpret_cast<GLintptr>(ptr))) {
1571 return; 1577 return;
1572 } 1578 }
1573 helper_->VertexAttribIPointer(index, size, type, stride, ToGLuint(ptr)); 1579 helper_->VertexAttribIPointer(index, size, type, stride, ToGLuint(ptr));
1574 } 1580 }
1575 CheckGLError(); 1581 CheckGLError();
1576 } 1582 }
1577 1583
1578 void GLES2Implementation::VertexAttribPointer( 1584 void GLES2Implementation::VertexAttribPointer(
1579 GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, 1585 GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride,
1580 const void* ptr) { 1586 const void* ptr) {
1581 GPU_CLIENT_SINGLE_THREAD_CHECK(); 1587 GPU_CLIENT_SINGLE_THREAD_CHECK();
1582 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribPointer(" 1588 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glVertexAttribPointer("
1583 << index << ", " 1589 << index << ", "
1584 << size << ", " 1590 << size << ", "
1585 << GLES2Util::GetStringVertexAttribType(type) << ", " 1591 << GLES2Util::GetStringVertexAttribType(type) << ", "
1586 << GLES2Util::GetStringBool(normalized) << ", " 1592 << GLES2Util::GetStringBool(normalized) << ", "
1587 << stride << ", " 1593 << stride << ", "
1588 << ptr << ")"); 1594 << ptr << ")");
1589 // Record the info on the client side. 1595 // Record the info on the client side.
1590 if (!vertex_array_object_manager_->SetAttribPointer( 1596 if (!vertex_array_object_manager_->SetAttribPointer(bound_array_buffer_id_,
1591 bound_array_buffer_id_, index, size, type, normalized, stride, ptr)) { 1597 index,
1598 size,
1599 type,
1600 normalized,
1601 stride,
1602 ptr,
1603 GL_FALSE)) {
1592 SetGLError(GL_INVALID_OPERATION, "glVertexAttribPointer", 1604 SetGLError(GL_INVALID_OPERATION, "glVertexAttribPointer",
1593 "client side arrays are not allowed in vertex array objects."); 1605 "client side arrays are not allowed in vertex array objects.");
1594 return; 1606 return;
1595 } 1607 }
1596 if (!support_client_side_arrays_ || bound_array_buffer_id_ != 0) { 1608 if (!support_client_side_arrays_ || bound_array_buffer_id_ != 0) {
1597 // Only report NON client side buffers to the service. 1609 // Only report NON client side buffers to the service.
1598 if (!ValidateOffset("glVertexAttribPointer", 1610 if (!ValidateOffset("glVertexAttribPointer",
1599 reinterpret_cast<GLintptr>(ptr))) { 1611 reinterpret_cast<GLintptr>(ptr))) {
1600 return; 1612 return;
1601 } 1613 }
(...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after
5562 CheckGLError(); 5574 CheckGLError();
5563 } 5575 }
5564 5576
5565 // Include the auto-generated part of this file. We split this because it means 5577 // Include the auto-generated part of this file. We split this because it means
5566 // we can easily edit the non-auto generated parts right here in this file 5578 // we can easily edit the non-auto generated parts right here in this file
5567 // instead of having to edit some template or the code generator. 5579 // instead of having to edit some template or the code generator.
5568 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 5580 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
5569 5581
5570 } // namespace gles2 5582 } // namespace gles2
5571 } // namespace gpu 5583 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/vertex_array_object_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698