| Index: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| index f686778137485bd46bc8a6e7538e2283d0369b50..35da67f40da76fd11b87907f8423fba5a535a029 100644
|
| --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
|
| @@ -1447,6 +1447,23 @@ void WebGL2RenderingContextBase::vertexAttribIuivImpl(const char* functionName,
|
| attribValue.value.uintValue[3] = value[3];
|
| }
|
|
|
| +unsigned WebGL2RenderingContextBase::sizeInBytes(GLenum type, bool isIntegerAPI) const
|
| +{
|
| + switch (type) {
|
| + case GL_HALF_FLOAT:
|
| + ASSERT(!isIntegerAPI);
|
| + return sizeof(GLushort);
|
| + case GL_INT_2_10_10_10_REV:
|
| + ASSERT(!isIntegerAPI);
|
| + return sizeof(GLint);
|
| + case GL_UNSIGNED_INT_2_10_10_10_REV:
|
| + ASSERT(!isIntegerAPI);
|
| + return sizeof(GLuint);
|
| + default:
|
| + return WebGLRenderingContextBase::sizeInBytes(type, isIntegerAPI);
|
| + }
|
| +}
|
| +
|
| bool WebGL2RenderingContextBase::validateVertexAttribPointerTypeAndSize(GLenum type, GLint size)
|
| {
|
| switch (type) {
|
| @@ -1511,7 +1528,7 @@ void WebGL2RenderingContextBase::vertexAttribIPointer(GLuint index, GLint size,
|
| synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", "no bound ARRAY_BUFFER");
|
| return;
|
| }
|
| - unsigned typeSize = sizeInBytes(type);
|
| + unsigned typeSize = sizeInBytes(type, true);
|
| ASSERT((typeSize & (typeSize - 1)) == 0); // Ensure that the value is POT.
|
| if ((stride & (typeSize - 1)) || (static_cast<GLintptr>(offset) & (typeSize - 1))) {
|
| synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", "stride or offset not valid for type");
|
|
|