mirror of
https://github.com/greggman/twgl.js.git
synced 2025-12-08 19:26:07 +00:00
This only works for passing arrays. It assumes you pass however much data is needed for mips up to the level you want uploaded. In other words. Say your texture is 10x7 RGBA. Then src would be a TypedArray with 10x7 + 5x3 + 2x1 + 1x1 4 byte texels or exactly 352 bytes. If you pass (10x7 + 5x3) * 4, which is 340 bytes, then it would only fill out the first 2 mip levels. That texture would be unrenderable unless you (1) set filtering to not use mips or (2) set `maxLevel` to 1 (TEXTURE_MAX_LEVEL).