瀏覽代碼

bugfix when attribute is optimized out

ncannasse 9 年之前
父節點
當前提交
19c5a46b9e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      h3d/impl/GlDriver.hx

+ 4 - 1
h3d/impl/GlDriver.hx

@@ -195,7 +195,10 @@ class GlDriver extends Driver {
 					default: throw "assert " + v.type;
 					}
 					var index = gl.getAttribLocation(p.p, glout.varNames.get(v.id));
-					if( index < 0 ) continue;
+					if( index < 0 ) {
+						p.stride += size;
+						continue;
+					}
 					p.attribs.push( { offset : p.stride, index : index, size:size, type:t } );
 					p.attribNames.push(v.name);
 					p.stride += size;