Glavnokoman / vuh

Vulkan compute for people
https://glavnokoman.github.io/vuh
MIT License
346 stars 34 forks source link

Fix copyBuf size in DeviceArray::fromHost (2 overloads) and DeviceArray::rangeToHost #72

Closed mfairclough closed 1 year ago

mfairclough commented 1 year ago
  1. Calls to copyBuf in both overloads of DeviceArray::fromHost were passing the wrong lengths. They were using size_bytes() which is larger than the staging buffer if end - begin defines a sub-range.
  2. The call to copyBuf in DeviceArray::rangeToHost was passing the wrong length. It was using size_bytes() which is larger than the staging buffer if offset_end - offset_begin defines a sub-range.
  3. The call to copyBuf in DeviceArray::rangeToHost was missing a sizeof(T) factor on src_offset.