From e0f2db437650c33e797bb33ee51c753a3c14fe86 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 25 Sep 2020 00:12:45 -0400 Subject: vk_command_pool: Add missing header guard --- src/video_core/renderer_vulkan/vk_command_pool.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video_core/renderer_vulkan/vk_command_pool.h b/src/video_core/renderer_vulkan/vk_command_pool.h index 3aee239b9..fb98f72fc 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.h +++ b/src/video_core/renderer_vulkan/vk_command_pool.h @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#pragma once + #include #include -- cgit v1.2.3 From 4ed4bba3050584cfe3e31a4bcc694c818c5baf2d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 25 Sep 2020 00:14:10 -0400 Subject: vk_command_pool: Make use of override on destructor --- src/video_core/renderer_vulkan/vk_command_pool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/renderer_vulkan/vk_command_pool.h b/src/video_core/renderer_vulkan/vk_command_pool.h index fb98f72fc..92d8a9f4d 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.h +++ b/src/video_core/renderer_vulkan/vk_command_pool.h @@ -18,7 +18,7 @@ class VKDevice; class CommandPool final : public ResourcePool { public: explicit CommandPool(MasterSemaphore& master_semaphore, const VKDevice& device); - virtual ~CommandPool(); + ~CommandPool() override; void Allocate(size_t begin, size_t end) override; -- cgit v1.2.3 From 940d85241bbd1f7fdbd65373e4c80b10025f8b1b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 25 Sep 2020 00:15:50 -0400 Subject: vk_command_pool: Move definition of Pool into the cpp file Allows the implementation details to be changed without recompiling any files that include this header. --- src/video_core/renderer_vulkan/vk_command_pool.cpp | 5 +++++ src/video_core/renderer_vulkan/vk_command_pool.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_command_pool.cpp b/src/video_core/renderer_vulkan/vk_command_pool.cpp index f1abd4b1a..6339f4fe0 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_command_pool.cpp @@ -12,6 +12,11 @@ namespace Vulkan { constexpr size_t COMMAND_BUFFER_POOL_SIZE = 0x1000; +struct CommandPool::Pool { + vk::CommandPool handle; + vk::CommandBuffers cmdbufs; +}; + CommandPool::CommandPool(MasterSemaphore& master_semaphore, const VKDevice& device) : ResourcePool(master_semaphore, COMMAND_BUFFER_POOL_SIZE), device{device} {} diff --git a/src/video_core/renderer_vulkan/vk_command_pool.h b/src/video_core/renderer_vulkan/vk_command_pool.h index 92d8a9f4d..b9cb3fb5d 100644 --- a/src/video_core/renderer_vulkan/vk_command_pool.h +++ b/src/video_core/renderer_vulkan/vk_command_pool.h @@ -25,10 +25,7 @@ public: VkCommandBuffer Commit(); private: - struct Pool { - vk::CommandPool handle; - vk::CommandBuffers cmdbufs; - }; + struct Pool; const VKDevice& device; std::vector pools; -- cgit v1.2.3