From 34fc1e32b8ac63540dbb87ced77becb6480eb43f Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Wed, 8 Dec 2021 14:07:05 +0530 Subject: [PATCH] Remove `Texture`s from `RenderPassNode::Storage` The lifetime of all textures bound to a RenderPass alongside syncing of textures is already handled by `CommandExecutor` and doesn't need to be redundantly handled by `RenderPassNode`. It's been removed as a result of this. --- .../gpu/interconnect/command_nodes.cpp | 19 +------------------ .../skyline/gpu/interconnect/command_nodes.h | 1 - 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp index 96c9bc60..5e2cd77c 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp @@ -14,11 +14,6 @@ namespace skyline::gpu::interconnect::node { } u32 RenderPassNode::AddAttachment(TextureView *view) { - auto &textures{storage->textures}; - auto texture{std::find(textures.begin(), textures.end(), view->texture)}; - if (texture == textures.end()) - textures.push_back(view->texture); - auto vkView{view->GetView()}; auto attachment{std::find(attachments.begin(), attachments.end(), vkView)}; if (attachment == attachments.end()) { @@ -208,13 +203,6 @@ namespace skyline::gpu::interconnect::node { preserveAttachmentIt++; } - for (auto &texture : storage->textures) { - texture->lock(); - texture->WaitOnBacking(); - if (texture->cycle.lock() != cycle) - texture->WaitOnFence(); - } - auto renderPass{(*gpu.vkDevice).createRenderPass(vk::RenderPassCreateInfo{ .attachmentCount = static_cast(attachmentDescriptions.size()), .pAttachments = attachmentDescriptions.data(), @@ -243,12 +231,7 @@ namespace skyline::gpu::interconnect::node { .pClearValues = clearValues.data(), }, vk::SubpassContents::eInline); - cycle->AttachObjects(storage); - - for (auto &texture : storage->textures) { - texture->unlock(); - texture->cycle = cycle; - } + cycle->AttachObject(storage); return renderPass; } diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.h b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.h index edd7511f..95da0c00 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.h @@ -35,7 +35,6 @@ namespace skyline::gpu::interconnect::node { vk::raii::Device *device{}; vk::Framebuffer framebuffer{}; vk::RenderPass renderPass{}; - std::vector> textures; ~Storage(); };