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
If no text is being displayed then gfx.Text.updatePipeline leaks memory when used in d3d12.
There is a defer on encoder.release but that does not seem to be sufficient to release the resources that the d3d12 backend allocates when the encoder is created. To fully release encoder.finish needs to be called and the resulting command needs to be submitted to the queue.
Two things to consider here:
There is no need to create the encoder unless it will be used. I.e. check num_texts and glyphs.items.len before creating it. So that is a simple fix to the current issue.
Check why it is not sufficient to call release on the encoder if it was not used. Do other backends have the same behavior?
The text was updated successfully, but these errors were encountered:
When the CommandEncoder is created in the d3d12 there is also an underlying CommandBuffer and a ReferenceTracker created. The reference tracker keeps track of references to buffer and other resources used by the commands. The commands can extend beyond the lifetime of the command encoder, so the reference tracker is not destroyed until the command has been completed on the gpu device queue.
To allow cancelling a command encoder, it would be possible to monitor if finish was called on it or not. If finish was not called then the release of the commandencoder could handle destruction of resources that would otherwise be released after they were submitted to the device queue.
A side note.
In sysgpu there is a function tick(). But it is not called anywhere in mach. This means for the d3d12 implementation, the referencetracker are releaseed in processQueuedOperations when a new commandAllocator is created when the CommandBuffer is initialized.
If no text is being displayed then gfx.Text.updatePipeline leaks memory when used in d3d12.
There is a defer on encoder.release but that does not seem to be sufficient to release the resources that the d3d12 backend allocates when the encoder is created. To fully release encoder.finish needs to be called and the resulting command needs to be submitted to the queue.
Two things to consider here:
The text was updated successfully, but these errors were encountered: