diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-18 22:41:48 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-19 00:01:08 +0300 |
commit | 683570c7fe0916acfbfc38964a5ed236e4be0ea5 (patch) | |
tree | 355449ee01c6902d79cfb86ab0ce5c08981f069b /source/blender/draw/intern/DRW_gpu_wrapper.hh | |
parent | 80811c5638ac5ccb425eaea2886273c4a3121aea (diff) |
DRW: Wrappers: Use runtime length of the buffer instead of the initial len
This could have produce errors especially in the iterators.
Diffstat (limited to 'source/blender/draw/intern/DRW_gpu_wrapper.hh')
-rw-r--r-- | source/blender/draw/intern/DRW_gpu_wrapper.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 361ea743bb6..b5638cd1129 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -102,7 +102,7 @@ class DataBuffer { { BLI_STATIC_ASSERT(!device_only, ""); BLI_assert(index >= 0); - BLI_assert(index < len); + BLI_assert(index < len_); return data_[index]; } @@ -110,7 +110,7 @@ class DataBuffer { { BLI_STATIC_ASSERT(!device_only, ""); BLI_assert(index >= 0); - BLI_assert(index < len); + BLI_assert(index < len_); return data_[index]; } @@ -139,7 +139,7 @@ class DataBuffer { const T *end() const { BLI_STATIC_ASSERT(!device_only, ""); - return data_ + len; + return data_ + len_; } T *begin() @@ -150,13 +150,13 @@ class DataBuffer { T *end() { BLI_STATIC_ASSERT(!device_only, ""); - return data_ + len; + return data_ + len_; } operator Span<T>() const { BLI_STATIC_ASSERT(!device_only, ""); - return Span<T>(data_, len); + return Span<T>(data_, len_); } }; |