Adjust gpfifo WFI to only do a pipeline barrier

This commit is contained in:
Billy Laws 2023-01-09 21:58:25 +00:00
parent 2b282ece1a
commit e2463b7619
3 changed files with 17 additions and 1 deletions

View File

@ -443,6 +443,17 @@ namespace skyline::gpu::interconnect {
slot->nodes.emplace_back(std::in_place_type_t<node::FunctionNode>(), std::forward<decltype(function)>(function)); slot->nodes.emplace_back(std::in_place_type_t<node::FunctionNode>(), std::forward<decltype(function)>(function));
} }
void CommandExecutor::AddFullBarrier() {
AddOutsideRpCommand([](vk::raii::CommandBuffer &commandBuffer, const std::shared_ptr<FenceCycle> &, GPU &) {
commandBuffer.pipelineBarrier(
vk::PipelineStageFlagBits::eAllCommands, vk::PipelineStageFlagBits::eAllCommands, {}, vk::MemoryBarrier{
.srcAccessMask = vk::AccessFlagBits::eMemoryRead | vk::AccessFlagBits::eMemoryWrite,
.dstAccessMask = vk::AccessFlagBits::eMemoryRead | vk::AccessFlagBits::eMemoryWrite,
}, {}, {}
);
});
}
void CommandExecutor::AddClearColorSubpass(TextureView *attachment, const vk::ClearColorValue &value) { void CommandExecutor::AddClearColorSubpass(TextureView *attachment, const vk::ClearColorValue &value) {
bool gotoNext{CreateRenderPassWithSubpass(vk::Rect2D{.extent = attachment->texture->dimensions}, {}, {}, attachment, nullptr)}; bool gotoNext{CreateRenderPassWithSubpass(vk::Rect2D{.extent = attachment->texture->dimensions}, {}, {}, attachment, nullptr)};
if (renderPass->ClearColorAttachment(0, value, gpu)) { if (renderPass->ClearColorAttachment(0, value, gpu)) {

View File

@ -284,6 +284,11 @@ namespace skyline::gpu::interconnect {
*/ */
void AddOutsideRpCommand(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 Adds a full pipeline barrier to the command buffer
*/
void AddFullBarrier();
/** /**
* @brief Adds a persistent callback that will be called at the start of Execute in order to flush data required for recording * @brief Adds a persistent callback that will be called at the start of Execute in order to flush data required for recording
*/ */

View File

@ -118,7 +118,7 @@ namespace skyline::soc::gm20b::engine {
} }
}) })
ENGINE_CASE(wfi, { ENGINE_CASE(wfi, {
channelCtx.executor.Submit(); channelCtx.executor.AddFullBarrier();
}) })
ENGINE_CASE(setReference, { ENGINE_CASE(setReference, {
channelCtx.executor.Submit(); channelCtx.executor.Submit();