3350c0a779
The previous code had some minor issues with it, really not a big deal, but amending it is basically 'free', so I figured, "why not?". With the standard container maps, when: map[key] = thing; is done, this can cause potentially undesirable behavior in certain scenarios. In particular, if there's no value associated with the key, then the map constructs a default initialized instance of the value type. In this case, since it's a std::shared_ptr (as a type alias) that is the value type, this will construct a std::shared_pointer, and then assign over it (with objects that are quite large, or actively heap allocate this can be extremely undesirable). We also make the function take the region by value, as we can avoid a copy (and by extension with std::shared_ptr, a copy causes an atomic reference count increment), in certain scenarios when ownership isn't a concern (i.e. when ReserveGlobalRegion is called with an rvalue reference, then no copy at all occurs). So, it's more-or-less a "free" gain without many downsides. |
||
---|---|---|
.. | ||
debug_utils | ||
engines | ||
renderer_opengl | ||
renderer_vulkan | ||
shader | ||
textures | ||
CMakeLists.txt | ||
dma_pusher.cpp | ||
dma_pusher.h | ||
gpu_asynch.cpp | ||
gpu_asynch.h | ||
gpu_synch.cpp | ||
gpu_synch.h | ||
gpu_thread.cpp | ||
gpu_thread.h | ||
gpu.cpp | ||
gpu.h | ||
macro_interpreter.cpp | ||
macro_interpreter.h | ||
memory_manager.cpp | ||
memory_manager.h | ||
morton.cpp | ||
morton.h | ||
rasterizer_cache.cpp | ||
rasterizer_cache.h | ||
rasterizer_interface.h | ||
renderer_base.cpp | ||
renderer_base.h | ||
surface.cpp | ||
surface.h | ||
video_core.cpp | ||
video_core.h |