mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 15:15:30 +03:00
Add callback for when non-Maxwell3D engines alter pipeline state
This is required so that Maxwell3D knows to restore all dynamic state before the next draw
This commit is contained in:
parent
7133c5d6b3
commit
d42814bdc1
@ -356,6 +356,15 @@ namespace skyline::gpu::interconnect {
|
||||
flushCallbacks.emplace_back(std::forward<decltype(callback)>(callback));
|
||||
}
|
||||
|
||||
void CommandExecutor::AddPipelineChangeCallback(std::function<void()> &&callback) {
|
||||
pipelineChangeCallbacks.emplace_back(std::forward<decltype(callback)>(callback));
|
||||
}
|
||||
|
||||
void CommandExecutor::NotifyPipelineChange() {
|
||||
for (auto &callback : pipelineChangeCallbacks)
|
||||
callback();
|
||||
}
|
||||
|
||||
void CommandExecutor::SubmitInternal() {
|
||||
if (renderPass)
|
||||
FinishRenderPass();
|
||||
|
@ -122,6 +122,7 @@ namespace skyline::gpu::interconnect {
|
||||
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
|
||||
std::vector<std::function<void()>> pipelineChangeCallbacks; //!< Set of persistent callbacks that will be called after any non-Maxwell 3D engine changes the active pipeline
|
||||
|
||||
void RotateRecordSlot();
|
||||
|
||||
@ -243,6 +244,16 @@ namespace skyline::gpu::interconnect {
|
||||
*/
|
||||
void AddFlushCallback(std::function<void()> &&callback);
|
||||
|
||||
/**
|
||||
* @brief Adds a persistent callback that will be called after any non-Maxwell 3D engine changes the active pipeline
|
||||
*/
|
||||
void AddPipelineChangeCallback(std::function<void()> &&callback);
|
||||
|
||||
/**
|
||||
* @brief Calls all registered pipeline change callbacks
|
||||
*/
|
||||
void NotifyPipelineChange();
|
||||
|
||||
/**
|
||||
* @brief Execute all the nodes and submit the resulting command buffer to the GPU
|
||||
*/
|
||||
|
@ -147,6 +147,8 @@ namespace skyline::gpu::interconnect {
|
||||
executor.AddSubpass(std::move(executionCallback), {{static_cast<i32>(dstRectX), static_cast<i32>(dstRectY)}, {dstRectWidth, dstRectHeight} }, {}, {dst});
|
||||
}
|
||||
);
|
||||
|
||||
executor.NotifyPipelineChange();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,10 @@ namespace skyline::gpu::interconnect::maxwell3d {
|
||||
constantBuffers.MarkAllDirty();
|
||||
samplers.MarkAllDirty();
|
||||
});
|
||||
|
||||
executor.AddPipelineChangeCallback([this] {
|
||||
activeState.MarkAllDirty();
|
||||
});
|
||||
}
|
||||
|
||||
vk::Rect2D Maxwell3D::GetClearScissor() {
|
||||
|
Loading…
Reference in New Issue
Block a user