Commit 79ec8b3400ceeafc3e69b9bec29fa39a0e1a9a16

Yuxin Hu 2025-06-12T14:32:42

Fix glCopyImageSubData validation check When checking if the copy subregion meets the compressed texture alignment requirements, we should consider if the copy subregion covers the entire width and height of texture level. It is not required to make texture size aligned with compressed texture block size when creating the texture image (e.g. width and height do not have to be multiple of 6 when calling glTexStorage2D for GL_COMPRESSED_RGBA_ASTC_6X6 textures). If the copy subregion width and height equals to the width and height of the texture level, even if they are not aligned with the compressed texture block size, the copy is allowed. This is currently covered by fillsEntireMip check. However, fillsEntireMip enforces copy subregion width, height, and depth all equal to the texture level width, height, and depth, where we should not check depth because we don't enforce depth alignment for compressed texture. For example, for a 2D texture array that has dimension of 32*16*2 in current level, a copy region with width=32, heigh=16, depth=1 should be considered as fillsEntireMip. In the spec, it says: "The source and destination subregions must be contained entirely within the specified level of the corresponding image objects". Right now we only check if width and height are within the image bounds, this change adds a check to make sure depth is also within the image bounds. Bug: b/419048313 Change-Id: I6e5339cfdfd5785f935a059638c22c9646c12162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6634232 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>