No description
Stephen Seo
dfc78540db
This commit does some preparation for a new Vulkan compute shader "blue_noise_filter.glsl". Note that every call of "filter" is followed by a call to "min_max". The goal is to combine a single invocation of Vulkan "filter" and log(n) invocations of Vulkan "min_max" in the same command buffer, which may help with performance. This will be achieved by passing the "max_in_buf" to the new "filter" compute shader, which will hold the results of applying the precomputed-gaussian. This buffer will then be copied to "min_in_buf", and then all is set to call the Vulkan "min_max" compute shader log(n) times. Note that log(n) comes from the fact that the Vulkan "min_max" compute shader does a "reduce" on the input buffers where each SIMD invocation compares two values and reduces it to 1. Doing this approximately log(n) (log base 2) times will reduce the input gradually into a single minimum and single maximum. This works due to having two separate "layouts" for the same "min_max" shader where the "in" and "out" buffers are swapped per "layout", and so by calling the other layout each time ensures that the proper buffers are reduced. (This work has already been done. What's left is to combine the "filter" and "min_max" Vulkan compute shaders into the same Vulkan command buffer. But first, the actual setup for the new Vulkan "filter" compute shader still has some work to do.) |
||
---|---|---|
src | ||
.clangd | ||
.gitignore | ||
CMakeLists.txt | ||
LICENSE | ||
README.md |
Blue_Noise_Generation
Currently, this project only generates blue-noise, which can be used for dithering.
The blue-noise can be generated via OpenCL, Vulkan compute, or with threads on
the CPU.