From 1c3daa9c13b2f49a7ea9d00e6c856f5af525db10 Mon Sep 17 00:00:00 2001 From: Guillaume Abadie Date: Tue, 10 Jun 2014 17:23:49 -0700 Subject: [PATCH] Bug 1022272 - Lets WebGL's draw{Arrays,Elements}() generate INVALID_OPERATION when all vertex attributes' divisor are different of 0 - r=jgilbert --- content/canvas/src/WebGLContextDraw.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/content/canvas/src/WebGLContextDraw.cpp b/content/canvas/src/WebGLContextDraw.cpp index c6f093267e2..97ac5b9bd32 100644 --- a/content/canvas/src/WebGLContextDraw.cpp +++ b/content/canvas/src/WebGLContextDraw.cpp @@ -111,6 +111,11 @@ bool WebGLContext::DrawArrays_check(GLint first, GLsizei count, GLsizei primcoun if (!DoFakeVertexAttrib0(checked_firstPlusCount.value())) { return false; } + + if (!DrawInstanced_check(info)) { + return false; + } + BindFakeBlackTextures(); return true; @@ -146,9 +151,6 @@ WebGLContext::DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsiz if (!DrawArrays_check(first, count, primcount, "drawArraysInstanced")) return; - if (!DrawInstanced_check("drawArraysInstanced")) - return; - RunContextLossTimer(); gl->fDrawArraysInstanced(mode, first, count, primcount); @@ -282,6 +284,11 @@ WebGLContext::DrawElements_check(GLsizei count, GLenum type, if (!DoFakeVertexAttrib0(mMaxFetchedVertices)) { return false; } + + if (!DrawInstanced_check(info)) { + return false; + } + BindFakeBlackTextures(); return true; @@ -329,9 +336,6 @@ WebGLContext::DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, if (!DrawElements_check(count, type, byteOffset, primcount, "drawElementsInstanced")) return; - if (!DrawInstanced_check("drawElementsInstanced")) - return; - RunContextLossTimer(); gl->fDrawElementsInstanced(mode, count, type, reinterpret_cast(byteOffset), primcount);