Keep track of an 'execution number' in CommandExecutor

Allows users to efficiently cache resources that are valid for only one execution without resorting to callbacks.
This commit is contained in:
Billy Laws 2022-09-17 13:05:48 +01:00
parent 99a34df4cc
commit cc776ae395
2 changed files with 5 additions and 0 deletions

View File

@ -328,6 +328,8 @@ namespace skyline::gpu::interconnect {
cycle = activeCommandBuffer.GetFenceCycle(); cycle = activeCommandBuffer.GetFenceCycle();
} }
ResetInternal(); ResetInternal();
executionNumber++;
} }
void CommandExecutor::SubmitWithFlush() { void CommandExecutor::SubmitWithFlush() {
@ -340,5 +342,7 @@ namespace skyline::gpu::interconnect {
cycle = activeCommandBuffer.Reset(); cycle = activeCommandBuffer.Reset();
} }
ResetInternal(); ResetInternal();
executionNumber++;
} }
} }

View File

@ -99,6 +99,7 @@ namespace skyline::gpu::interconnect {
std::shared_ptr<FenceCycle> cycle; //!< The fence cycle that this command executor uses to wait for the GPU to finish executing commands std::shared_ptr<FenceCycle> cycle; //!< The fence cycle that this command executor uses to wait for the GPU to finish executing commands
LinearAllocatorState<> allocator; LinearAllocatorState<> allocator;
ContextTag tag; //!< The tag associated with this command executor, any tagged resource locking must utilize this tag ContextTag tag; //!< The tag associated with this command executor, any tagged resource locking must utilize this tag
size_t executionNumber{};
CommandExecutor(const DeviceState &state); CommandExecutor(const DeviceState &state);