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 7cfd619db6c863d5bdcb01e239d49562bad9dadb..bd9f5e3c7d7b920393ffdb6a3b7a2437ae5b7e71 100644 |
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp |
@@ -1527,6 +1527,11 @@ void WebGL2RenderingContextBase::drawArraysInstanced(GLenum mode, GLint first, G |
if (!validateDrawArrays("drawArraysInstanced")) |
return; |
+ if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "drawArraysInstanced", "no buffer is bound to enabled attribute"); |
+ return; |
+ } |
+ |
ScopedRGBEmulationColorMask emulationColorMask(contextGL(), m_colorMask, m_drawingBuffer.get()); |
clearIfComposited(); |
contextGL()->DrawArraysInstancedANGLE(mode, first, count, instanceCount); |
@@ -1538,6 +1543,11 @@ void WebGL2RenderingContextBase::drawElementsInstanced(GLenum mode, GLsizei coun |
if (!validateDrawElements("drawElementsInstanced", type, offset)) |
return; |
+ if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "drawElementsInstanced", "no buffer is bound to enabled attribute"); |
+ return; |
+ } |
+ |
if (transformFeedbackActive() && !transformFeedbackPaused()) { |
synthesizeGLError(GL_INVALID_OPERATION, "drawElementsInstanced", "transform feedback is active and not paused"); |
return; |
@@ -1554,6 +1564,11 @@ void WebGL2RenderingContextBase::drawRangeElements(GLenum mode, GLuint start, GL |
if (!validateDrawElements("drawRangeElements", type, offset)) |
return; |
+ if (!m_boundVertexArrayObject->isAllEnabledAttribBufferBound()) { |
+ synthesizeGLError(GL_INVALID_OPERATION, "drawRangeElements", "no buffer is bound to enabled attribute"); |
+ return; |
+ } |
+ |
if (transformFeedbackActive() && !transformFeedbackPaused()) { |
synthesizeGLError(GL_INVALID_OPERATION, "drawRangeElements", "transform feedback is active and not paused"); |
return; |