Nicolas Cannasse 4 years ago
parent
commit
e6c7b120e5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      hxsl/Flatten.hx

+ 2 - 1
hxsl/Flatten.hx

@@ -122,6 +122,7 @@ class Flatten {
 					var stride = varSize(t, a.t);
 					if( stride == 0 || stride & 3 != 0 ) throw new Error("Dynamic access to an Array which size is not 4 components-aligned is not allowed", e.p);
 					stride >>= 2;
+					eindex.t = TFloat; // force
 					eindex = toInt(mapExpr(eindex));
 					access(a, t, vp, AOffset(a,stride, stride == 1 ? eindex : { e : TBinop(OpMult,eindex,mkInt(stride,vp)), t : TInt, p : vp }));
 				default:
@@ -319,7 +320,7 @@ class Flatten {
 			return e;
 		}
 	}
-	
+
 	function toInt( e : TExpr ) {
 		if( e.t == TInt ) return e;
 		return { e : TCall({ e : TGlobal(ToInt), t : TFun([]), p : e.p }, [e]), t : TInt, p : e.p };