]> git.seodisparate.com - blue_noise_generation/commitdiff
Vulkan compute: resize max/min out buffers
authorStephen Seo <seo.disparate@gmail.com>
Fri, 29 Mar 2024 02:09:57 +0000 (11:09 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 3 Apr 2024 09:22:14 +0000 (18:22 +0900)
Change max/min out buffers to have same size as max/min in buffers.

src/blue_noise.cpp

index 3063f1289c990bc1c0dad5edc79fa9d8665e820f..1697efa944458598eceb3e3f3a532eea07e24956 100644 (file)
@@ -1810,8 +1810,7 @@ image::Bl dither::blue_noise(int width, int height, int threads,
 
     if (!internal::vulkan_create_buffer(
             device, phys_device,
-            ((width * height + 1) / 2) *
-                sizeof(dither::internal::FloatAndIndex),
+            width * height * sizeof(dither::internal::FloatAndIndex),
             VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
                 VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
             VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, min_out_buf,
@@ -1832,8 +1831,7 @@ image::Bl dither::blue_noise(int width, int height, int threads,
 
     if (!internal::vulkan_create_buffer(
             device, phys_device,
-            ((width * height + 1) / 2) *
-                sizeof(dither::internal::FloatAndIndex),
+            width * height * sizeof(dither::internal::FloatAndIndex),
             VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
                 VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
             VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, max_out_buf,