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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 1555523002: WebGL: remove validation code for vertexAttribPointer and vertexAttribIPointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix errors found by trybots Created 4 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
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 95cb0ca3bc0b5d8215d6799b3b2831db2b4983a2..ba6ab205af2d6e15de812853346af37cab68c685 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -1406,79 +1406,20 @@ void WebGL2RenderingContextBase::vertexAttribIuivImpl(const char* functionName,
attribValue.value.uintValue[3] = value[3];
}
-bool WebGL2RenderingContextBase::validateVertexAttribPointerTypeAndSize(GLenum type, GLint size)
-{
- switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- case GL_HALF_FLOAT:
- if (size < 1 || size > 4) {
- synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", "invalid size");
- return false;
- }
- return true;
- case GL_INT_2_10_10_10_REV:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- if (size < 1 || size > 4) {
- synthesizeGLError(GL_INVALID_VALUE, "vertexAttribPointer", "invalid size");
- return false;
- }
- if (size != 4) {
- synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribPointer", "size != 4");
- return false;
- }
- return true;
- default:
- synthesizeGLError(GL_INVALID_ENUM, "vertexAttribPointer", "invalid type");
- return false;
- }
-}
-
void WebGL2RenderingContextBase::vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, long long offset)
{
if (isContextLost())
return;
-
- switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- break;
- default:
- synthesizeGLError(GL_INVALID_ENUM, "vertexAttribIPointer", "invalid type");
- return;
- }
if (index >= m_maxVertexAttribs) {
synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer", "index out of range");
return;
}
- if (size < 1 || size > 4 || stride < 0 || stride > 255) {
- synthesizeGLError(GL_INVALID_VALUE, "vertexAttribIPointer", "bad size or stride");
- return;
- }
- if (!validateValueFitNonNegInt32("vertexAttribIPointer", "offset", offset))
- return;
if (!m_boundArrayBuffer) {
synthesizeGLError(GL_INVALID_OPERATION, "vertexAttribIPointer", "no bound ARRAY_BUFFER");
return;
}
- unsigned typeSize = sizeInBytes(type);
- 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");
- return;
- }
- GLsizei bytesPerElement = size * typeSize;
- m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, type, false, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer);
+ m_boundVertexArrayObject->setVertexAttribState(index, m_boundArrayBuffer);
webContext()->vertexAttribIPointer(index, size, type, stride, static_cast<GLintptr>(offset));
}
@@ -1493,7 +1434,6 @@ void WebGL2RenderingContextBase::vertexAttribDivisor(GLuint index, GLuint diviso
return;
}
- m_boundVertexArrayObject->setVertexAttribDivisor(index, divisor);
webContext()->vertexAttribDivisorANGLE(index, divisor);
}

Powered by Google App Engine
This is Rietveld 408576698