-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace FinalizationRegistry based Texture Usage GC with Manual Strategy #27
Replace FinalizationRegistry based Texture Usage GC with Manual Strategy #27
Conversation
Breaking changes: - RendererMain.makeTexture -> RendererMain.createTexture - RendererMain.makeShader -> RendererMain.createShader - TextureDesc type -> TextureRef type - ShaderDesc type -> ShaderRef type
@erikhaandrikman Could I get your thoughts on this approach? |
Would there ever be a case where I'd want to run ThreadX without FinalizationRegistry? |
@wouterlucas FinalizationRegistry for texture memory isn't really coupled to ThreadX at all. It's just one strategy for proactively cleaning up textures that we've cached and loaded on the GPU that we are pretty confident won't be needed again for awhile. In the case of the FinalizationRegistry strategy we know 100% that a texture is no longer referenced anywhere in the currently running JavaScript at all. The new Manual Count + Interval strategy employs a time heuristic that aims to predict when that is the case, but with some chances of being wrong. There are pros/cons to both approaches. GC and the firing of the FinalizationRegistry events for instance isn't guaranteed in any particular timeframe by the browser. It could come super late, for instance, to a point where it's not being proactive enough to prevent memory pressure overload. The Manual Count strategy is guaranteed to run and clean up unused textures regularly. |
true
:experimental_FinalizationRegistryTextureUsageTracker
texture-memory-stress
test with instructions on how to perform.customSettings
function which returns any renderer settings overrides that the test requires to run. These settings are applied on top of all of the defaults specified by the example test launcher.type
now determines the specific properties types checked.