]> git.seodisparate.com - blue_noise_generation/commitdiff
QueueFamilyIndices struct: fn definitions in .cpp
authorStephen Seo <seo.disparate@gmail.com>
Fri, 22 Mar 2024 08:03:56 +0000 (17:03 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Fri, 22 Mar 2024 08:03:56 +0000 (17:03 +0900)
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
src/blue_noise.hpp

index d470400a98370a9ec5a0050f7ac622cf582d401b..640231199342d7dfa8106f8f2fc9d238b375f48e 100644 (file)
@@ -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;
index 919302f7c493b0bc2b7f1909fbce89b6a6fa2dfd..3be540bb9ffdb87c259e8c885bf57c91ad2a1ee4 100644 (file)
@@ -39,11 +39,11 @@ std::vector<unsigned int> blue_noise_impl(int width, int height,
 
 #if DITHERING_VULKAN_ENABLED == 1
 struct QueueFamilyIndices {
-  QueueFamilyIndices() : computeFamily() {}
+  QueueFamilyIndices();
 
   std::optional<uint32_t> computeFamily;
 
-  bool isComplete() { return computeFamily.has_value(); }
+  bool isComplete();
 };
 
 QueueFamilyIndices vulkan_find_queue_families(VkPhysicalDevice device);