From ea66a4423895ef8f97e5d503697e90d2ffff4a16 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 22 Mar 2024 17:03:56 +0900 Subject: [PATCH] QueueFamilyIndices struct: fn definitions in .cpp Instead of defining struct functions in header file, only declare them in the header file and define them in the source file. --- src/blue_noise.cpp | 6 ++++++ src/blue_noise.hpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/blue_noise.cpp b/src/blue_noise.cpp index d470400..6402311 100644 --- a/src/blue_noise.cpp +++ b/src/blue_noise.cpp @@ -33,6 +33,12 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL fn_VULKAN_DEBUG_CALLBACK( } #endif // VULKAN_VALIDATION == 1 +dither::internal::QueueFamilyIndices::QueueFamilyIndices() : computeFamily() {} + +bool dither::internal::QueueFamilyIndices::isComplete() { + return computeFamily.has_value(); +} + dither::internal::QueueFamilyIndices dither::internal::vulkan_find_queue_families(VkPhysicalDevice device) { QueueFamilyIndices indices; diff --git a/src/blue_noise.hpp b/src/blue_noise.hpp index 919302f..3be540b 100644 --- a/src/blue_noise.hpp +++ b/src/blue_noise.hpp @@ -39,11 +39,11 @@ std::vector blue_noise_impl(int width, int height, #if DITHERING_VULKAN_ENABLED == 1 struct QueueFamilyIndices { - QueueFamilyIndices() : computeFamily() {} + QueueFamilyIndices(); std::optional computeFamily; - bool isComplete() { return computeFamily.has_value(); } + bool isComplete(); }; QueueFamilyIndices vulkan_find_queue_families(VkPhysicalDevice device);