halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.78k stars 1.07k forks source link

[vulkan] Parameter storage buffer alignment can fail validation #8287

Open derek-gerstmann opened 2 weeks ago

derek-gerstmann commented 2 weeks ago

As discovered on linux-worker-1 after we updated the Vulkan SDK to v1.3.283 running on an NVIDIA RTX 3070 w/driver 535.161.8.0:

bilateral_grid_process: Structure id 712 decorated as BufferBlock for variable in Uniform storage class must follow relaxed storage buffer layout rules: member 0 contains an array with stride 4 not satisfying alignment to 8

Other apps seem to fail with similar validation failures.

I'm not entirely sure how to handle alignment offsets within the storage buffer used to pass the parameters. We assume they're all packed together, which apparently isn't a valid assumption. So, we'll likely have to pad the buffer, and copy them into offsets that conform to the alignment.