mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 17:25:28 +03:00
Change AddNonGraphicsPass
to AddOutsideRpCommand
The terminology "Non-Graphics pass" was deemed to be fairly inaccurate since it simply covered all Vulkan commands (not "passes") outside the render-pass scope, these may be graphical operations such as blits and therefore it is more accurate to use the new terminology of "Outside-RenderPass command" due to the lack of such an implication while being consistent with the Vulkan specification.
This commit is contained in:
parent
a31332e35f
commit
624df92616
@ -53,14 +53,14 @@ namespace skyline::gpu::interconnect {
|
|||||||
bool newRenderPass{CreateRenderPass(renderArea)};
|
bool newRenderPass{CreateRenderPass(renderArea)};
|
||||||
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment ? &*depthStencilAttachment : nullptr);
|
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment ? &*depthStencilAttachment : nullptr);
|
||||||
if (newRenderPass)
|
if (newRenderPass)
|
||||||
nodes.emplace_back(std::in_place_type_t<node::SubpassFunctionNode>(), std::forward<std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &, vk::RenderPass, u32)>>(function));
|
nodes.emplace_back(std::in_place_type_t<node::SubpassFunctionNode>(), std::forward<decltype(function)>(function));
|
||||||
else
|
else
|
||||||
nodes.emplace_back(std::in_place_type_t<node::NextSubpassFunctionNode>(), std::forward<std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &, vk::RenderPass, u32)>>(function));
|
nodes.emplace_back(std::in_place_type_t<node::NextSubpassFunctionNode>(), std::forward<decltype(function)>(function));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandExecutor::AddNonGraphicsPass(std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &)> &&function) {
|
void CommandExecutor::AddOutsideRpCommand(std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &)> &&function) {
|
||||||
// End render pass
|
|
||||||
if (renderPass) {
|
if (renderPass) {
|
||||||
|
// End render pass, if we're in one
|
||||||
nodes.emplace_back(std::in_place_type_t<node::RenderPassEndNode>());
|
nodes.emplace_back(std::in_place_type_t<node::RenderPassEndNode>());
|
||||||
renderPass = nullptr;
|
renderPass = nullptr;
|
||||||
subpassCount = 0;
|
subpassCount = 0;
|
||||||
|
@ -74,9 +74,9 @@ namespace skyline::gpu::interconnect {
|
|||||||
void AddClearDepthStencilSubpass(TextureView *attachment, const vk::ClearDepthStencilValue &value);
|
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<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &)> &&function);
|
void AddOutsideRpCommand(std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &)> &&function);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Execute all the nodes and submit the resulting command buffer to the GPU
|
* @brief Execute all the nodes and submit the resulting command buffer to the GPU
|
||||||
|
@ -78,19 +78,19 @@ namespace skyline::gpu::interconnect {
|
|||||||
constexpr vk::ImageTiling NullImageTiling{vk::ImageTiling::eOptimal};
|
constexpr vk::ImageTiling NullImageTiling{vk::ImageTiling::eOptimal};
|
||||||
|
|
||||||
auto vkImage{gpu.memory.AllocateImage({
|
auto vkImage{gpu.memory.AllocateImage({
|
||||||
.imageType = vk::ImageType::e2D,
|
.imageType = vk::ImageType::e2D,
|
||||||
.format = NullImageFormat->vkFormat,
|
.format = NullImageFormat->vkFormat,
|
||||||
.extent = NullImageDimensions,
|
.extent = NullImageDimensions,
|
||||||
.mipLevels = 1,
|
.mipLevels = 1,
|
||||||
.arrayLayers = 1,
|
.arrayLayers = 1,
|
||||||
.samples = vk::SampleCountFlagBits::e1,
|
.samples = vk::SampleCountFlagBits::e1,
|
||||||
.tiling = NullImageTiling,
|
.tiling = NullImageTiling,
|
||||||
.usage = vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eSampled,
|
.usage = vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eSampled,
|
||||||
.sharingMode = vk::SharingMode::eExclusive,
|
.sharingMode = vk::SharingMode::eExclusive,
|
||||||
.queueFamilyIndexCount = 1,
|
.queueFamilyIndexCount = 1,
|
||||||
.pQueueFamilyIndices = &gpu.vkQueueFamilyIndex,
|
.pQueueFamilyIndices = &gpu.vkQueueFamilyIndex,
|
||||||
.initialLayout = NullImageInitialLayout
|
.initialLayout = NullImageInitialLayout
|
||||||
})};
|
})};
|
||||||
|
|
||||||
auto nullTexture{std::make_shared<Texture>(gpu, std::move(vkImage), NullImageDimensions, NullImageFormat, NullImageInitialLayout, NullImageTiling)};
|
auto nullTexture{std::make_shared<Texture>(gpu, std::move(vkImage), NullImageDimensions, NullImageFormat, NullImageInitialLayout, NullImageTiling)};
|
||||||
nullTexture->TransitionLayout(vk::ImageLayout::eGeneral);
|
nullTexture->TransitionLayout(vk::ImageLayout::eGeneral);
|
||||||
@ -714,7 +714,7 @@ namespace skyline::gpu::interconnect {
|
|||||||
auto constantBuffer{GetConstantBufferSelector().value()};
|
auto constantBuffer{GetConstantBufferSelector().value()};
|
||||||
constantBuffer.Write(data, offset);
|
constantBuffer.Write(data, offset);
|
||||||
|
|
||||||
executor.AddNonGraphicsPass([view = constantBuffer.view, data, offset](vk::raii::CommandBuffer &commandBuffer, const std::shared_ptr<FenceCycle> &cycle, GPU &) {
|
executor.AddOutsideRpCommand([view = constantBuffer.view, data, offset](vk::raii::CommandBuffer &commandBuffer, const std::shared_ptr<FenceCycle> &cycle, GPU &) {
|
||||||
std::scoped_lock lock{view};
|
std::scoped_lock lock{view};
|
||||||
commandBuffer.updateBuffer<u32>(view.bufferDelegate->buffer->GetBacking(), offset, vk::ArrayProxy(1, &data));
|
commandBuffer.updateBuffer<u32>(view.bufferDelegate->buffer->GetBacking(), offset, vk::ArrayProxy(1, &data));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user