From cc776ae395fff20bb4fead8d047c0253942a2b4f Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 17 Sep 2022 13:05:48 +0100 Subject: [PATCH] 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. --- .../main/cpp/skyline/gpu/interconnect/command_executor.cpp | 4 ++++ app/src/main/cpp/skyline/gpu/interconnect/command_executor.h | 1 + 2 files changed, 5 insertions(+) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp index e9a6171e..213fab86 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.cpp @@ -328,6 +328,8 @@ namespace skyline::gpu::interconnect { cycle = activeCommandBuffer.GetFenceCycle(); } ResetInternal(); + + executionNumber++; } void CommandExecutor::SubmitWithFlush() { @@ -340,5 +342,7 @@ namespace skyline::gpu::interconnect { cycle = activeCommandBuffer.Reset(); } ResetInternal(); + + executionNumber++; } } diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h index f903c653..4b6f3a54 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_executor.h @@ -99,6 +99,7 @@ namespace skyline::gpu::interconnect { std::shared_ptr cycle; //!< The fence cycle that this command executor uses to wait for the GPU to finish executing commands LinearAllocatorState<> allocator; ContextTag tag; //!< The tag associated with this command executor, any tagged resource locking must utilize this tag + size_t executionNumber{}; CommandExecutor(const DeviceState &state);