Bug 1495857 - Ensure correct vertex attrib array index is output in error message r=jgilbert
authorJamie Nicol <jnicol@mozilla.com>
Fri, 05 Oct 2018 19:03:46 +0000
changeset 488409 08971360de61d6abd7502414a087785f8d8a3ede
parent 488316 376207f84aa3aecc57118cbbf6cdfa8ea9c6de15
child 488410 10ad4a4352f9e87bac30494aced99e362d8d1a52
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjgilbert
bugs1495857
milestone64.0a1
Bug 1495857 - Ensure correct vertex attrib array index is output in error message r=jgilbert Differential Revision: https://phabricator.services.mozilla.com/D7868
dom/canvas/WebGLProgram.cpp
--- a/dom/canvas/WebGLProgram.cpp
+++ b/dom/canvas/WebGLProgram.cpp
@@ -482,16 +482,17 @@ webgl::LinkedProgramInfo::GetDrawFetchLi
         uint32_t i = 0;
         for (const auto& cur : vao->mAttribs) {
             if (cur.mEnabled && !cur.mBuf) {
                 webgl->ErrorInvalidOperation("Vertex attrib array %u is enabled but"
                                              " has no buffer bound.",
                                              i);
                 return nullptr;
             }
+            i++;
         }
     }
 
     bool hasActiveAttrib = false;
     bool hasActiveDivisor0 = false;
     webgl::CachedDrawFetchLimits fetchLimits = { UINT64_MAX, UINT64_MAX };
 
     for (const auto& progAttrib : this->attribs) {