From 9ffe03affdd6a7feb38c0f3e80b1f71e40fd21a6 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 26 Feb 2024 10:55:45 -0800 Subject: [PATCH 1/3] [Impeller] disble render pass caches. --- .../renderer/backend/vulkan/render_pass_vk.cc | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/impeller/renderer/backend/vulkan/render_pass_vk.cc b/impeller/renderer/backend/vulkan/render_pass_vk.cc index 28a7013127775..b2f8bde4c114c 100644 --- a/impeller/renderer/backend/vulkan/render_pass_vk.cc +++ b/impeller/renderer/backend/vulkan/render_pass_vk.cc @@ -170,26 +170,16 @@ RenderPassVK::RenderPassVK(const std::shared_ptr& context, return true; }); - SharedHandleVK recycled_render_pass; - SharedHandleVK recycled_framebuffer; - if (resolve_image_vk_) { - recycled_render_pass = TextureVK::Cast(*resolve_image_vk_).GetRenderPass(); - recycled_framebuffer = TextureVK::Cast(*resolve_image_vk_).GetFramebuffer(); - } - const auto& target_size = render_target_.GetRenderTargetSize(); - render_pass_ = - CreateVKRenderPass(vk_context, recycled_render_pass, command_buffer_); + render_pass_ = CreateVKRenderPass(vk_context, nullptr, command_buffer_); if (!render_pass_) { VALIDATION_LOG << "Could not create renderpass."; is_valid_ = false; return; } - auto framebuffer = (recycled_framebuffer == nullptr) - ? CreateVKFramebuffer(vk_context, *render_pass_) - : recycled_framebuffer; + auto framebuffer = CreateVKFramebuffer(vk_context, *render_pass_); if (!framebuffer) { VALIDATION_LOG << "Could not create framebuffer."; is_valid_ = false; @@ -200,10 +190,6 @@ RenderPassVK::RenderPassVK(const std::shared_ptr& context, is_valid_ = false; return; } - if (resolve_image_vk_) { - TextureVK::Cast(*resolve_image_vk_).SetFramebuffer(framebuffer); - TextureVK::Cast(*resolve_image_vk_).SetRenderPass(render_pass_); - } auto clear_values = GetVKClearValues(render_target_); From 9ffcb3374e62312d10afc090443cf97894092233 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 26 Feb 2024 12:12:40 -0800 Subject: [PATCH 2/3] disable test --- .../renderer/backend/vulkan/render_pass_cache_unittests.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc b/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc index e2fc63ea5796a..d4fc815984a08 100644 --- a/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc +++ b/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc @@ -11,9 +11,9 @@ namespace impeller { namespace testing { -using RendererTest = PlaygroundTest; +using DISABLED_RendererTest = PlaygroundTest; -TEST_P(RendererTest, CachesRenderPassAndFramebuffer) { +TEST_P(DISABLED_RendererTest, CachesRenderPassAndFramebuffer) { if (GetBackend() != PlaygroundBackend::kVulkan) { GTEST_SKIP() << "Test only applies to Vulkan"; } From f3855c45678635e50e41dee2123b5a97dc09f853 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 26 Feb 2024 12:28:36 -0800 Subject: [PATCH 3/3] Update render_pass_cache_unittests.cc --- .../vulkan/render_pass_cache_unittests.cc | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc b/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc index d4fc815984a08..bb850c3e7d83b 100644 --- a/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc +++ b/impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc @@ -11,41 +11,7 @@ namespace impeller { namespace testing { -using DISABLED_RendererTest = PlaygroundTest; - -TEST_P(DISABLED_RendererTest, CachesRenderPassAndFramebuffer) { - if (GetBackend() != PlaygroundBackend::kVulkan) { - GTEST_SKIP() << "Test only applies to Vulkan"; - } - - auto allocator = std::make_shared( - GetContext()->GetResourceAllocator()); - - auto render_target = RenderTarget::CreateOffscreenMSAA( - *GetContext(), *allocator, {100, 100}, 1); - auto resolve_texture = - render_target.GetColorAttachments().find(0u)->second.resolve_texture; - auto& texture_vk = TextureVK::Cast(*resolve_texture); - - EXPECT_EQ(texture_vk.GetFramebuffer(), nullptr); - EXPECT_EQ(texture_vk.GetRenderPass(), nullptr); - - auto buffer = GetContext()->CreateCommandBuffer(); - auto render_pass = buffer->CreateRenderPass(render_target); - - EXPECT_NE(texture_vk.GetFramebuffer(), nullptr); - EXPECT_NE(texture_vk.GetRenderPass(), nullptr); - - render_pass->EncodeCommands(); - GetContext()->GetCommandQueue()->Submit({buffer}); - - // Can be reused without error. - auto buffer_2 = GetContext()->CreateCommandBuffer(); - auto render_pass_2 = buffer_2->CreateRenderPass(render_target); - - EXPECT_TRUE(render_pass_2->EncodeCommands()); - EXPECT_TRUE(GetContext()->GetCommandQueue()->Submit({buffer_2}).ok()); -} +// } // namespace testing } // namespace impeller