summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils.cc1
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils_unittest.cc3
2 files changed, 4 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc
index 648dbb1..296d025 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils.cc
@@ -348,6 +348,7 @@ int BytesPerElement(int type) {
switch (type) {
case GL_FLOAT:
case GL_UNSIGNED_INT_24_8_OES:
+ case GL_UNSIGNED_INT:
return 4;
case GL_HALF_FLOAT_OES:
case GL_UNSIGNED_SHORT:
diff --git a/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc b/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
index 1fcc9a8..567e9a6 100644
--- a/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
+++ b/gpu/command_buffer/common/gles2_cmd_utils_unittest.cc
@@ -81,6 +81,9 @@ TEST_F(GLES2UtilTest, ComputeImageDataSizeTypes) {
EXPECT_TRUE(GLES2Util::ComputeImageDataSize(
kWidth, kHeight, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 1, &size));
EXPECT_EQ(kWidth * kHeight * 2, size);
+ EXPECT_TRUE(GLES2Util::ComputeImageDataSize(
+ kWidth, kHeight, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 1, &size));
+ EXPECT_EQ(kWidth * kHeight * 4, size);
}
TEST_F(GLES2UtilTest, ComputeImageDataSizeUnpackAlignment) {