瀏覽代碼

Defensive coding just in case

sebavan 5 年之前
父節點
當前提交
58fc8aae6c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Engines/thinEngine.ts

+ 4 - 0
src/Engines/thinEngine.ts

@@ -1823,6 +1823,10 @@ export class ThinEngine {
                 ai.index = this._currentEffect!.getAttributeLocationByName(ai.attributeName);
             }
 
+            if (ai.index < 0) {
+                continue;
+            }
+
             if (!this._vertexAttribArraysEnabled[ai.index]) {
                 this._gl.enableVertexAttribArray(ai.index);
                 this._vertexAttribArraysEnabled[ai.index] = true;