From 6c2a5ad0845c7f01afaf39a55afe842d11e62ba9 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Tue, 22 Nov 2022 00:07:43 +0100 Subject: [PATCH] vulkan: Remove asserts that weren't valid for RADV ETC2 emulation. Wasn't caught when radv was modified to use these helpers ... Tried to move the aspects assert so it still checks application inputs. Fixes: d9048e31a0d ("radv: Use vk_image_view as the base for radv_image_view") Part-of: (cherry picked from commit 13d755441c7b648e4f6671d833a6d58ada9ae32d) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_image.c | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 18cf472..8ecd4d1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1318,7 +1318,7 @@ "description": "vulkan: Remove asserts that weren't valid for RADV ETC2 emulation.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "d9048e31a0d7b08b23363c1e31d509b635d5383b" }, diff --git a/src/vulkan/runtime/vk_image.c b/src/vulkan/runtime/vk_image.c index 32a649a..c797298 100644 --- a/src/vulkan/runtime/vk_image.c +++ b/src/vulkan/runtime/vk_image.c @@ -184,8 +184,6 @@ VkImageUsageFlags vk_image_usage(const struct vk_image *image, VkImageAspectFlags aspect_mask) { - assert(!(aspect_mask & ~image->aspects)); - /* From the Vulkan 1.2.131 spec: * * "If the image was has a depth-stencil format and was created with @@ -368,23 +366,14 @@ vk_image_view_init(struct vk_device *device, const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange; if (driver_internal) { - /* For driver internal images, all we require is that the block sizes - * match. Otherwise, we trust the driver to use a format it knows what - * to do with. Combined depth/stencil images might not match if the - * driver only cares about one of the two aspects. - */ - if (image->aspects == VK_IMAGE_ASPECT_COLOR_BIT || - image->aspects == VK_IMAGE_ASPECT_DEPTH_BIT || - image->aspects == VK_IMAGE_ASPECT_STENCIL_BIT) { - assert(vk_format_get_blocksize(image->format) == - vk_format_get_blocksize(image_view->format)); - } image_view->aspects = range->aspectMask; image_view->view_format = pCreateInfo->format; } else { image_view->aspects = vk_image_expand_aspect_mask(image, range->aspectMask); + assert(!(image_view->aspects & ~image->aspects)); + /* From the Vulkan 1.2.184 spec: * * "If the image has a multi-planar format and -- 2.7.4