Hi , recently i tried to use gpu.js and ive done some testing . i have a lot of data to send to gpu.js to use a graphical shader. what ive done is 3 thing . first get all my list of entity to draw. then ive flattened the list into a 1d array and created a single 1d array representing some sort of texture in a way. and finnally ive encoded my color into a bitwise system. now all of that is working but i seem to have huge memory leak . my gpu memory is growing infinetely. ive fairly new to gpu.js and i was wondering if someone could help me on this subject . my other problem which might very well be related is that . without drawing anythng im always 60+ fps but now with this im 40 fps and going down. here's are the 4 script ```js
function flattenEntities(entities) {
const flattenedArray = [];
entities.forEach((entity) => {
if (entity.type === "bulb") {
const { position, Color } = entity;
flattenedArray.push([floor(position.x), floor(position.y), red(Color), green(Color), blue(Color)]);
} else if (entity.type === "creature") {
entity.parts.body.forEach((part) => {
const { position, color } = part;
flattenedArray.push([floor(position.x + entity.position.x), floor(position.y + entity.position.y), red(color), green(color), blue(color)]);
});
}
});
return flattenedArray;
}