internal/graphicsdriver/metal: Add a comment

This commit is contained in:
Hajime Hoshi 2021-02-27 04:03:59 +09:00
parent 53352cf2b3
commit 77b198211c

View File

@ -901,7 +901,8 @@ func (i *Image) ReplacePixels(args []*driver.ReplacePixelsArgs) {
h := maxY - minY
// Use a temporary texture to send pixels asynchrounsly, whichever the memory is shared (e.g., iOS) or
// managed (e.g., macOS). (#1418)
// managed (e.g., macOS). A temporary texture is needed since ReplaceRegion tries to sync the pixel
// data between CPU and GPU, and doing it on the existing texture is inefficient (#1418).
// The texture cannot be reused until sending the pixels finishes, then create new ones for each call.
td := mtl.TextureDescriptor{
TextureType: mtl.TextureType2D,