We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamic_array
Currently the dynamic_array is only possible to be created on the heap, we'd like for it to be creatable on the stack as well.
But its a base for smart_refctd_dynamic_array which strictly disallows copies and moves (except of the handle) so it always needs to live on the heap.
smart_refctd_dynamic_array
Therefore we need a unique_dynamic_array.
unique_dynamic_array
For use cases see CVulkanCommandBuffer which simply declares stack arrays
CVulkanCommandBuffer
First of all the base classes of dynamic_array should be rewritten to allow for:
&&
We'd rewrite the thing to something akin to this
template<class T, size_t SmallVectorSize=1023/sizeof(T)+1, class allocator=core::allocator<T>, typename... OverAlignmentTypes> class alignas(ResolveAlignment<allocator,AlignedBase<T>,AlignedBase<alignof(OverAlignmentTypesTypes)>...>) dynamic_array_base { protected: dynamic_array_base(allocator&& _allocator, size_t _itemCount) : m_allocator(std::move(_allocator)), m_itemCount(_itemCount) {} allocator m_allocator; size_t m_itemCount; alignas(ResolveAlignment<allocator,AlignedBase<T>,AlignedBase<alignof(OverAlignmentTypesTypes)>...>) union { T m_data[SmallVectorSize]; }; public: _NBL_NO_COPY_FINAL(dynamic_array_base); _NBL_NO_MOVE_FINAL(dynamic_array_base); };
Then the following should be constructible on the stack
unique_dynamic_array<VkBuffer> buffers(bufferCount);
MSVC finally follows the C++ standard so gccHappyVar can be renamed just to _allocator cause its finally needed
gccHappyVar
_allocator
@Przemog1 made a Visual Studio debugger visualizer, now its needs to be updated to properly display the data https://github.com/Devsh-Graphics-Programming/Nabla/blob/a16fec199ca775bfc41a0f8e03aff90ff37197bb/tools/debug/VisualStudio/DynamicArrayVisualizer.natvis
The text was updated successfully, but these errors were encountered:
devshgraphicsprogramming
No branches or pull requests
Description
Currently the
dynamic_array
is only possible to be created on the heap, we'd like for it to be creatable on the stack as well.But its a base for
smart_refctd_dynamic_array
which strictly disallows copies and moves (except of the handle) so it always needs to live on the heap.Therefore we need a
unique_dynamic_array
.Description of the related problem
For use cases see
CVulkanCommandBuffer
which simply declares stack arraysSolution proposal
First of all the base classes of
dynamic_array
should be rewritten to allow for:&&
or be perfectly forwardedWe'd rewrite the thing to something akin to this
Then the following should be constructible on the stack
unique_dynamic_array<VkBuffer> buffers(bufferCount);
Additional context (Visual Studio)
MSVC finally follows the C++ standard so
gccHappyVar
can be renamed just to_allocator
cause its finally needed@Przemog1 made a Visual Studio debugger visualizer, now its needs to be updated to properly display the data
https://github.com/Devsh-Graphics-Programming/Nabla/blob/a16fec199ca775bfc41a0f8e03aff90ff37197bb/tools/debug/VisualStudio/DynamicArrayVisualizer.natvis
The text was updated successfully, but these errors were encountered: