diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-19 23:04:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-19 23:04:41 +0300 |
commit | 70ec3d3a3e7a7566a3bcffa2b36fc0f0c85ab69e (patch) | |
tree | 699536c111892a331fd7118dd0b1893674fd6484 /source/blender/draw | |
parent | 0503bbf989fa600bacc5ec91e1c1608b3c816f3c (diff) |
DRW: Add optional name to storage buffers
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/DRW_gpu_wrapper.hh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 0eaf30de42b..85c365ce76d 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -209,8 +209,11 @@ class StorageCommon : public DataBuffer<T, len, false>, NonMovable, NonCopyable #endif public: - StorageCommon() + StorageCommon(const char *name = nullptr) { + if (name) { + name_ = name; + } init(len); } @@ -318,7 +321,7 @@ template< bool device_only = false> class StorageArrayBuffer : public detail::StorageCommon<T, len, device_only> { public: - StorageArrayBuffer() + StorageArrayBuffer(const char *name = nullptr) : detail::StorageCommon<T, len, device_only>(name) { /* TODO(@fclem): We should map memory instead. */ this->data_ = (T *)MEM_mallocN_aligned(len * sizeof(T), 16, this->name_); @@ -336,7 +339,7 @@ template< bool device_only = false> class StorageBuffer : public T, public detail::StorageCommon<T, 1, device_only> { public: - StorageBuffer() + StorageBuffer(const char *name = nullptr) : detail::StorageCommon<T, 1, device_only>(name) { /* TODO(@fclem): How could we map this? */ this->data_ = static_cast<T *>(this); |