Repository navigation
v0.3.6
Debounce idle GPU reclamation, pool small Metal stores, and add shared images.
gio/app(macOS, iOS): idle GPU reclamation is debounced.gpu.Idleruns 250 ms after the window last presented a frame, and on macOSgpu.Trimplus the drawable shrink run after 1 s. The timer is set once and moved, not recreated per frame, so a window redrawn by externalInvalidatecalls no longer marks textures volatile and rebuilds GPU state every frame (textureSetVolatilealone was about 12% of Mirage's CPU samples). Other contexts still callgpu.Idledirectly.gio/gpu/internal/metal: Go-memory stores of buffers up to 4 KiB, the onesset*Bytesbuilds every rebuilt path from, are pooled by power-of-two class, at most 256 per class and emptied byTrim. A 60 Hz session allocated megabytes of them a second.gio/op/paint,gio/gpu,gio/internal/dirty:NewSharedImageOp(src, mu)is a mutable image its owner writes outside the frame. The renderer takesmuonly while readingsrc(texture creation, or the upload of changed areas once the version moved), and unchanged images never take it. A remote desktop client can draw tiles cut from its decoder framebuffer withSubImageinstead of copying them (about 60 MB for a 5K screen).maximumDrawableCountstays at 3:TestMetalResizeWindowstalled in 3 of 3 runs with 2.
All three patches are listed in third_party/README.md and carry their own tests.
Validation: gofmt, vet, module tests, the offline component check and CGO_ENABLED=0 GOOS=windows go build ./... from a clean checkout. TestEveryModuleIsListed reads untracked draft modules in the gitignored work/ directory and passes without it.
本版让空闲 GPU 回收改为防抖、池化 Metal 的小 buffer 存储,并新增可跨帧写入的共享图像。三个补丁都带自己的测试,记录在 third_party/README.md。
Compare: v0.3.5...v0.3.6