Commit 2bc1519ccc1edae9f8bf286c705cc8414bcc03ee

Le Hoang Quyen 2024-07-28T05:16:07

Metal: fix base/max level change for mutable textures. Previously, the following scenario would accidentally delete and recreate the native texture storage for a non-immutable TextureMtl: 1. set a texture base/max level. 2. attach the texture to a FBO and clear it. - native storage is created. 3. sample the texture. - native storage is accidentally deleted and recreated. This happened because front-end only notifies the backend about the base/max level dirty bits at step 3. At this point, Metal backend thought that the native storage created at step 2 is no longer valid and attempted to recreate the storage. This CL fixes the bug by checking whether the base/max level is still compatible with the existing native texture storage. If it is then the dirty bits result in no-op. Bug: chromium:355605685 Change-Id: I1daac80a74219109631a101e18e944560606d926 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5741121 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>