gpu: destroy_shader/buffer/texture on the GPU protocol (issue-0029)

Three new method signatures on the GPU protocol. Metal backend sends
`release` to the MTLTexture/Buffer/RenderPipelineState and nulls the
slot in its backing List so the handle becomes inert; handles are not
re-used. glyph_cache.grow() now destroys the old atlas before
allocating its replacement, eliminating the per-grow leak the file's
comment had been flagging since Session 62.
This commit is contained in:
agra
2026-05-18 23:09:32 +03:00
parent 79419b99bd
commit f41a121a29
4 changed files with 72 additions and 50 deletions

View File

@@ -501,9 +501,7 @@ GlyphCache :: struct {
// Recreate atlas at the new size.
if self.gpu != null {
// No destroy_texture in the GPU protocol yet — old atlas
// leaks in the backend table until process exit. Atlas grow
// is rare so this is acceptable for now.
self.gpu.destroy_texture(self.texture_id);
self.texture_id = self.gpu.create_texture(new_w, new_h, .r8, xx new_bitmap);
} else {
glDeleteTextures(1, @self.texture_id);