]> git.seodisparate.com - blue_noise_generation/commitdiff
Refactor: code where neither Vulkan/OpenCL is used
authorStephen Seo <seo.disparate@gmail.com>
Wed, 20 Mar 2024 05:29:03 +0000 (14:29 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 20 Mar 2024 05:29:03 +0000 (14:29 +0900)
src/blue_noise.cpp

index eab89186979029a092381eb8ab5f8b4dd58d4a83..b90dcc1364fe09b1f0f332e2928bdf599d2114c2 100644 (file)
@@ -70,9 +70,6 @@ QueueFamilyIndices find_queue_families(VkPhysicalDevice device) {
 
 image::Bl dither::blue_noise(int width, int height, int threads,
                              bool use_opencl, bool use_vulkan) {
-  bool using_opencl = false;
-  bool using_vulkan = false;
-
 #if DITHERING_VULKAN_ENABLED == 1
   if (use_vulkan) {
     // Try to use Vulkan.
@@ -525,16 +522,11 @@ ENDOF_VULKAN:
   std::clog << "WARNING: Not compiled with OpenCL support!\n";
 #endif
 
-  if (!using_opencl) {
-    std::cout << "OpenCL: Failed to setup/use or is not enabled, using "
-                 "regular impl..."
-              << std::endl;
-    return internal::rangeToBl(
-        internal::blue_noise_impl(width, height, threads), width);
-  }
-
-  std::cout << "ERROR: Invalid state (end of blue_noise fn)\n";
-  return {};
+  std::cout << "Vulkan/OpenCL: Failed to setup/use or is not enabled, using "
+               "regular impl..."
+            << std::endl;
+  return internal::rangeToBl(internal::blue_noise_impl(width, height, threads),
+                             width);
 }
 
 std::vector<unsigned int> dither::internal::blue_noise_impl(int width,