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

Unified Diff: gpu/command_buffer/client/vertex_array_object_manager.cc

Issue 1708983002: Command buffer: Fix bugs for drawing when the type of vertex attrib is a packed type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/vertex_array_object_manager.cc
diff --git a/gpu/command_buffer/client/vertex_array_object_manager.cc b/gpu/command_buffer/client/vertex_array_object_manager.cc
index b5b083926b0aeaf2612195b4ffa6115e692139ea..315032d34e2ae33e0566077f0cfaca8ce8956d79 100644
--- a/gpu/command_buffer/client/vertex_array_object_manager.cc
+++ b/gpu/command_buffer/client/vertex_array_object_manager.cc
@@ -515,8 +515,7 @@ bool VertexArrayObjectManager::SetupSimulatedClientSideBuffers(
const VertexArrayObject::VertexAttrib& attrib = vertex_attribs[ii];
if (attrib.IsClientSide() && attrib.enabled()) {
size_t bytes_per_element =
- GLES2Util::GetGLTypeSizeForTexturesAndBuffers(attrib.type()) *
- attrib.size();
+ GLES2Util::GetGroupSizeForBufferType(attrib.size(), attrib.type());
GLsizei elements = (primcount && attrib.divisor() > 0) ?
((primcount - 1) / attrib.divisor() + 1) : num_elements;
total_size += RoundUpToMultipleOf4(bytes_per_element * elements);
@@ -532,8 +531,7 @@ bool VertexArrayObjectManager::SetupSimulatedClientSideBuffers(
const VertexArrayObject::VertexAttrib& attrib = vertex_attribs[ii];
if (attrib.IsClientSide() && attrib.enabled()) {
size_t bytes_per_element =
- GLES2Util::GetGLTypeSizeForTexturesAndBuffers(attrib.type()) *
- attrib.size();
+ GLES2Util::GetGroupSizeForBufferType(attrib.size(), attrib.type());
GLsizei real_stride = attrib.stride() ?
attrib.stride() : static_cast<GLsizei>(bytes_per_element);
GLsizei elements = (primcount && attrib.divisor() > 0) ?
@@ -616,8 +614,7 @@ bool VertexArrayObjectManager::SetupSimulatedIndexAndClientSideBuffers(
break;
}
gl_helper->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, element_array_buffer_id_);
- GLsizei bytes_per_element =
- GLES2Util::GetGLTypeSizeForTexturesAndBuffers(type);
+ GLsizei bytes_per_element = GLES2Util::GetGLTypeSizeForBuffers(type);
GLsizei bytes_needed = bytes_per_element * count;
if (bytes_needed > element_array_buffer_size_) {
element_array_buffer_size_ = bytes_needed;
« no previous file with comments | « no previous file | gpu/command_buffer/common/gles2_cmd_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698