(value, uniformLength, Type, cache)
| 64821 | 0 |
| 64822 | ]; |
| 64823 | function toTypedArray(value, uniformLength, Type, cache) { |
| 64824 | if (uniformLength === 1 && typeof value === "boolean") value = value ? 1 : 0; |
| 64825 | if (Number.isFinite(value)) { |
| 64826 | array1[0] = value; |
| 64827 | value = array1; |
| 64828 | } |
| 64829 | var length = value.length; |
| 64830 | if (length % uniformLength) (0, _gltools.log).warn("Uniform size should be multiples of ".concat(uniformLength), value)(); |
| 64831 | if (value instanceof Type) return value; |
| 64832 | var result = cache[length]; |
| 64833 | if (!result) { |
| 64834 | result = new Type(length); |
| 64835 | cache[length] = result; |
| 64836 | } |
| 64837 | for(var i = 0; i < length; i++)result[i] = value[i]; |
| 64838 | return result; |
| 64839 | } |
| 64840 | function toFloatArray(value, uniformLength) { |
| 64841 | return toTypedArray(value, uniformLength, Float32Array, FLOAT_ARRAY); |
| 64842 | } |
no test coverage detected