diff options
| author | 2020-09-19 01:47:29 -0300 | |
|---|---|---|
| committer | 2020-09-19 01:47:29 -0300 | |
| commit | 4f5bbe56ba1a590f4f266945d29b4bc9a04c23fd (patch) | |
| tree | 4d798c1b6e30b9f6f8f3568a3927ce58e41812e0 | |
| parent | renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore (diff) | |
| download | yuzu-4f5bbe56ba1a590f4f266945d29b4bc9a04c23fd.tar.gz yuzu-4f5bbe56ba1a590f4f266945d29b4bc9a04c23fd.tar.xz yuzu-4f5bbe56ba1a590f4f266945d29b4bc9a04c23fd.zip | |
vk_query_cache: Hack counter destructor to avoid reserving queries
This is a hack to destroy all HostCounter instances before the base
class destructor is called. The query cache should be redesigned to have
a proper ownership model instead of using shared pointers.
For now, destroy the host counter hierarchy from the derived class
destructor.
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 28a793f97..ee2d871e3 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -76,7 +76,16 @@ VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer, | |||
| 76 | QueryType::SamplesPassed}, | 76 | QueryType::SamplesPassed}, |
| 77 | } {} | 77 | } {} |
| 78 | 78 | ||
| 79 | VKQueryCache::~VKQueryCache() = default; | 79 | VKQueryCache::~VKQueryCache() { |
| 80 | // TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class | ||
| 81 | // destructor is called. The query cache should be redesigned to have a proper ownership model | ||
| 82 | // instead of using shared pointers. | ||
| 83 | for (size_t query_type = 0; query_type < VideoCore::NumQueryTypes; ++query_type) { | ||
| 84 | auto& stream = Stream(static_cast<QueryType>(query_type)); | ||
| 85 | stream.Update(false); | ||
| 86 | stream.Reset(); | ||
| 87 | } | ||
| 88 | } | ||
| 80 | 89 | ||
| 81 | std::pair<VkQueryPool, u32> VKQueryCache::AllocateQuery(QueryType type) { | 90 | std::pair<VkQueryPool, u32> VKQueryCache::AllocateQuery(QueryType type) { |
| 82 | return query_pools[static_cast<std::size_t>(type)].Commit(); | 91 | return query_pools[static_cast<std::size_t>(type)].Commit(); |