corona icon indicating copy to clipboard operation
corona copied to clipboard

Texture memory (reporting) issue

Open ggcrunchy opened this issue 2 years ago • 0 comments

This was prompted by this comment and some follow-up investigation.

The memory is first incremented here and the corresponding decrement is in WillRemoveTexture(), just below that. These are the only two places in the code I see the count being modified.

I suspect in this scenario the "size in bytes" is 0 in DidAddTexture() and only updated when a video has been assigned, leading in turn to the values going negative when the later values are subtracted back out. It seems like this calls for something like a "last known count", at the very least for purposes of WillRemoveTexture(), but possibly also to keep system.getInfo("textureMemoryUsed") accurate. Maybe a resync of these values could piggyback on something like invalidate().

ggcrunchy avatar Jun 29 '22 18:06 ggcrunchy