diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp index 33db9783..2b9c8fad 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp @@ -53,14 +53,14 @@ namespace skyline::gpu::interconnect { bool newRenderPass{CreateRenderPass(renderArea)}; renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment ? &*depthStencilAttachment : nullptr); if (newRenderPass) - nodes.emplace_back(std::in_place_type_t(), std::forward &, GPU &, vk::RenderPass, u32)>>(function)); + nodes.emplace_back(std::in_place_type_t(), std::forward(function)); else - nodes.emplace_back(std::in_place_type_t(), std::forward &, GPU &, vk::RenderPass, u32)>>(function)); + nodes.emplace_back(std::in_place_type_t(), std::forward(function)); } - void CommandExecutor::AddNonGraphicsPass(std::function &, GPU &)> &&function) { - // End render pass + void CommandExecutor::AddOutsideRpCommand(std::function &, GPU &)> &&function) { if (renderPass) { + // End render pass, if we're in one nodes.emplace_back(std::in_place_type_t()); renderPass = nullptr; subpassCount = 0; diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h index 5c624e75..b3890956 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h @@ -74,9 +74,9 @@ namespace skyline::gpu::interconnect { void AddClearDepthStencilSubpass(TextureView *attachment, const vk::ClearDepthStencilValue &value); /** - * @brief Adds a non graphics pass that can be used to execute arbitrary commands outside of a render pass + * @brief Adds a command that needs to be executed outside the scope of a render pass */ - void AddNonGraphicsPass(std::function &, GPU &)> &&function); + void AddOutsideRpCommand(std::function &, GPU &)> &&function); /** * @brief Execute all the nodes and submit the resulting command buffer to the GPU diff --git a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h index e3043a12..dcf0f70b 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h @@ -78,19 +78,19 @@ namespace skyline::gpu::interconnect { constexpr vk::ImageTiling NullImageTiling{vk::ImageTiling::eOptimal}; auto vkImage{gpu.memory.AllocateImage({ - .imageType = vk::ImageType::e2D, - .format = NullImageFormat->vkFormat, - .extent = NullImageDimensions, - .mipLevels = 1, - .arrayLayers = 1, - .samples = vk::SampleCountFlagBits::e1, - .tiling = NullImageTiling, - .usage = vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eSampled, - .sharingMode = vk::SharingMode::eExclusive, - .queueFamilyIndexCount = 1, - .pQueueFamilyIndices = &gpu.vkQueueFamilyIndex, - .initialLayout = NullImageInitialLayout - })}; + .imageType = vk::ImageType::e2D, + .format = NullImageFormat->vkFormat, + .extent = NullImageDimensions, + .mipLevels = 1, + .arrayLayers = 1, + .samples = vk::SampleCountFlagBits::e1, + .tiling = NullImageTiling, + .usage = vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eSampled, + .sharingMode = vk::SharingMode::eExclusive, + .queueFamilyIndexCount = 1, + .pQueueFamilyIndices = &gpu.vkQueueFamilyIndex, + .initialLayout = NullImageInitialLayout + })}; auto nullTexture{std::make_shared(gpu, std::move(vkImage), NullImageDimensions, NullImageFormat, NullImageInitialLayout, NullImageTiling)}; nullTexture->TransitionLayout(vk::ImageLayout::eGeneral); @@ -714,7 +714,7 @@ namespace skyline::gpu::interconnect { auto constantBuffer{GetConstantBufferSelector().value()}; constantBuffer.Write(data, offset); - executor.AddNonGraphicsPass([view = constantBuffer.view, data, offset](vk::raii::CommandBuffer &commandBuffer, const std::shared_ptr &cycle, GPU &) { + executor.AddOutsideRpCommand([view = constantBuffer.view, data, offset](vk::raii::CommandBuffer &commandBuffer, const std::shared_ptr &cycle, GPU &) { std::scoped_lock lock{view}; commandBuffer.updateBuffer(view.bufferDelegate->buffer->GetBacking(), offset, vk::ArrayProxy(1, &data)); });