| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index f69be1d3ad4d93713bc72bc4bfbaca05be513a1d..420dc6b65f388937b0464362cbafeb9758026994 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -9004,15 +9004,21 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer(
|
| }
|
| GLsizei component_size =
|
| GLES2Util::GetGLTypeSizeForTexturesAndBuffers(type);
|
| - // component_size must be a power of two to use & as optimized modulo.
|
| - DCHECK(GLES2Util::IsPOT(component_size));
|
| - if (offset & (component_size - 1)) {
|
| + GLsizei data_size = component_size;
|
| + if (type == GL_INT_2_10_10_10_REV || type == GL_UNSIGNED_INT_2_10_10_10_REV) {
|
| + // stride/offset should be aligned with group_size for packed types,
|
| + // instead of component_size.
|
| + data_size = component_size * size;
|
| + }
|
| + // data_size must be a power of two to use & as optimized modulo.
|
| + DCHECK(GLES2Util::IsPOT(data_size));
|
| + if (offset & (data_size - 1)) {
|
| LOCAL_SET_GL_ERROR(
|
| GL_INVALID_OPERATION,
|
| "glVertexAttribPointer", "offset not valid for type");
|
| return error::kNoError;
|
| }
|
| - if (stride & (component_size - 1)) {
|
| + if (stride & (data_size - 1)) {
|
| LOCAL_SET_GL_ERROR(
|
| GL_INVALID_OPERATION,
|
| "glVertexAttribPointer", "stride not valid for type");
|
|
|