|
@@ -247,7 +247,12 @@ class Flatten {
|
|
|
}
|
|
|
|
|
|
inline function readOffset( a : Alloc, stride : Int, delta : TExpr, index : Int, pos ) : TExpr {
|
|
|
- var index = (a.t == null ? a.pos : a.pos >> 2) + index;
|
|
|
+ var index = switch( a.g.type ) {
|
|
|
+ case TBuffer(_,_,_) :
|
|
|
+ index;
|
|
|
+ default :
|
|
|
+ (a.t == null ? a.pos : a.pos >> 2) + index;
|
|
|
+ }
|
|
|
var offset : TExpr = mkAdd(delta,index,pos);
|
|
|
return { e : TArray({ e : TVar(a.g), t : a.g.type, p : pos }, offset), t : TVec(4,a.t), p:pos };
|
|
|
}
|