1
0
Fork 0
forked from suyu/suyu
suyu/src/video_core
Lioncash 3350c0a779 renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign
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.
2019-03-11 12:20:35 -04:00
..
debug_utils debug_utils: Remove unused includes 2018-08-24 20:49:14 -04:00
engines Merge pull request #2147 from ReinUsesLisp/texture-clean 2019-03-10 17:28:36 -04:00
renderer_opengl renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign 2019-03-11 12:20:35 -04:00
renderer_vulkan Merge pull request #2191 from ReinUsesLisp/maxwell-to-vk 2019-03-08 11:51:08 -05:00
shader shader/decode: Remove extras from MetaTexture 2019-02-26 00:11:30 -03:00
textures gl_rasterizer_cache: Move format conversion to its own file 2019-02-26 20:08:27 -03:00
CMakeLists.txt Merge pull request #2147 from ReinUsesLisp/texture-clean 2019-03-10 17:28:36 -04:00
dma_pusher.cpp dma_pusher: Store command_list_header by copy 2019-03-08 04:06:54 -03:00
dma_pusher.h video_core/dma_pusher: Simplyfy Step() logic. 2019-02-19 10:28:42 +01:00
gpu.cpp gpu: Refactor a/synchronous implementations into their own classes. 2019-03-06 21:48:57 -05:00
gpu.h video_core/gpu: Make GPU's destructor virtual 2019-03-07 15:59:45 -05:00
gpu_asynch.cpp gpu: Refactor a/synchronous implementations into their own classes. 2019-03-06 21:48:57 -05:00
gpu_asynch.h video_core/gpu: Make GPU's destructor virtual 2019-03-07 15:59:45 -05:00
gpu_synch.cpp gpu: Refactor a/synchronous implementations into their own classes. 2019-03-06 21:48:57 -05:00
gpu_synch.h video_core/gpu: Make GPU's destructor virtual 2019-03-07 15:59:45 -05:00
gpu_thread.cpp gpu_thread: Fix deadlock with threading idle state check. 2019-03-06 21:48:57 -05:00
gpu_thread.h video_core/gpu_thread: Remove unimplemented WaitForIdle function prototype 2019-03-07 16:08:52 -05:00
macro_interpreter.cpp Fixed uninitialized memory due to missing returns in canary 2018-12-19 12:52:32 +11:00
macro_interpreter.h macro_interpreter: Implement AddWithCarry and SubtractWithBorrow. 2018-11-22 00:58:00 -05:00
memory_manager.cpp memory_manager: Check for reserved page status 2019-02-03 04:58:24 -03:00
memory_manager.h memory_manager: Do not allow 0 to be a valid GPUVAddr. 2018-11-23 12:58:55 -05:00
morton.cpp gpu: Remove PixelFormat G8R8U and G8R8S, as they do not seem to exist. 2018-12-28 15:36:45 -05:00
morton.h Implemented Tile Width Spacing 2018-11-26 09:05:12 -04:00
rasterizer_cache.cpp rasterizer_cache: Add missing virtual destructor to RasterizerCacheObject 2018-11-08 00:31:39 -05:00
rasterizer_cache.h Devirtualize Register/Unregister and use a wrapper instead. 2019-02-27 21:58:50 -04:00
rasterizer_interface.h common/math_util: Move contents into the Common namespace 2019-02-27 03:38:39 -05:00
renderer_base.cpp video_core/engines: Remove unnecessary includes 2019-03-05 20:35:32 -05:00
renderer_base.h yuzu, video_core: Screenshot functionality 2018-12-18 22:54:41 +01:00
surface.cpp video_core/surface: Remove obsolete TODO in PixelFormatFromRenderTargetFormat() 2019-03-05 10:15:06 -05:00
surface.h video_core: Remove unused Fill surface type 2019-02-01 02:57:47 -03:00
video_core.cpp gl_shader_disk_cache: Pass core system as argument and guard against games without title ids 2019-02-06 22:23:40 -03:00
video_core.h gl_shader_disk_cache: Pass core system as argument and guard against games without title ids 2019-02-06 22:23:40 -03:00