Commit 32af258def244aaaf01d82faa9876aed5779071e

Cody Northrop 2022-03-22T16:44:14

Fix handling of incomplete CubeMapArray textures GFXBench Car Chase binds a cube map array as a default texture, then immediately samples from it without setting it up. This ends up treating the cube map array as incomplete. On the Vulkan backend, this is resulting in multiple validation errors, followed by a crash in the driver. There are a number of errors, but a telling one is this: vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but pCreateInfo->arrayLayers (=1) is not greater than or equal to 6. The Vulkan spec states: If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be equal and arrayLayers must be greater than or equal to 6 This corresponds to language in the GLES 3.2 spec: 8.18. IMMUTABLE-FORMAT TEXTURE IMAGES TexStorage3D Errors An INVALID_OPERATION error is generated if any of the following conditions hold: * target is TEXTURE_CUBE_MAP_ARRAY and depth is not a multiple of 6 Since ANGLE treats incomplete textures as immutable, we need to update the dimensions of the backing image for CUBE_MAP_ARRAY. Also add a new test that exposes the problem. Test: IncompleteTextureTestES31.IncompleteTextureCubeMapArray Bug: b/218314686 Change-Id: Ibef41e15a7cfccb05e6039bfb8504d237bc42cd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3546290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>