You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Purpose of texture is cache is to, well, reduce texture allocations, however the way TextureCache currently is implemented makes it to do a lot of texture allocation in particular corner cases.
If object boundaries are changing frequently, it will cause cache to reallocate the filter texture every time, as it would dispose of old one and not keep it in cache, and even it would - it'd just dispose of it on next frame, which defeats the purpose of texture cache.
Real case example: h2d.Anim with frames of varying size. When frame changes, so does the Bounds of animation, causing assigned filter to request different texture size, and disposing of the old one, and thus causing texture allocs every animation frame change.
Issue's brought up @c_l_y_d_e_ from discord, during Into the Necrovale dev.
It may be smart to use something along the lines of hxd.impl.CacheAllocator where textures are not disposed immediately or next frame but rather kept for a fixed amount of time.
Purpose of texture is cache is to, well, reduce texture allocations, however the way
TextureCache
currently is implemented makes it to do a lot of texture allocation in particular corner cases.If object boundaries are changing frequently, it will cause cache to reallocate the filter texture every time, as it would dispose of old one and not keep it in cache, and even it would - it'd just dispose of it on next frame, which defeats the purpose of texture cache.
Real case example:
h2d.Anim
with frames of varying size. When frame changes, so does theBounds
of animation, causing assigned filter to request different texture size, and disposing of the old one, and thus causing texture allocs every animation frame change.Issue's brought up
@c_l_y_d_e_
from discord, during Into the Necrovale dev.It may be smart to use something along the lines of
hxd.impl.CacheAllocator
where textures are not disposed immediately or next frame but rather kept for a fixed amount of time.Reproduction code:
Repro
The text was updated successfully, but these errors were encountered: