Wgpu: copy_buffer_to_buffer with size 0 causes floating point exception on Metal

Created on 29 Oct 2019  路  1Comment  路  Source: gfx-rs/wgpu

Minimal wgpu-rs example, using curent wgpu-rs master (which is pinned to a ~2 week old wgpu-native, but there don't seem to have been any relevant commits since then).

Hits a divide-by-zero in the Intel Metal driver: https://gist.github.com/michaelfairley/b523353bd9ac5b06f363e6d9899e2565#file-crash_report

The docs for the underlying Metal function don't say anything about 0 being undefined/forbidden: https://developer.apple.com/documentation/metal/mtlblitcommandencoder/1400767-copy

Vulkan spec says "The size must be greater than 0", so it seems like wgpu is on the hook for making this safe.

bug

Most helpful comment

Thank you for filing! We should just ignore the command if the copy is of size 0

>All comments

Thank you for filing! We should just ignore the command if the copy is of size 0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lordnoriyuki picture lordnoriyuki  路  17Comments

lordnoriyuki picture lordnoriyuki  路  21Comments

cloudhead picture cloudhead  路  15Comments

MarekLg picture MarekLg  路  39Comments

kvark picture kvark  路  11Comments