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

Unified Diff: gpu/command_buffer/common/gles2_cmd_utils.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 | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_utils.cc
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 0011053ad2d63e0892e809baf6c74e1feb57d83b..bc39543385e9725f149da6809caa2b367e414b95 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -795,7 +795,7 @@ uint32_t GLES2Util::GetElementCountForUniformType(int type) {
}
}
-size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32_t type) {
+size_t GLES2Util::GetGLTypeSizeForBuffers(uint32_t type) {
switch (type) {
case GL_BYTE:
return sizeof(GLbyte); // NOLINT
@@ -824,6 +824,15 @@ size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32_t type) {
}
}
+size_t GLES2Util::GetGroupSizeForBufferType(uint32_t count, uint32_t type) {
+ size_t type_size = GetGLTypeSizeForBuffers(type);
+ // For packed types, group size equals to the type size.
+ if (type == GL_INT_2_10_10_10_REV || type == GL_UNSIGNED_INT_2_10_10_10_REV) {
+ DCHECK_EQ(4u, count);
+ return type_size;
+ }
+ return type_size * count;
+}
size_t GLES2Util::GetComponentCountForGLTransformType(uint32_t type) {
switch (type) {
case GL_TRANSLATE_X_CHROMIUM:
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698