WIP Vulkan compute: Fix buffer data
"filter_size" integer must be odd. This is how it is defined for the OpenCL implementation.
This commit is contained in:
parent
5cee471f1f
commit
3b0a5ab7dd
1 changed files with 8 additions and 2 deletions
|
@ -676,8 +676,14 @@ image::Bl dither::blue_noise(int width, int height, int threads,
|
||||||
vkMapMemory(device, staging_buffer_mem, 0, other_size, 0, &data_ptr);
|
vkMapMemory(device, staging_buffer_mem, 0, other_size, 0, &data_ptr);
|
||||||
std::memcpy(data_ptr, &width, sizeof(int));
|
std::memcpy(data_ptr, &width, sizeof(int));
|
||||||
std::memcpy(((char *)data_ptr) + sizeof(int), &height, sizeof(int));
|
std::memcpy(((char *)data_ptr) + sizeof(int), &height, sizeof(int));
|
||||||
std::memcpy(((char *)data_ptr) + sizeof(int) * 2, &filter_size,
|
if (filter_size % 2 == 0) {
|
||||||
sizeof(int));
|
int filter_size_odd = filter_size + 1;
|
||||||
|
std::memcpy(((char *)data_ptr) + sizeof(int) * 2, &filter_size_odd,
|
||||||
|
sizeof(int));
|
||||||
|
} else {
|
||||||
|
std::memcpy(((char *)data_ptr) + sizeof(int) * 2, &filter_size,
|
||||||
|
sizeof(int));
|
||||||
|
}
|
||||||
vkUnmapMemory(device, staging_buffer_mem);
|
vkUnmapMemory(device, staging_buffer_mem);
|
||||||
|
|
||||||
if (!vulkan_create_buffer(device, phys_device, other_size,
|
if (!vulkan_create_buffer(device, phys_device, other_size,
|
||||||
|
|
Loading…
Reference in a new issue