diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-11 22:59:44 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-14 21:38:27 +0100 |
commit | bcd348f2388cf944f2ac49364a8d13b47cc21456 (patch) | |
tree | 7aefb0077b4d8902bdab3f3026361173a71046e3 /src/video_core/renderer_vulkan/vk_scheduler.h | |
parent | query_cache: Abstract OpenGL implementation (diff) | |
download | yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.gz yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.bz2 yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.lz yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.xz yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.zst yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_scheduler.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_scheduler.h b/src/video_core/renderer_vulkan/vk_scheduler.h index bcdffbba0..62fd7858b 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.h +++ b/src/video_core/renderer_vulkan/vk_scheduler.h @@ -4,6 +4,7 @@ #pragma once +#include <atomic> #include <condition_variable> #include <memory> #include <optional> @@ -18,6 +19,7 @@ namespace Vulkan { class VKDevice; class VKFence; +class VKQueryCache; class VKResourceManager; class VKFenceView { @@ -67,6 +69,11 @@ public: /// Binds a pipeline to the current execution context. void BindGraphicsPipeline(vk::Pipeline pipeline); + /// Assigns the query cache. + void SetQueryCache(VKQueryCache& query_cache_) { + query_cache = &query_cache_; + } + /// Returns true when viewports have been set in the current command buffer. bool TouchViewports() { return std::exchange(state.viewports, true); @@ -112,6 +119,11 @@ public: return current_fence; } + /// Returns the current command buffer tick. + u64 Ticks() const { + return ticks; + } + private: class Command { public: @@ -205,6 +217,8 @@ private: const VKDevice& device; VKResourceManager& resource_manager; + VKQueryCache* query_cache = nullptr; + vk::CommandBuffer current_cmdbuf; VKFence* current_fence = nullptr; VKFence* next_fence = nullptr; @@ -227,6 +241,7 @@ private: Common::SPSCQueue<std::unique_ptr<CommandChunk>> chunk_reserve; std::mutex mutex; std::condition_variable cv; + std::atomic<u64> ticks = 0; bool quit = false; }; |