cesium-native icon indicating copy to clipboard operation
cesium-native copied to clipboard

Remove glTF compressed buffers after decompressing

Open kring opened this issue 4 years ago • 2 comments

When a glTF contains a Draco-compressed buffer or a jpg/png compressed image, we decompress/decode them at load time. However, the original compressed data hangs around. We could save memory by freeing these original buffers after we're done loading data from them.

Doing this is mostly trivial, except for (unlikely?) edge cases where a single block of compressed data in a glTF Buffer is used by multiple primitives (draco) or images (jpg/png).

kring avatar Jan 20 '21 09:01 kring

Also, it's tricky to surgically remove data from a buffer because of the need to preserve alignment in the process.

kring avatar Jan 20 '21 10:01 kring

I started on this in https://github.com/CesiumGS/cesium-native/compare/gltf-remove-draco awhile back, but it's not complete or working.

kring avatar Mar 08 '21 09:03 kring