Bug 1414977 - Skip DrawElements if !indexCount, not !lastVert. - r=daoshengmu

MozReview-Commit-ID: KaGFV374G5
This commit is contained in:
Jeff Gilbert 2017-11-06 15:29:16 -08:00
parent 95abd6e7a0
commit da2b4b335a

View File

@ -741,7 +741,7 @@ WebGLContext::DrawElements(GLenum mode, GLsizei indexCount, GLenum type,
errorScope.reset(new gl::GLContext::LocalErrorScope(*gl));
}
if (lastVert) {
if (indexCount) {
AUTO_PROFILER_LABEL("glDrawElements", GRAPHICS);
gl->fDrawElements(mode, indexCount, type,
reinterpret_cast<GLvoid*>(byteOffset));
@ -793,7 +793,7 @@ WebGLContext::DrawElementsInstanced(GLenum mode, GLsizei indexCount, GLenum type
errorScope.reset(new gl::GLContext::LocalErrorScope(*gl));
}
if (lastVert && instanceCount) {
if (indexCount && instanceCount) {
AUTO_PROFILER_LABEL("glDrawElementsInstanced", GRAPHICS);
gl->fDrawElementsInstanced(mode, indexCount, type,
reinterpret_cast<GLvoid*>(byteOffset),