|
|
@ -64,19 +64,24 @@ public: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void SignalFence(std::function<void()>&& func) { |
|
|
void SignalFence(std::function<void()>&& func) { |
|
|
|
|
|
bool delay_fence = Settings::IsGPULevelHigh(); |
|
|
if constexpr (!can_async_check) { |
|
|
if constexpr (!can_async_check) { |
|
|
TryReleasePendingFences<false>(); |
|
|
TryReleasePendingFences<false>(); |
|
|
} |
|
|
} |
|
|
std::function<void()> callback = std::move(func); |
|
|
|
|
|
const bool should_flush = ShouldFlush(); |
|
|
const bool should_flush = ShouldFlush(); |
|
|
CommitAsyncFlushes(); |
|
|
CommitAsyncFlushes(); |
|
|
TFence new_fence = CreateFence(!should_flush); |
|
|
TFence new_fence = CreateFence(!should_flush); |
|
|
if constexpr (can_async_check) { |
|
|
if constexpr (can_async_check) { |
|
|
guard.lock(); |
|
|
guard.lock(); |
|
|
} |
|
|
} |
|
|
|
|
|
if (delay_fence) { |
|
|
|
|
|
uncommitted_operations.emplace_back(std::move(func)); |
|
|
|
|
|
} |
|
|
pending_operations.emplace_back(std::move(uncommitted_operations)); |
|
|
pending_operations.emplace_back(std::move(uncommitted_operations)); |
|
|
QueueFence(new_fence); |
|
|
QueueFence(new_fence); |
|
|
callback(); |
|
|
|
|
|
|
|
|
if (!delay_fence) { |
|
|
|
|
|
func(); |
|
|
|
|
|
} |
|
|
fences.push(std::move(new_fence)); |
|
|
fences.push(std::move(new_fence)); |
|
|
if (should_flush) { |
|
|
if (should_flush) { |
|
|
rasterizer.FlushCommands(); |
|
|
rasterizer.FlushCommands(); |
|
|
|