From 77b198211ce97fdf16668f9f0a4e57e206fe83c6 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 27 Feb 2021 04:03:59 +0900 Subject: [PATCH] internal/graphicsdriver/metal: Add a comment --- internal/graphicsdriver/metal/graphics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/graphicsdriver/metal/graphics.go b/internal/graphicsdriver/metal/graphics.go index d8e55a18e..24edf4e9e 100644 --- a/internal/graphicsdriver/metal/graphics.go +++ b/internal/graphicsdriver/metal/graphics.go @@ -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,