reprocessing icon indicating copy to clipboard operation
reprocessing copied to clipboard

Fix leaking images

Open Schmavery opened this issue 6 years ago • 0 comments

When loaded images go out of scope we should be deleting them from the GPU https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glDeleteTextures.xml

This didn't use to be much of an issue if you just load images inside of setup, but now we rerun setup whenever we hotreload, which ends up being a lot and causes performance issues.

Ideally we somehow improve our bindings to use custom blocks with a finalize that frees the images on the gpu https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#sec461

failing that: Exposing this might help: https://github.com/bsansouci/reasongl/issues/4 and let us write this in Reprocessing by using a Gc.finalize on the returned imageT objects.

@bsansouci

Schmavery avatar Apr 28 '19 01:04 Schmavery