I'm working on a comparison of WebAssembly performance for error propagation dithering using D, C++ and Zig. So far C++ and Zig work as expected, but for D, despite using the same algorithm and similar code the output is different.
You can see the differences here https://wasm-error-propagation-dither-comparison.netlify.app/ by opening an image.
Code
- D https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/d/main.d
- C++ https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/cpp/main.cpp
- Zig https://github.com/allen-garvey/wasm-error-propagation-dither-comparison/blob/master/wasm/zig/main.zig
Any help would be appreciated. From my extensive debugging it seems that calculating the pixel lightness is working correctly, it has something to do with either saving or retrieving the stored error in the float arrays.