Ensure correct flushing for batched constant buffer updates

Cbufs could be read by non-maxwell3D engines so force a flush when switching to them or before Execute.
This commit is contained in:
Billy Laws
2022-05-04 20:48:59 +01:00
parent ad989750fc
commit 03594a081c
5 changed files with 58 additions and 31 deletions

View File

@ -164,6 +164,10 @@ namespace skyline::gpu::interconnect {
}
}
void CommandExecutor::AddFlushCallback(std::function<void()> &&callback) {
flushCallbacks.emplace_back(std::forward<decltype(callback)>(callback));
}
void CommandExecutor::Execute() {
if (!nodes.empty()) {
TRACE_EVENT("gpu", "CommandExecutor::Execute");

View File

@ -29,6 +29,8 @@ namespace skyline::gpu::interconnect {
span<TextureView *> lastSubpassColorAttachments; //!< The set of color attachments used in the last subpass
TextureView *lastSubpassDepthStencilAttachment{}; //!< The depth stencil attachment used in the last subpass
std::vector<std::function<void()>> flushCallbacks; //!< Set of persistent callbacks that will be called at the start of Execute in order to flush data required for recording
/**
* @brief Create a new render pass and subpass with the specified attachments, if one doesn't already exist or the current one isn't compatible
* @note This also checks for subpass coalescing and will merge the new subpass with the previous one when possible
@ -91,6 +93,11 @@ namespace skyline::gpu::interconnect {
*/
void AddOutsideRpCommand(std::function<void(vk::raii::CommandBuffer &, const std::shared_ptr<FenceCycle> &, GPU &)> &&function);
/**
* @brief Adds a persistent callback that will be called at the start of Execute in order to flush data required for recording
*/
void AddFlushCallback(std::function<void()> &&callback);
/**
* @brief Execute all the nodes and submit the resulting command buffer to the GPU
*/