set size of arrays to be square usable for texture data TODO: reflect support for floating point textures
function (arity, count) {
        if (typeof (arity) == 'undefined' || typeof (count) == 'undefined') {
            throw 'Wrong arguments';
        }
        if (count == 0) return 0;
        var byteLength = count * arity;
        var imgSide = Math.ceil(Math.sqrt(byteLength / 4));
        //clamp to parity
        while ((imgSide * 4) % arity != 0) {
            imgSide++
        }
        var result = imgSide * imgSide * 4 / arity;
        return result;
    }