From babbfa1394d19d6f8062c723ffb8fa2fa78c32f9 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Wed, 23 Feb 2022 13:48:10 -0800 Subject: [PATCH] Vulkan: remove layout checks from SwapChain. These asserts will come back in the next Filament release, which has much cleaner layout tracking. --- filament/backend/src/vulkan/VulkanSwapChain.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/filament/backend/src/vulkan/VulkanSwapChain.cpp b/filament/backend/src/vulkan/VulkanSwapChain.cpp index 9bf8dff087..bb0b6631a6 100644 --- a/filament/backend/src/vulkan/VulkanSwapChain.cpp +++ b/filament/backend/src/vulkan/VulkanSwapChain.cpp @@ -29,14 +29,6 @@ namespace backend { bool VulkanSwapChain::acquire() { if (headlessQueue) { currentSwapIndex = (currentSwapIndex + 1) % mColor.size(); - - // Next we perform a quick sanity check on layout for headless swap chains. It's easier to - // catch errors here than with validation. If this is the first time a particular image has - // been acquired, it should be in an UNDEFINED state. If this is not the first time, then it - // should be in the normal layout that we use for color attachments. - assert_invariant(this->getColorAttachment().layout == VK_IMAGE_LAYOUT_UNDEFINED || - this->getColorAttachment().layout == getDefaultImageLayout(TextureUsage::COLOR_ATTACHMENT)); - return true; } @@ -52,11 +44,6 @@ bool VulkanSwapChain::acquire() { suboptimal = true; } - // Next perform a quick sanity check on the image layout. Similar to attachable textures, we - // immediately transition the swap chain image layout during the first render pass of the frame. - assert_invariant(this->getColorAttachment().layout == VK_IMAGE_LAYOUT_UNDEFINED || - this->getColorAttachment().layout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR); - // To ensure that the next command buffer submission does not write into the image before // it has been acquired, push the image available semaphore into the command buffer manager. mContext.commands->injectDependency(imageAvailable);