diff options
Diffstat (limited to 'gpu/command_buffer/common/gles2_cmd_utils.cc')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index aac4b84..9e376270 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -343,7 +343,7 @@ uint32 GLES2Util::ComputeImageDataSize( return height * row_size; } -uint32 GLES2Util::GetGLDataTypeSize(int type) { +uint32 GLES2Util::GetGLDataTypeSizeForUniforms(int type) { switch (type) { case GL_FLOAT: return sizeof(GLfloat); // NOLINT @@ -384,6 +384,24 @@ uint32 GLES2Util::GetGLDataTypeSize(int type) { } } +size_t GLES2Util::GetGLTypeSizeForTexturesAndBuffers(uint32 type) { + switch (type) { + case GL_BYTE: + return sizeof(GLbyte); // NOLINT + case GL_UNSIGNED_BYTE: + return sizeof(GLubyte); // NOLINT + case GL_SHORT: + return sizeof(GLshort); // NOLINT + case GL_UNSIGNED_SHORT: + return sizeof(GLushort); // NOLINT + case GL_FLOAT: + return sizeof(GLfloat); // NOLINT + default: + return 0; + } +} + + } // namespace gles2 } // namespace gpu |