mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 10:14:17 +01:00
Always reset all attached resources on Submit
Certain resources can be attached to an empty `Submit` with no nodes, this can cause it to become a false dependency and not be removed till the next non-empty submission. This has now been fixed by doing a reset regardless of if any nodes exist.
This commit is contained in:
parent
47db8e8cbc
commit
34e1e39d1c
@ -290,8 +290,6 @@ namespace skyline::gpu::interconnect {
|
||||
cycle->ChainCycle(attachedTexture->cycle);
|
||||
attachedTexture->cycle = cycle;
|
||||
}
|
||||
attachedTextures.clear();
|
||||
textureManagerLock.reset();
|
||||
|
||||
for (const auto &attachedBuffer : attachedBuffers) {
|
||||
if (attachedBuffer->UsedByContext()) {
|
||||
@ -300,17 +298,22 @@ namespace skyline::gpu::interconnect {
|
||||
attachedBuffer->cycle = cycle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CommandExecutor::ResetInternal() {
|
||||
attachedTextures.clear();
|
||||
textureManagerLock.reset();
|
||||
|
||||
for (const auto &delegate : attachedBufferDelegates) {
|
||||
delegate->usageCallback = nullptr;
|
||||
delegate->view->megabufferOffset = 0;
|
||||
}
|
||||
|
||||
attachedBuffers.clear();
|
||||
attachedBufferDelegates.clear();
|
||||
attachedBuffers.clear();
|
||||
bufferManagerLock.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void CommandExecutor::Submit() {
|
||||
if (!nodes.empty()) {
|
||||
@ -320,6 +323,7 @@ namespace skyline::gpu::interconnect {
|
||||
cycle = activeCommandBuffer.GetFenceCycle();
|
||||
megaBuffer = gpu.buffer.AcquireMegaBuffer(cycle);
|
||||
}
|
||||
ResetInternal();
|
||||
}
|
||||
|
||||
void CommandExecutor::SubmitWithFlush() {
|
||||
@ -329,5 +333,6 @@ namespace skyline::gpu::interconnect {
|
||||
cycle = activeCommandBuffer.Reset();
|
||||
megaBuffer.Reset();
|
||||
}
|
||||
ResetInternal();
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,11 @@ namespace skyline::gpu::interconnect {
|
||||
*/
|
||||
void SubmitInternal();
|
||||
|
||||
/**
|
||||
* @brief Resets all the internal state, this must be called before starting a new submission as it clears everything from a past submission
|
||||
*/
|
||||
void ResetInternal();
|
||||
|
||||
public:
|
||||
std::shared_ptr<FenceCycle> cycle; //!< The fence cycle that this command executor uses to wait for the GPU to finish executing commands
|
||||
MegaBuffer megaBuffer; //!< The megabuffer used to temporarily store buffer modifications allowing them to be replayed in-sequence on the GPU
|
||||
|
Loading…
Reference in New Issue
Block a user