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

Unified Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 566019: Implements glGetUniformiv and glGetUniformfv. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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/gles2_cmd_decoder.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
===================================================================
--- gpu/command_buffer/common/gles2_cmd_utils.cc (revision 37873)
+++ gpu/command_buffer/common/gles2_cmd_utils.cc (working copy)
@@ -343,6 +343,47 @@
return height * row_size;
}
+uint32 GLES2Util::GetGLDataTypeSize(int type) {
+ switch (type) {
+ case GL_FLOAT:
+ return sizeof(GLfloat); // NOLINT
+ case GL_FLOAT_VEC2:
+ return sizeof(GLfloat) * 2; // NOLINT
+ case GL_FLOAT_VEC3:
+ return sizeof(GLfloat) * 3; // NOLINT
+ case GL_FLOAT_VEC4:
+ return sizeof(GLfloat) * 4; // NOLINT
+ case GL_INT:
+ return sizeof(GLint); // NOLINT
+ case GL_INT_VEC2:
+ return sizeof(GLint) * 2; // NOLINT
+ case GL_INT_VEC3:
+ return sizeof(GLint) * 3; // NOLINT
+ case GL_INT_VEC4:
+ return sizeof(GLint) * 4; // NOLINT
+ case GL_BOOL:
+ return sizeof(GLint); // NOLINT
+ case GL_BOOL_VEC2:
+ return sizeof(GLint) * 1; // NOLINT
+ case GL_BOOL_VEC3:
+ return sizeof(GLint) * 2; // NOLINT
+ case GL_BOOL_VEC4:
+ return sizeof(GLint) * 3; // NOLINT
+ case GL_FLOAT_MAT2:
+ return sizeof(GLfloat) * 2 * 2; // NOLINT
+ case GL_FLOAT_MAT3:
+ return sizeof(GLfloat) * 3 * 3; // NOLINT
+ case GL_FLOAT_MAT4:
+ return sizeof(GLfloat) * 4 * 4; // NOLINT
+ case GL_SAMPLER_2D:
+ return sizeof(GLint); // NOLINT
+ case GL_SAMPLER_CUBE:
+ return sizeof(GLint); // NOLINT
+ default:
+ return 0;
+ }
+}
+
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_utils.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698