Class: TextureGCSystem

TextureGCSystem

System plugin to the renderer to manage texture garbage collection on the GPU, ensuring that it does not get clogged up with textures that are no longer being used.

new TextureGCSystem (renderer)

Name Type Description
renderer Renderer

The renderer this System works for.

Implements

Members

defaultOptions TextureGCSystemOptions static

default options for the TextureGCSystem

Properties:
Name Type Default Description
textureGCActive boolean true

If set to true, this will enable the garbage collector on the GPU.

textureGCAMaxIdle 60 * 60

The maximum idle frames before a texture is destroyed by garbage collection.

textureGCCheckCountMax number 600

Frames between two garbage collections.

active boolean

Current garbage collection mode.

See:
  • TextureGCSystem.defaultMode

checkCount number readonly

Frame count since last garbage collection.

checkCountMax number

Frames between two garbage collections.

See:
  • TextureGCSystem.defaultCheckCountMax

count number readonly

Frame count since started.

maxIdle number

Maximum idle frames before a texture is destroyed by garbage collection.

See:
  • TextureGCSystem.defaultMaxIdle

Methods

run () void

Checks to see when the last time a texture was used. If the texture has not been used for a specified amount of time, it will be removed from the GPU.

postrender () void protected

Checks to see when the last time a texture was used. If the texture has not been used for a specified amount of time, it will be removed from the GPU.